A self-learning electronic medical record structuring method and device based on prefix fine-tuning and reinforcement learning

By employing a self-learning method combining prefix fine-tuning and reinforcement learning, the problems of insufficient accuracy and flexibility in the structured processing of electronic medical records are addressed, achieving more efficient structured processing of medical texts, reducing annotation costs, and improving output consistency.

CN119763747BActive Publication Date: 2025-11-14ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411682650.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-11-14
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

Existing methods for structuring electronic medical records are insufficient in terms of accuracy and flexibility, especially when dealing with complex medical texts. Furthermore, traditional annotation techniques are costly and subjective.

Method used

We employ a self-learning approach combining prefix fine-tuning and reinforcement learning. By constructing an electronic medical record dataset and generating a formatted reinforcement learning preference dataset, we train and optimize the model. We also combine this with a medical standard entity library for entity alignment, thereby improving the model's structured processing capabilities.

Benefits of technology

It improves the accuracy and flexibility of structured processing of electronic medical records, reduces the cost of manual annotation, and enhances the consistency of output format and dataset quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119763747B_ABST
    Figure CN119763747B_ABST
Patent Text Reader

Abstract

This invention discloses a self-learning electronic medical record structuring method and apparatus based on prefix fine-tuning and reinforcement learning. First, the electronic medical record dataset is preprocessed, including text cleaning and de-identification, extracting key diagnostic information and clinical data, and organizing them into a predefined output format suitable for generative models. Next, a prefix cue fine-tuning method is used to train the model, obtaining a model with preliminary structuring capabilities. Then, a reinforcement learning preference dataset is constructed, and reinforcement learning is applied to address the model's output format issue, improving the format accuracy and content standardization of the output text. Subsequently, a self-optimization mechanism is used to improve the scale and quality of the training dataset through model backtracking. Finally, an entity alignment method is used to ensure the accuracy and standardization of extracted information. This invention provides an innovative structuring processing technology that can effectively improve the information extraction quality of electronic medical records, meeting the specific needs of the medical field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing, machine learning, and artificial intelligence, and in particular to a self-learning electronic medical record structuring method and apparatus based on prefix fine-tuning and reinforcement learning. Background Technology

[0002] Currently, many electronic medical records (EMR) structuring techniques employ deep learning models based on natural language processing (NLP). These deep learning-based structuring methods typically rely on predefined feature extraction or sequence labeling models to extract medical information. However, because the text content of EMRs often involves a large amount of complex and diverse medical terminology, diagnostic results, imaging reports, etc., existing models lack sufficient flexibility and accuracy when processing different types of medical text. Furthermore, traditional NLP models cannot fully understand the professional medical knowledge within the context, resulting in inaccurate structuring results for clinical texts.

[0003] To address the aforementioned challenges, large-scale pre-trained language models (LLMs) have demonstrated superior performance in natural language processing tasks in recent years. However, existing LLMs still face some issues when processing electronic medical records (EMRs). For example, they often lack expertise specific to medical scenarios and exhibit limited performance when dealing with complex tasks. Furthermore, the structured processing of EMRs also faces challenges related to the difficulty and high cost of medical text annotation. Because medical texts involve a large amount of technical terminology and complex medical knowledge, traditional automated annotation techniques often fail to accurately capture the specialized content, thus requiring the involvement of medical professionals in the annotation process. This not only increases the time and cost of annotation but may also lead to subjectivity and inconsistency due to human factors. To address these issues, this invention proposes a novel method for structuring EMRs. By applying prefix fine-tuning and reinforcement learning to a large model, the model can be better adapted to the specific needs of the medical field, improving the efficiency and accuracy of structured processing of EMRs. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing electronic medical record structuring methods in terms of accuracy and flexibility, particularly their poor performance when dealing with complex medical texts. This invention proposes a self-learning electronic medical record structuring method and apparatus based on prefix fine-tuning and reinforcement learning, which can better meet the specific needs of the medical field.

[0005] The technical solution adopted in this invention is as follows: Firstly, this invention provides a self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning, the method comprising the following steps:

[0006] (1) Construction of electronic medical record dataset: Construct electronic medical record dataset and preprocess it to extract diagnostic information;

[0007] (2) Model training: The model is trained by using the prefix prompting fine-tuning method. The preprocessed electronic medical record data in step (1) is used as the input sample. The extracted diagnostic information is organized into a two-dimensional list as the model output sample to obtain the model training sample. The model training sample is then input into the large model for training to obtain the electronic medical record information extraction model.

[0008] (3) Construction of a reinforcement learning preference dataset for generating format: Construct a reinforcement learning preference dataset consisting of original text, accepted answers and rejected answers. The data sources include: the original text source is electronic medical record data, and the accepted answers and rejected answers are: 1) When the model itself generates incorrect predictions, it is corrected using regular expressions. The original input of the model is used as the rejected answer, and the corrected output is used as the accepted answer; 2) Accepted answers and rejected answers are constructed by simulating the structured order and format errors.

[0009] (4) Generate format reinforcement learning training: Use the reinforcement learning preference dataset obtained in step (3) to perform reinforcement learning training on the electronic medical record information extraction model obtained in step (2) to obtain a format-optimized electronic medical record information extraction model.

[0010] (5) Model self-optimization: For the input electronic medical record text x, the format-optimized electronic medical record information extraction model output y obtained in step (4) retrieves similar input-output pairs as examples in step (1), optimizes the generated data based on the large model according to the (x,y) reference retrieved examples, and obtains a new optimized output y' as new training data to supplement the electronic medical record dataset in step (1);

[0011] (6) Entity alignment: Diagnostic information entities extracted by the format-optimized electronic medical record information extraction model are aligned with the text similarity algorithm and the medical standard entity library to obtain standard entity output.

[0012] Furthermore, the electronic medical record dataset includes textual data related to CT, DR, and ultrasound images.

[0013] Furthermore, the preprocessing involves cleaning the original text to remove irrelevant information and redundant characters, ensuring the standardization and consistency of the data; performing desensitization to protect patient privacy and ensure that sensitive information is not leaked; and extracting diagnostic information and clinical data to ensure the structure and usability of the dataset.

[0014] Furthermore, the dataset construction method used in step (1) adopts a unified output format for CT, DR, and ultrasound examination reports, and organizes the diagnostic information into a two-dimensional list, with each one-dimensional list as a unit, based on organs, locations, symptoms, quantitative indicators, and supplementary information.

[0015] Furthermore, step (2) uses the prefix hint fine-tuning method to organize the structured results into a two-dimensional list structure, which is then concatenated with the original medical records to obtain the complete model input.

[0016] Furthermore, in step (3), the construction of accept and reject answers by simulating problems such as structured order and format errors is as follows: 1) Simulating field order error problem: randomly select some data and randomly replace the position of the generated information as a reject answer; 2) Simulating incomplete extraction result problem: randomly select some data and truncate the field containing long information as a reject answer; 3) Simulating format not conforming to two-dimensional list problem: randomly select some data and destroy the format of the two-dimensional list.

[0017] Furthermore, step (5) utilizes the model self-optimization process based on the format-optimized electronic medical record information extraction model obtained in step (4). For the input electronic medical record text x, the model output y is obtained. Similar input-output pairs are retrieved in step (1) as examples, and data is generated by the large model optimization to obtain a new optimized output y', which serves as new training data to supplement the electronic medical record dataset in step (1).

[0018] Further, step (6) standardizes the organs, locations, and symptoms in the structured results based on the medical standard entity library.

[0019] Secondly, the present invention also provides a self-learning electronic medical record structuring device based on prefix fine-tuning and reinforcement learning, comprising a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it implements the aforementioned self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning.

[0020] Thirdly, the present invention also provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the aforementioned self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning.

[0021] The advantages of this invention over the prior art are as follows:

[0022] (1) A dataset construction format suitable for information extraction by large-scale pre-trained language models is proposed, which helps to implicitly prompt the model to extract the location and content information of the information.

[0023] (2) A method for structuring electronic medical records based on prefix prompting fine-tuning and reinforcement learning is proposed to enhance the accuracy, flexibility and consistency of structured information extraction and output format.

[0024] (3) A method for model self-generation and output optimization is proposed to expand the training dataset, reduce the cost of manual annotation, and improve the quality of the training dataset.

[0025] (4) The method described in this invention is general and can be used for information extraction tasks applicable to different professional knowledge fields. Attached Figure Description

[0026] 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.

[0027] Figure 1 This is a flowchart of a self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning.

[0028] Figure 2 This is a schematic diagram of a self-learning electronic medical record structuring device based on prefix fine-tuning and reinforcement learning. Detailed Implementation

[0029] The present invention will be further described in detail below with reference to specific examples and accompanying drawings.

[0030] like Figure 1 As shown, this invention proposes a self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning, which includes the following steps:

[0031] Step 1) Construction of Electronic Medical Record Dataset. Comprehensive preprocessing is performed on the plain text data related to imaging examination reports of the "three highs" (hypertension, diabetes, and dyslipidemia), including ultrasound, CT, DR, and other ultrasound images. This includes cleaning the raw text to remove irrelevant information and redundant characters, ensuring data standardization and consistency; simultaneously, anonymization is performed to protect patient privacy and ensure sensitive information is not leaked. For the structured processing of diagnostic information, organs, locations, symptoms, supplementary descriptions, and quantitative indicators are extracted from individual organs mentioned in the medical text and organized into a two-dimensional list format to ensure the structure and usability of the dataset. For example, a CT scan report might read, "Coronary CTA: 1. Strip-like calcified and non-calcified plaques in the proximal and mid-segment of the left main coronary artery and the left anterior descending artery, with localized luminal stenosis, the maximum stenosis being approximately 30%. 2. Myocardial bridging in the mid-segment of the left anterior descending artery, approximately 15 mm in length." The structured result would be "[['Coronary artery','Left coronary artery, main coronary artery','Strip-like calcified and non-calcified plaques','Maximum stenosis approximately 30%','Localized luminal stenosis'],['Coronary artery','Left anterior descending artery, proximal and mid-segment','Strip-like calcified and non-calcified plaques','Maximum stenosis approximately 30%','Localized luminal stenosis'],['Coronary artery','Left anterior descending artery, mid-segment','Myocardial bridging','Length approximately 15 mm',null]]", where null indicates that the field is not mentioned in the text.

[0032] Step 2) Model Training. The model is trained using the prefix-tuning method. The preprocessed original electronic medical record from Step 1) is used as input text. The annotated key diagnostic information is organized into a two-dimensional list, where each one-dimensional list is a unit, consisting of organ, location, symptom, supplementary information, and quantitative indicators. The extracted key diagnostic information is used as output text to obtain the model training samples. The model parameters are fixed, and a continuous prompt template prefix is ​​added before the input text. A small number of parameters corresponding to the template are trained. The model input z is [P1, P2, ..., P...]. i ,…,P k ,T1,T2,…,T j ,…,T n ], where P i It is a soft prompt (prefix vector), and T j This is the original token. The prefix vector is combined with the key-value matrix of the original token during multi-head attention. When calculating the attention, these prefix vectors are added before the key-value matrix.

[0033]

[0034] K′=[P1,P2,…,P k ,K]

[0035] V′=[P1,P2,…,P k ,V]

[0036] Where, d k These are hyperparameters; similarity is calculated between the original token and the prefix vector, making the model pay more attention to this prefix information when processing the input. The similarity is calculated using the dot product:

[0037] S = softmax(QK) T Where K′=[P1,P2,…,P k ,K]

[0038] Finally, by aggregating this information, the model can generate outputs that better suit the specific task requirements, where O is the output after processing with soft prompts:

[0039] O=SV′

[0040] The electronic medical record information extraction model is obtained by inputting the model training samples into the ChatGLm2-6b model for training.

[0041] Step 3) Constructing the Reinforcement Learning Preference Dataset. To address the model output format issue, a reinforcement learning preference dataset is constructed. Each data point consists of the original text, an accepted response, and a rejected response. Data sources include: 1) Errors generated by the model itself during prediction are corrected using regular expressions; the original input is used as the rejected response, and the corrected output as the accepted response. 2) Simulating field order errors: Randomly select some data points and randomly replace the positions of the generated information as rejected responses. 3) Simulating incomplete data extraction: Randomly select some data points and truncate fields containing longer information as rejected responses. 4) Simulating format non-compliance with two-dimensional lists: Randomly select some data points and disrupt the format of the two-dimensional list. 5) The original text is electronic medical record data.

[0042] Step 4) Generate format reinforcement learning training. Use the preference dataset obtained in step (3) to train the model obtained in step (2) using reinforcement learning, resulting in a format-optimized electronic medical record information extraction model. Use the accepted response as the policy π. a Refusing to answer as a strategy π b The relative preference between the two strategies is represented by a preference function, where σ is a sigmoid function and f is a function used to evaluate the performance of the strategy.

[0043] P(π a >π b )=σ(f(πa ,π b ))

[0044] Where ">" indicates that π is obtained. a The probability is as high as π b The strategy optimization objective is to maximize expected preferences, where... It is an experience replay library containing state and action pairs:

[0045]

[0046] Value function: Approximating the value function using a preference model, it can be expressed as where Q(s,a) represents the expected reward of choosing action a in state s.

[0047]

[0048] Policy update: Policy update is performed by optimizing the objective using gradient ascent, where α is the learning rate.

[0049]

[0050] Step 5) Model self-optimization. For the input text x, the model output y is obtained in step (4). (x, y) is used as input to the large model. Similar input-output pairs retrieved in step (1) are used as examples. The large model optimizes and generates data to obtain a new optimized output y', which is used as new training data to supplement the electronic medical record dataset in step (1). By inputting (x, y) and similar input-output pairs (xi, yi) together into the large model, the present invention adopts the following optimization strategy:

[0051] y′=Optimize(x,t,{(x i ,y i )})

[0052] The new output y′ will be used as new training data to further enrich and improve the quality of the electronic medical record dataset in step (1), ensuring the accuracy and reliability of the model in practical applications.

[0053] Step 6) Entity Alignment: Referring to the National Health Commission's Clinical Medical Terminology (2023 Edition), a standard entity library was constructed, containing all standard terms and their descriptions. For extracted entities such as organs, locations, and symptoms, etc., [the library was then aligned]. i Calculate its relationship with each standard term S in the standard entity library. j Text similarity:

[0054]

[0055] If the similarity is lower than the set threshold, the entity can be added as a new entity to the standard entity library.

[0056] Example

[0057] (1) Example of training samples for model prefix fine-tuning

[0058] Chest DR training sample:

[0059] Content: 1. Complete fractures of the 2nd, 4th, and 8th ribs on the right side, with displacement of the fracture ends. The fracture of the 3rd rib is slightly distorted. Please have a follow-up CT scan. 2. Distal acromion fracture on the right side. 3. Right pleural reaction.

[0060] Predict: [['rib','Right 2nd, 4th, and 8th ribs','Complete fracture with displaced fracture ends',null,null],['rib','Right 3rd rib','Slightly distorted fracture shape',null,null],['acromion','Right side','Distal fracture',null,null],['pleura','Right side','Pleural reaction',null,null]]

[0061] Ultrasound training samples:

[0062] Content: The diameters of the bilateral common carotid, internal carotid, and external carotid arteries are normal, with roughened and thickened intima-media. Multiple plaque echoes are visible in both carotid arteries, the largest being a hypoechoic plaque located on the anterior wall of the right common carotid artery, measuring approximately 1.82*0.24cm. Color Doppler flow imaging (CDFI) shows filling defects at the plaque site, with normal blood flow spectrum morphology and all blood flow parameters generally within the normal range. Predict: [['Carotid artery','Bilateral, common carotid, internal carotid, external carotid','Normal diameter',null,null],['Carotid artery','Bilateral, common carotid, internal carotid, external carotid','Intimal and medial thickening',null,null],['Carotid artery','Bilateral','Plaque echo',null,'Multiple'],['Common carotid artery','Right side, anterior wall','Hypoechoic plaque','Approximately 1.82*0.24cm in size','Largest location'],['Carotid artery','Plaque location']

[0063] ',null,null,'CDFI shows blood flow filling defects at the plaque site, normal blood flow spectrum morphology, and all blood flow parameters are basically within the normal range.']]

[0064] CT training samples:

[0065] Content: Carotid artery CTA:

[0066] 1. Calcified plaques in the proximal segments of both subclavian arteries, with slight local stenosis of the lumen.

[0067] 2. Calcified plaques and mixed plaques in the distal segments of both common carotid arteries and the origins of the internal and external carotid arteries, with corresponding mild to moderate stenosis of the lumen.

[0068] 3. Scattered calcified plaques in the siphon segments of both internal carotid arteries, with mild stenosis of the corresponding lumen.

[0069] See also: Aortic arch calcification; degenerative changes in the cervical and upper thoracic vertebrae with straightening of the physiological curvature; thyroid calcifications and multiple nodules; thickening of the mucosa of the left maxillary sinus and ethmoid sinus; fine calcifications in the upper lobe of the right lung and subpleural bullae; mediastinal lymph node calcification; variation of the left superior vena cava.

[0070] Predict: [['Subclavian artery','Bilateral, proximal','Calcified plaque',null,'Minor local stenosis'],['Common carotid artery','

[0071] Bilateral, distal segment','calcified plaques and mixed plaques',null,'corresponding mild to moderate stenosis'],['external carotid artery','bilateral, origin','calcified plaques and mixed plaques',null,'corresponding mild to moderate stenosis'],['internal carotid artery','bilateral, origin','

[0072] Calcified plaques and mixed plaques', null,'mild to moderate stenosis of the corresponding lumen'],'Internal carotid artery','both sides, siphon segment','scattered calcified plaques', null,'mild stenosis of the corresponding lumen'],'Aorta','Aortic arch','calcification', null, null],'Cervical spine', null,'degenerative changes', null,'with straightening of physiological curvature'],'Thoracic spine','Upper thoracic spine','degenerative changes', null,'with straightening of physiological curvature'],'Thyroid', null,'calcified foci and multiple nodular foci', null, null],'Maxillary sinus','Left side','mucosal thickening', null, null],'Ethmoid sinus','

[0073] Left side','mucosal thickening',null,null],['lung','right lung, upper lobe','small calcifications',null,'subpleural bullae'],['mediastinum'

[0074] ',null,'Lymph node calcification',null,null],['Superior vena cava','Left side','Variation',null,null]]

[0075] (2) Generate a formatted reinforcement learning preference dataset

[0076] Model prediction result optimization:

[0077] Original medical record: The left internal carotid artery is tortuous. The proximal diameters of the bilateral common carotid, internal carotid, and external carotid arteries are normal. The intima-media of both internal carotid arteries is thickened; the thicker area on the left is located on the posterior wall of the internal carotid artery at its origin, approximately 0.13 cm thick, while the thicker area on the right is located on the posterior wall of the internal carotid artery, approximately 0.14 cm thick. Color Doppler flow imaging (CDFI) showed good blood flow filling and normal blood flow spectrum morphology. CDFI showed iridescent blood flow within the lumen of the tortuous section of the left internal carotid artery, with a measured PSV of 130 cm / s. CDFI of the remaining carotid arteries showed good blood flow filling, normal blood flow spectrum morphology, and all blood flow parameters were generally within the normal range.

[0078] Refusing to answer: [['Internal carotid artery','Left side, tortuous course',null,null],['Common carotid artery','Bilateral','Normal internal diameter of the proximal segment of the internal carotid artery',null,null],['Internal carotid artery','Left side, posterior wall','Intimal-media thickening',null,null],['Internal carotid artery','Right side, posterior wall','Intimal-media thickening',null,'0.14cm'],['Artery','Bilateral side, proximal segment','Good blood flow',null,null],['Artery','

[0079] Bilateral, Normal blood flow spectrum morphology, null, null], [Artery, Left side, at the bend, Colorful blood flow, null]

[0080] 'PSV:130cm / s'],['Carotid artery',null,'Remaining carotid arteries',',',null]]

[0081] Accepted answers: [['Internal carotid artery','Left side, tortuous course',null,null],['Common carotid artery','Bilateral','Normal diameter of the proximal segment of the internal carotid artery',null,null],['Internal carotid artery','Left side, posterior wall','Intimal-media thickening',null,null],['Internal carotid artery','Right side, posterior wall','Intimal-media thickening',null,'0.14cm'],['Artery','Bilateral, proximal segment','Good blood flow',null,null],['Artery','

[0082] Bilateral, Normal blood flow spectrum morphology, null, null], [Artery, Left side, at the bend, Colorful blood flow, null]

[0083] 'PSV:130cm / s'],['Carotid artery',null,'Other carotid arteries',null,'Good blood flow filling, normal blood flow spectrum morphology, and all blood flow parameters are basically within the normal range',null]]

[0084] Simulated field order error:

[0085] Original medical record: Chronic cholecystitis with polyps, bilateral renal calculi, right renal cyst, benign prostatic hyperplasia with calcifications.

[0086] Refusing to answer: [['gallbladder',null,'chronic cholecystitis',null,'with polyps'],['kidney','both kidneys','small stones',null,null],['kidney','

[0087] Right kidney','small cyst',null,null],['prostate',null,'hyperplasia','with calcifications',null]]

[0088] Accepted answers: [['gallbladder',null,'chronic cholecystitis','with polyps',null],['kidney','both kidneys','small stones',null,null],['kidney'

[0089] ','Right Kidney','Small Cyst',null,null],['Prostate',null,'Hyperplasia','With Calcifications',null]]

[0090] The simulation extraction results are incomplete:

[0091] Original medical record: Thyroid nodules, TI-RADS category 3, including a nodule in the left lobe of the thyroid gland, category 4a; calcification in the left lobe of the thyroid gland; bilateral hypoechoic nodules in the neck, suggestive of lymph nodes.

[0092] Refusing to answer: [['Thyroid',null,'Nodule','TI-RADS 3',null],['Thyroid','Left Lobe','Calcification',null,null],['

[0093] 'Neck', 'Bilateral', 'Hypoechoic nodules', null, 'Consider lymph nodes']]

[0094] Accepted answers: [['Thyroid', null, 'Nodule', 'TI-RADS 3', 'A nodule in the left lobe of the thyroid gland is classified as 4a'], ['Thyroid

[0095] ','Left lobe','Calcified spot',null,null],['Neck','Bilateral','Hypoechoic nodule',null,'Consider lymph node']]

[0096] The simulation format does not conform to the predefined two-dimensional list:

[0097] Original medical record: Left breast nodule, BI-RADS 3; Right breast nodule, BI-RADS 2-3; Physiological atrophy of the uterus; Cystic dark area in the right ovary.

[0098] Refusal to answer: [['Breast','Left side','Nodule','BI-RADS 3',null],['Breast','Right side','Nodule','BI-RADS 2-3'

[0099] ',null],['uterus',null,'physiological atrophy',null,null],['ovary','right side','cystic dark area',null]

[0100] Accepted answers: [['Breast','Left side','Nodule','BI-RADS 3',null],['Breast','Right side','Nodule','BI-RADS 2-3'

[0101] ',null],['uterus',null,'physiological atrophy',null,null],['ovary','right side','cystic dark area',null,null]]

[0102] Corresponding to the aforementioned embodiment of a self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning, the present invention also provides an embodiment of a self-learning electronic medical record structuring device based on prefix fine-tuning and reinforcement learning.

[0103] See Figure 2 The present invention provides a self-learning electronic medical record structuring device based on prefix fine-tuning and reinforcement learning, comprising a memory and one or more processors. The memory stores executable code, and when the processor executes the executable code, it is used to implement a self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning as described in the above embodiment.

[0104] The embodiment of the self-learning electronic medical record structuring device based on prefix fine-tuning and reinforcement learning provided by this invention can be applied to any device with data processing capabilities, such as a computer. The device embodiment can be implemented in software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of any data processing device loading the corresponding computer program instructions from non-volatile memory into memory for execution. From a hardware perspective, such as... Figure 2 The diagram shown is a hardware structure diagram of any device with data processing capabilities, which is a self-learning electronic medical record structuring device based on prefix fine-tuning and reinforcement learning provided by the present invention. (Except for...) Figure 2In addition to the processor, memory, network interface, and non-volatile memory shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.

[0105] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0106] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0107] This invention also provides a computer-readable storage medium storing a program that, when executed by a processor, implements a self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning as described in the above embodiments.

[0108] The computer-readable storage medium can be an internal storage unit of any data processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device of any data processing device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of any data processing device. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.

[0109] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning.

[0110] The above embodiments are used to explain and illustrate the present invention, but not to limit the present invention. Any modifications and changes made to the present invention within the spirit and scope of the claims shall fall within the protection scope of the present invention.

Claims

1. A self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning, characterized in that, The method includes the following steps: (1) Construction of electronic medical record dataset: Construct electronic medical record dataset and perform preprocessing to extract diagnostic information; (2) Model training: The model is trained by using the prefix prompting fine-tuning method. The preprocessed electronic medical record data in step (1) is used as the input sample. The extracted diagnostic information is organized into a two-dimensional list as the model output sample to obtain the model training sample. The model training sample is input into the ChatGLm2-6b large model for training to obtain the electronic medical record information extraction model. (3) Construction of reinforcement learning preference dataset for generation format: Construct a reinforcement learning preference dataset consisting of original text, accepted answers and rejected answers. The data sources include: the original text source is electronic medical record data, and the accepted answers and rejected answers are: 1) When the model itself generates incorrect data during prediction, it is corrected using regular expressions. The original input of the model is used as the rejected answer, and the corrected output is used as the accepted answer; 2) Construct accepted answers and rejected answers by simulating structured order and format errors. Specifically: a) Simulate field order errors: randomly select some data and randomly replace the position of the generated information as the rejected answer; b) Simulate incomplete extraction results: randomly select some data and truncate the fields containing longer information as the rejected answer; c) Simulate format not conforming to two-dimensional list problem: randomly select some data and destroy the format of the two-dimensional list. (4) Reinforcement learning training for generating format: Use the reinforcement learning preference dataset obtained in step (3) to train the electronic medical record information extraction model obtained in step (2) to obtain the format-optimized electronic medical record information extraction model. (5) Model self-optimization: For the input electronic medical record text x, the format-optimized electronic medical record information extraction model output y obtained in step (4) retrieves similar input-output pairs as examples in step (1), and generates data based on the ChatGLm2-6b large model according to (x,y) with reference to the above examples to obtain a new optimized output y', which is used as new training data to supplement the electronic medical record dataset in step (1); (6) Entity alignment: The diagnostic information entities extracted by the format-optimized electronic medical record information extraction model are aligned with the text similarity algorithm and the medical standard entity library to obtain standard entity output.

2. The self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning according to claim 1, characterized in that, The electronic medical record dataset includes text data related to CT, DR, and ultrasound images.

3. The self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning according to claim 1, characterized in that, The preprocessing involves cleaning the original text to remove irrelevant information and redundant characters, ensuring the standardization and consistency of the data. The data was anonymized to protect patient privacy and ensure that sensitive information was not leaked; diagnostic information and clinical data were extracted to ensure the structure and usability of the dataset.

4. The self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning according to claim 1, characterized in that, The dataset construction method used in step (1) is to unify the output format of CT, DR and ultrasound examination reports, and organize the diagnostic information into a two-dimensional list with organs, locations, symptoms, quantitative indicators and supplementary information as a unit, and each one-dimensional list as a unit.

5. The self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning according to claim 1, characterized in that, Step (2) uses the prefix hint fine-tuning method to organize the structured results into a two-dimensional list structure, and splices it with the original medical records to obtain the complete model input.

6. The self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning according to claim 1, characterized in that, Step (5) utilizes the model self-optimization process based on the format-optimized electronic medical record information extraction model obtained in step (4). For the input electronic medical record text x, the model output y is obtained. Similar input-output pairs are retrieved as examples in step (1). Data is generated by the ChatGLm2-6b large model to obtain a new optimized output y', which is used as new training data to supplement the electronic medical record dataset in step (1).

7. The self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning according to claim 1, characterized in that, Step (6) Standardize the organs, parts and symptoms in the structured results according to the medical standard entity library.

8. A self-learning electronic medical record structuring device based on prefix fine-tuning and reinforcement learning, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that, When the processor executes the executable code, it implements a self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning as described in any one of claims 1-7.

9. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements a self-learning electronic medical record structuring method based on prefix fine-tuning and reinforcement learning as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Rapid generation and quality control method for structured electronic medical record

    CN115274030A

  • Medical event recognition method and system under small sample weak labeling condition

    WO2023071530A1