Method and apparatus for generating medical record text
By receiving historical medical record texts and using neural network models and patient profile databases to generate personalized medical record texts, this technology solves the problem that existing template generation methods cannot incorporate the personalized needs of patients and doctors, thus improving text quality and acceptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAT CENT FOR CARDIOVASCULAR DISEASES
- Filing Date
- 2025-07-30
- Publication Date
- 2026-06-05
Smart Images

Figure CN120562389B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a method and apparatus for generating medical record text. Background Technology
[0002] Medical record generation is one of the core tasks in the medical field. In medical practice, medical records contain crucial information such as a patient's diagnosis and treatment history, playing an irreplaceable role in doctors' diagnosis and treatment. However, in busy medical environments, doctors need to spend a significant amount of time and energy writing medical record texts, which is not only inefficient but also prone to information omissions and errors. Therefore, methods for automatically generating medical record texts have become a hot research topic in the medical field today.
[0003] In current practical business scenarios, template-based methods suffer from rigid text generation, failing to flexibly address the personalized needs of doctors. This results in generated text that may not conform to doctors' writing habits, thereby reducing text quality and acceptability. Furthermore, the complex and varied conditions of different patients necessitate a lack of dynamic flexibility in template-based generation methods, requiring continuous expansion for long-term use.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a method and apparatus for generating medical record text, which at least solves the technical problem that the method of generating medical record text uses a fixed template to fill in the medical record content, resulting in the inability to effectively combine the characteristics of different patients' conditions and the personalized needs of doctors.
[0006] According to one aspect of this application, a method for generating medical record text is provided, comprising: receiving multiple historical medical record texts; using a neural network model to determine a writing style vector corresponding to each historical medical record text, thereby obtaining multiple writing style vectors, and determining a target average value for the multiple writing style vectors; searching for a patient's medical information in a patient profile database, wherein the medical information includes at least: target disease information, target indicator information points corresponding to the target disease information, and target indicator values corresponding to the target indicator information points; and using a large model for generating medical record texts to determine the medical record text that corresponds to both the medical information and the target average value.
[0007] Optionally, the neural network model is trained using the following method: inputting the first historical medical record text corresponding to the first object into an encoding / decoding module to obtain a first output result, the encoding / decoding module being used to extract information from the first historical medical record text; inputting the second historical medical record text corresponding to the first object into a contrast learning module to obtain a second output result, the contrast learning module being used to mine the internal structure and semantic information of the second historical medical record text; inputting the third historical medical record text corresponding to the second object into the contrast learning module to obtain a third output result, the contrast learning module being used to learn the structural and semantic differences between the third historical medical record text and the second historical medical record text; determining a loss function based on the first output result, the second output result, and the third output result, and completing the training of the neural network model when the loss function satisfies a preset convergence condition.
[0008] Optionally, the patient profile database is constructed by: receiving a data extraction instruction; based on the data extraction instruction, extracting the content indicated by the data extraction instruction from unstructured medical record text using a large-scale patient profile extraction model to obtain the extraction result; merging the extraction result with the structured medical record text to obtain the patient profile database; wherein, the historical medical record text includes both unstructured and structured medical record text.
[0009] Optionally, the large-scale patient profile extraction model is obtained by training the following method: acquiring a disease database, wherein the disease database includes information on different diseases and indicator information points corresponding to each disease; receiving a fine-tuning dataset based on the disease database, wherein each fine-tuning data in the fine-tuning dataset is used to extract disease information, indicator information points corresponding to the disease information, and indicator values; and fine-tuning and training the first preset large-scale model based on the fine-tuning dataset to obtain the large-scale patient profile extraction model.
[0010] Optionally, the large-scale medical record text generation model is obtained by training the model through the following method: obtaining a second preset large-scale model; using pre-collected medical data, performing incremental training of the second preset large-scale model based on the medical domain to obtain a medical large-scale model; using historical medical record text data, performing supervised fine-tuning training of the medical large-scale model based on prompts, and completing the training of the second preset large-scale model when the preset stopping conditions are met, thus obtaining the large-scale medical record text generation model.
[0011] Optionally, a large-scale medical record text generation model is used to determine the medical record text that corresponds to both the medical information and the target average value. This includes: using the large-scale medical record text generation model to analyze the medical information, the target average value, and the scene prompt information to obtain the medical record text output by the large-scale medical record text generation model, wherein the scene prompt information includes at least one of the following: admission course of illness and discharge course of illness.
[0012] Optionally, after using a large model to generate medical record text and determining the medical record text that corresponds to both medical information and the target average, the method further includes: collecting voice data between doctors and patients; analyzing the voice data using a sentiment analysis model to obtain the patient's sentiment vector; and adjusting preset fields in the medical record text based on the patient's sentiment vector.
[0013] According to another aspect of this application, a medical record text generation apparatus is also provided, comprising: a receiving module for receiving multiple historical medical record texts; a first determining module for determining a writing style vector corresponding to each historical medical record text using a neural network model, obtaining multiple writing style vectors, and determining a target average value of the multiple writing style vectors; a searching module for searching for a patient's medical information in a patient profile database, wherein the medical information includes at least: target disease information, target indicator information points corresponding to the target disease information, and target indicator values corresponding to the target indicator information points; and a second determining module for using a large model generated from the medical record texts to determine the medical record text jointly corresponding to the medical information and the target average value.
[0014] According to another aspect of this application, a non-volatile storage medium is also provided, the storage medium including a stored program, wherein the program, when running, controls the device where the storage medium is located to execute the above-described method for generating medical record text.
[0015] According to another aspect of this application, an electronic device is also provided, comprising: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, executes the above-described method for generating medical record text.
[0016] According to another aspect of this application, a computer program is also provided, wherein when the computer program is executed by a processor, it implements the above-described method for generating medical record text.
[0017] According to another aspect of this application, a computer program product is also provided, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-described method for generating medical record text.
[0018] This application employs a method of receiving multiple historical medical record texts; using a neural network model to determine the writing style vector corresponding to each historical medical record text, resulting in multiple writing style vectors, and determining the target average value of the multiple writing style vectors; searching for patient medical information in a patient profile database, wherein the medical information includes at least: target disease information, target indicator information points corresponding to the target disease information, and target indicator values corresponding to the target indicator information points; and using a large-scale medical record text generation model to determine the medical record text that corresponds to both the medical information and the target average value. The large-scale medical record text generation model analyzes the patient medical information found in the patient profile database and the target average value of the doctor's writing style vector determined by the neural network model to obtain the medical record text output by the large-scale medical record text generation model. This achieves the goal of automatically generating medical record text by effectively combining the characteristics of different patients' conditions and the personalized needs of doctors, thereby improving the technical effect of generating medical record text. Furthermore, it solves the technical problem that the current methods for generating medical record text use fixed templates to fill in medical record content, resulting in the inability to effectively combine the characteristics of different patients' conditions and the personalized needs of doctors. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0020] Figure 1 This is a flowchart of a method for generating medical record text according to an embodiment of this application;
[0021] Figure 2 This is a schematic diagram illustrating the training of a neural network model according to an embodiment of this application;
[0022] Figure 3 This is a schematic diagram illustrating the construction of a patient profile database according to an embodiment of this application;
[0023] Figure 4 This is a schematic diagram illustrating the training of a large model for extracting patient profiles according to an embodiment of this application.
[0024] Figure 5 This is a training diagram of a large medical record text generation model according to an embodiment of this application;
[0025] Figure 6 This is a schematic diagram of a method for generating medical record text according to an embodiment of this application;
[0026] Figure 7 This is a structural diagram of a medical record text generation device according to an embodiment of this application;
[0027] Figure 8 This is a hardware structure block diagram of a computer terminal for a method of generating medical record text according to an embodiment of this application. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0030] According to an embodiment of this application, a method embodiment for generating medical record text is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0031] Figure 1 This is a flowchart of a method for generating medical record text according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0032] Step S102: Receive multiple historical medical record texts.
[0033] In step S102, taking doctor A as an example, multiple historical medical record texts of doctor A are randomly obtained. These medical record texts are also known as medical records, and they can be electronic medical records or scanned versions of paper medical records. Medical records are documents that record a patient's medical and health information, including but not limited to personal basic information, past medical history, physical examination results, diagnosis, treatment plans, medication prescriptions, surgical records, laboratory test results, and the doctor's observations and assessments.
[0034] Step S104: Use a neural network model to determine the writing style vector corresponding to each historical medical record text, obtain multiple writing style vectors, and determine the target average value of multiple writing style vectors.
[0035] According to some optional embodiments of this application, the neural network model is trained by the following method: inputting the first historical medical record text corresponding to the first object into an encoding / decoding module to obtain a first output result, wherein the encoding / decoding module is used to extract information from the first historical medical record text; inputting the second historical medical record text corresponding to the first object into a contrast learning module to obtain a second output result, wherein the contrast learning module is used to mine the internal structure and semantic information of the second historical medical record text; inputting the third historical medical record text corresponding to the second object into the contrast learning module to obtain a third output result, wherein the contrast learning module is also used to learn the structural and semantic differences between the third historical medical record text and the second historical medical record text; determining a loss function based on the first output result, the second output result, and the third output result, and completing the training of the neural network model when the loss function satisfies a preset convergence condition.
[0036] It is worth explaining that the first historical medical record text corresponding to the first object mentioned above is a historical medical record text written by a certain doctor selected during the training of the neural network model, such as historical medical record text 1 written by doctor A.
[0037] The second historical medical record text corresponding to the first object is another historical medical record text written by the first object that is different from the first historical medical record text, such as historical medical record text 2 written by doctor A.
[0038] The third historical medical record text corresponding to the second object mentioned above is a historical medical record text written by another second object, different from the first object, selected during the training of the neural network model. For example, historical medical record text 3 written by doctor B.
[0039] Figure 2This is a training diagram of a neural network model according to an embodiment of this application, where Encode-Decode is an encoding and decoding module, and Dense is a dense layer. The dense layer is set in the encoding and decoding module, and can also receive the result of the encoder independently. Multiple encoding and decoding modules and dense layers form a contrastive learning framework, which will be discussed below. Figure 2 Explain in detail how the neural network model was trained.
[0040] First, collect the first historical medical record text corresponding to Doctor A ( Figure 2 Medical record 1) and the second historical medical record text ( Figure 2 (Medical record 2 in the document), and at the same time collect the third historical medical record corresponding to Doctor B ( Figure 2 3) Medical records text. These texts form the basis of the training dataset.
[0041] Next, the first historical medical record text (medical record 1) corresponding to Doctor A is input into the encoding / decoding module. The encoding / decoding module employs an autoencoder architecture, capable of automatically extracting and encoding key information from the medical record text. The encoder within the module extracts features from the medical record text, then the decoder reconstructs the text, outputting the reconstructed medical record text as the first output. The first output is compared with the original medical record text to evaluate the information extraction capability of the encoding / decoding module, thereby verifying and optimizing the accuracy of feature extraction.
[0042] Specifically, the core functions of the encoding and decoding module include: 1. Information extraction: Through the encoding process, key information and features are extracted from the input historical medical record text. These features include, but are not limited to, the patient's physiological indicators, symptom descriptions, diagnostic results, and treatment processes. 2. Text reconstruction: The goal of the decoding process is to reconstruct the original medical record text based on the encoded features. This process verifies whether the features extracted in the encoding stage are complete and accurate enough to reproduce the main content of the original medical record text. By comparing the reconstructed text and the original text, the model's encoding strategy can be optimized to ensure that important information is not lost.
[0043] Next, the second historical medical record text of Doctor A (Medical Record 2) and the third historical medical record text of Doctor B (Medical Record 3) are input into the contrastive learning module. For each pair of input texts, the contrastive learning module learns how to extract style and content embedding vectors from the text to reflect its inherent structure and semantic information. The style and semantic embedding vectors are output as the second and third output results.
[0044] Specifically, the core functions of the contrastive learning module include: 1. Style learning: Identifying and learning the individual characteristics of different doctors' writing styles from texts, including but not limited to vocabulary choices, sentence structures, and preferences for medical terminology. This learning ability enables the model to generate medical record texts that match the writing style of a specific doctor, increasing the personalization and naturalness of the text. 2. Semantic understanding: By comparing different texts, learning the deeper meaning and contextual relationships of the text is crucial for understanding and generating complex medical descriptions. This not only ensures that the generated text is logically clear and accurate, but also, to some extent, mimics the thought process of human doctors when writing medical records. 3. Structural analysis: Analyzing the internal structure of the text, such as the organization of the medical record and the order in which information is presented, helps improve the readability and consistency of the generated text.
[0045] The contrastive learning module described above enables style learning of medical record texts. Specifically, it treats different medical record texts from the same doctor as positive sample pairs, sharing the same style features. By maximizing the similarity score between these texts, the module learns the doctor's writing characteristics. Simultaneously, it treats medical record texts from different doctors as negative sample pairs, with significant style differences between them. By minimizing the similarity score between positive and negative samples, the module distinguishes the writing styles of different doctors, thus learning the unique style of individual doctors in greater detail. Through this process, the contrastive learning module generates a style vector that encodes the stylistic features of a doctor's handwriting in medical record texts. Using this style vector as input, it can guide large-scale medical models to generate medical record texts with similar styles.
[0046] Furthermore, the aforementioned contrastive learning module enables accurate semantic understanding of medical record texts. Specifically, the contrastive learning module treats different medical record texts from the same doctor as positive sample pairs, which share the same stylistic features. By maximizing the similarity scores between these texts, the contrastive module learns the doctor's writing characteristics. This helps subsequent large-scale medical record text generation models to deeply understand medical terminology, diagnostic descriptions, and treatment plans within medical texts.
[0047] Finally, based on the difference between the first output (reconstructed text of medical record 1) and the original text, and the contrastive loss between the second output (embedded vector of medical record 2) and the third output (embedded vector of medical record 3), the total loss function is calculated. Preferably, the loss function includes reconstruction loss (used to evaluate the accuracy of the encoding and decoding module) and contrastive loss (used to evaluate the ability of the contrastive learning module to distinguish different writing styles).
[0048] The aforementioned reconstruction loss is specifically implemented through the following formula:
[0049]
[0050] L CE y represents cross-entropy loss, used to measure the difference between the model's predicted values and the true values; n represents the total number of samples, i.e., the dimension of the input data or the number of samples in the dataset; y i y represents the true label of the i-th sample, which can be the true category label of a word; hati This represents the predicted value of the i-th sample, which is the probability distribution output by the model. It can be the probability that the model predicts a word as belonging to a specific category or a specific word.
[0051] The aforementioned contrast loss is specifically implemented using the following formula: ;
[0052] L contrastive represents the contrastive loss, used to measure the similarity or dissimilarity between embedding vectors; y represents the label of the sample pair, y = 1 for positive sample pairs (i.e., semantically similar sample pairs) and y = 0 for negative sample pairs (i.e., semantically dissimilar sample pairs); d represents the distance between the embedding vectors, which can be Euclidean distance, i.e. , where z i and z j There are two embedding vectors; m represents the margin, a hyperparameter used to control the minimum distance between the embedding vectors of the negative sample pair; max(0, m - d) means that when d is less than m, m - d is calculated, otherwise it is 0. This ensures that the distance between the embedding vectors of the negative sample pair is at least m. The parameters of the neural network model are optimized through the backpropagation algorithm until the loss function meets the preset convergence condition, marking the completion of model training.
[0053] Step S106: Search for the patient's medical information in the patient profile database. The medical information includes at least: target disease information, target indicator information points corresponding to the target disease information, and target indicator values corresponding to the target indicator information points.
[0054] According to some alternative embodiments of this application, the patient profile database is constructed by the following method: receiving a data extraction instruction; based on the data extraction instruction, extracting the content indicated by the data extraction instruction from unstructured medical record text using a large patient profile extraction model to obtain the extraction result; merging the extraction result with the structured medical record text to obtain the patient profile database; wherein, the historical medical record text includes unstructured medical record text and structured medical record text.
[0055] In the above embodiments, the system first receives data extraction instructions submitted by doctors or other medical professionals. For example, these instructions may include, but are not limited to, keywords, entity types, and desired output formats. The data extraction instructions are then input into the patient profile extraction model, which extracts the content specified in the instructions from unstructured medical record text to obtain the extraction results. Simultaneously, structured medical record text related to the same patient is collected from historical medical records, such as standardized electrocardiogram results, laboratory test data, and other formatted information.
[0056] The extracted data is merged with structured medical record text to construct individual patient profiles containing all key information points. The extracted data includes unstructured data. These individual patient profiles are then merged to build a patient profile database. When adding a patient profile to the database, if the patient profile corresponds to a new patient, a new entry is created for that patient; if the patient profile corresponds to an existing patient, the existing entry is updated to ensure the up-to-dateness and completeness of patient information.
[0057] The above steps integrate structured and unstructured medical data, and process the unstructured data through large model information extraction technology to construct a more comprehensive and accurate patient profile, providing richer input information for the large model of medical record text generation in step S108.
[0058] Figure 3 This is a schematic diagram illustrating the construction of a patient profile database according to an embodiment of this application, such as... Figure 3 As shown, the method for constructing a patient profile database includes the following steps:
[0059] First, based on the patient's disease type, the required information points are retrieved from the disease database, and extraction instructions are generated based on the information points (disease type - obtain key indicators and indicator values).
[0060] Specifically, based on the patient's disease type, all relevant indicators and information points for that disease type are searched in a predefined disease database. For example, for coronary heart disease, the indicators and information points to be monitored include, but are not limited to, blood pressure, ejection fraction, and calcium score; for arrhythmia, the indicators and information points to be monitored include, but are not limited to, blood pressure, heart rate, and calcium score.
[0061] Based on the retrieved indicator information points, a set of data extraction instructions is assembled to guide the subsequent information extraction process. For example, the data extraction instructions are as follows: Extract the calcium score value from the following coronary CT text. Please output the result as a JSON file with the primary key 'calcification score': 1. Coronary CT text\n'. No obvious atherosclerosis was seen in the three main coronary arteries and their major branches in the coronary CTA, CAD-RADS 0; 2. Calcification score 1.4; 3. Abnormal origin of the left coronary artery, abnormal proximal course; 4. Ascending aortic artery tumor'.
[0062] Secondly, based on the trained patient profile extraction model, extraction instructions are used to extract the required information points from unstructured medical records and obtain the extraction results (disease type - key indicator - indicator value).
[0063] The extraction results are data presented in the form of "disease type - key indicator - indicator value", for example, "coronary heart disease - blood pressure - 130 / 80 mmHg".
[0064] Finally, the structured medical records and the extraction results (disease type - key indicators - indicator values) are merged and stored in the patient profile database.
[0065] By following the steps described above, key indicators can be effectively extracted from historical medical records, and structured and unstructured data can be integrated to construct a comprehensive and personalized patient profile database. This integrated approach significantly improves the efficiency of medical record information processing while ensuring the integrity and accuracy of the information.
[0066] Furthermore, the large-scale patient profile extraction model is obtained by training as follows: acquiring a disease database, which includes information on different diseases and corresponding indicator information points for each disease; receiving a fine-tuning dataset based on the disease database, where each fine-tuning instruction in the fine-tuning dataset is used to extract disease information, corresponding indicator information points, and indicator values; and fine-tuning and training the first preset large-scale model based on the fine-tuning dataset to obtain the large-scale patient profile extraction model.
[0067] Figure 4 This is a schematic diagram illustrating the training of a large-scale patient profile extraction model according to an embodiment of this application, such as... Figure 4 As shown, the large model for extracting patient profiles was trained using the following method.
[0068] First, a tree-structured disease database is created, which contains information on various diseases. For each disease, a set of key indicator information points is defined. For example, for coronary heart disease, key indicators include blood pressure, heart rate, ejection fraction, and calcium score; for arrhythmia, the information points might focus on blood pressure, heart rate, and calcium score.
[0069] The disease database needs to be continuously updated to reflect the latest medical knowledge and practices. This includes adding new diseases, updating indicator information points, or adjusting the weight of information points to adapt to changes in the medical field.
[0070] Secondly, obtain the instruction fine-tuning dataset. For example, for coronary artery disease, if it is necessary to extract the patient's calcium score from coronary CT text, the instruction fine-tuning data would be: 1. Coronary CT text\n'. No obvious atherosclerosis was seen in the three main coronary arteries and their major branches in coronary CTA, CAD-RADS 0; 2. Calcification score 1.4; 3. Abnormal origin of left coronary artery, abnormal proximal course; 4. Ascending aortic artery tumor'. When the instruction is called to extract the calcium score value, the output is {'calcification score': '1.4'}. This instruction fine-tuning data is used to extract the calcium score value.
[0071] It should be noted that the instruction fine-tuning dataset includes all diseases in the disease database. All diseases are used to construct the fine-tuning data, and all fine-tuning data are used to construct the fine-tuning dataset.
[0072] Finally, a pre-trained large-scale language model was selected as the base model (the first preset large model), such as a certain open-source large model. This model has been pre-trained on a large amount of text data and has basic natural language understanding and generation capabilities. The base model was fine-tuned using a command-based fine-tuning dataset, with the goal of enabling the model to accurately identify and extract indicator information points and their corresponding indicator values for specific diseases.
[0073] During training, the model is progressively optimized to improve the accuracy and efficiency of information extraction. At each stage of fine-tuning training, the model's performance on the information extraction task is evaluated. If the model's extraction accuracy is low on certain information points, the training strategy needs to be adjusted or the number of training samples for those information points needs to be increased. Understandably, if the model is found to perform poorly on specific types of information points (such as a rare symptom or complex test results), its learning ability can be enhanced by adding more training samples for these types of information points. The newly added training samples contain as many variations and details as possible, helping the model learn more comprehensive extraction patterns. Alternatively, the training strategy can be adjusted by: 1. Reacquiring diverse fine-tuning data for the specific information point; 2. Reducing the size of training batches with low accuracy.
[0074] After sufficient fine-tuning training, if the loss value between the model's output and the true value is less than a preset threshold, the model fine-tuning ends. At this point, the model can accurately extract information from unstructured medical record texts of various diseases, and the model becomes a large-scale patient profile extraction model that can be applied to actual medical record text processing. The above steps define the key information points to be extracted for different diseases using a disease database, fine-tune the large language model using an instruction fine-tuning dataset, and finally obtain a large-scale deep learning model that can efficiently and accurately extract patient profile information from unstructured medical record texts.
[0075] Step S108: Generate a large model using medical record text to determine the medical record text that corresponds to both the medical information and the target average value.
[0076] Figure 5 This is a training diagram of a large-scale medical record text generation model according to an embodiment of this application, such as... Figure 5 As shown, the large-scale medical record text generation model was trained using the following method.
[0077] Obtain a second pre-set large model; use pre-collected medical text data to perform incremental training on the second pre-set large model based on the medical field to obtain a medical large model; use historical medical record text data to perform supervised fine-tuning (SFT) training on the medical large model based on prompt-tuning (P-tuning), and complete the training of the second pre-set large model when the preset stopping condition is met to obtain a large model for generating medical record text.
[0078] In this approach, prompt tuning guides the model to generate outputs that better meet the specific task requirements by optimizing the model's input prompts, without requiring large-scale adjustments to the model's parameters. This method can effectively improve the model's performance on specific tasks while maintaining its generalization ability.
[0079] The goal of SFT training is to enable pre-trained models to better adapt to specific tasks or domains. Through supervised learning on labeled data, models can learn more specific and refined language structures and task-related knowledge.
[0080] The basic process of SFT training includes the following steps: Select a pre-trained model from a large language model library. These models have been pre-trained on a large amount of text data and have extensive language understanding and generation capabilities.
[0081] Collect and label datasets relevant to a specific task. Labeled data includes input text and corresponding correct outputs (or labels). In a medical record generation scenario, the input could be patient information and a doctor's preliminary diagnosis, while the output is the standardized medical record text to be generated.
[0082] The labeled dataset is fed into a pre-trained model for supervised fine-tuning. The model attempts to predict the correct output for each input and compares it with the actual labeled output, adjusting model parameters using optimization algorithms such as gradient descent to minimize prediction error.
[0083] During training, the model's performance on the validation dataset is evaluated periodically to ensure its generalization ability. If performance is unsatisfactory, parameters such as the learning rate, batch size, and number of training epochs need to be adjusted, or more labeled data needs to be added, and training should continue until the model reaches a satisfactory performance level. After training is complete, the fine-tuned model is saved for practical applications. This model will outperform the original pre-trained model on specific tasks because it has been adapted to the specific requirements of the task and domain knowledge.
[0084] The above steps utilize historical medical record data for incremental training, continuously updating the model and enhancing the medical big data model's ability to contain knowledge related to medical record writing. This enables the medical big data model to better understand and generate medical texts, thereby improving the quality and acceptability of medical record texts.
[0085] Specifically, the large model for generating medical record text is obtained by selecting a second pre-set large model from an optional pre-trained language model library. This second pre-set large model is an open-source large language model.
[0086] A large amount of medical-related text data is collected, including medical literature, medical records, medical reports, and drug instructions, with the aim of enabling the model to gain a deeper understanding of the language characteristics and professional terminology in the medical field. This medical data is then used to incrementally train a second pre-set large model, further optimizing the model's medical text understanding and generation capabilities based on the original pre-training. The training process includes: cleaning the medical data and converting it into a format readable by the model; training the model to learn specific patterns and knowledge within the medical data; and optimizing training parameters such as the learning rate and batch size to accelerate training and improve model performance.
[0087] During training, the model's performance on medical text understanding tasks, such as medical record generation and medical report interpretation, is evaluated periodically. Training strategies are adjusted based on the evaluation results until the model achieves ideal adaptability to the medical domain. After incremental training, a large-scale medical model is obtained, possessing deeper medical domain knowledge and understanding capabilities.
[0088] For example, in evaluating the medical record generation capability, the ROUGE score can be used to assess the degree of overlap between the model-generated medical records and reference medical records; an A / B test can also be used to compare the quality differences between the model-generated and reference medical records. Furthermore, human review can be conducted from a medical expertise perspective to determine whether the generated text accurately reflects the information in the original text, whether it conforms to medical writing standards, and whether any important information is missing. Further, historical medical record text data is collected and organized; this data will serve as input and target for supervised fine-tuning, allowing the model to learn how to generate medical record texts similar to these records.
[0089] Supervised fine-tuning training of a large medical model is performed using historical medical record text data, based on prompts. This includes the following steps: designing specific prompts to guide the model in generating text with specific formats or content; comparing the generated text with real historical medical records, calculating the loss function, and adjusting model parameters through backpropagation; and setting preset stopping conditions, such as reaching specific metric thresholds (e.g., BLEU score, ROUGE score), completing a preset number of training epochs, or when model performance no longer shows significant improvement.
[0090] Once the stopping condition is met, the trained model becomes the large-scale medical record text generation model. This model not only understands medical knowledge but also learns how to generate medical record texts that are correctly formatted, rich in content, and conform to doctors' writing habits.
[0091] In summary, this application introduces a large-scale medical record text generation model to achieve intelligent and automated semantic understanding and generation of medical texts. The generated medical record texts are more accurate and realistic, meeting the writing needs of doctors and the personalized needs of patients, thereby improving the quality and acceptability of medical record texts. Furthermore, it reduces the time and effort costs for doctors to write medical record texts, improves medical work efficiency, and reduces information omissions and errors.
[0092] By using a large-scale medical record text generation model, it is possible to flexibly address the different patient conditions and doctors' personalized needs, thereby achieving personalized medical record text generation. Furthermore, steps S102 to S108 are highly scalable, allowing for dynamic adjustments to the generated results based on actual needs, and preventing information obsolescence or outdatedness even after long-term use. In some optional embodiments of this application, the large-scale medical record text generation model is used to determine the medical record text corresponding to both medical information and the target average value. This can be achieved by: analyzing the medical information, the target average value, and scenario prompts using the large-scale medical record text generation model to obtain the medical record text output by the model. The scenario prompts include at least one of the following: admission progress notes and discharge progress notes.
[0093] Figure 6 This is a schematic diagram of a method for generating medical record text according to an embodiment of this application, such as... Figure 6 As shown, this method can be implemented in the following way.
[0094] First, N sample medical records from Doctor A are randomly selected. These samples represent the doctor's specific style and habits when writing medical records. Each medical record is input into a pre-trained neural network model, which can extract and encode the doctor's writing features. For each medical record, the model outputs a style vector. For example, for two medical records from Doctor A, the model outputs vectors v1=[a1,a2,a3] and v2=[b1,b2,b3].
[0095] The N style vectors are averaged to obtain a comprehensive final style vector for doctor A. When N=2, the average style vector is calculated as: v = [(a1+b1) / 2,(a2+b2) / 2,(a3+b3) / 2]. This vector will serve as a representation of the doctor's personal style and will be used in the generation of subsequent medical record texts.
[0096] Then, the patient profile (i.e., disease type - key information - information value) of the current patient is queried in the patient profile database as an information prompt for the large model of medical record text generation.
[0097] Finally, the final style vector of doctor A and the patient's information cues are integrated as input to the large-scale medical record text generation model. This means that the large-scale medical record text generation model not only needs to understand the patient's basic information, but also needs to consider the doctor's writing habits and style.
[0098] The large-scale medical record text generation model generates the final medical record text based on vector instructions, information prompts, and scene prompts. The generation process ensures that the medical record text conforms to medical standards, reflects the doctor's personalized writing style, and comprehensively reflects the patient's specific condition.
[0099] In some alternative embodiments of this application, after using a large model to generate medical record text and determining the medical record text that corresponds to both medical information and the target average value, the following steps can also be performed: collecting voice data between the doctor and the patient; analyzing the voice data using a sentiment analysis model to obtain the patient's sentiment vector; and adjusting preset fields in the medical record text based on the patient's sentiment vector.
[0100] Specifically, this involves recording conversations between doctors and patients during consultations, diagnoses, and treatments. The recording equipment must have good audio quality, clearly capturing the voices of both parties, while adhering to privacy policies and obtaining explicit recording authorization from patients.
[0101] The collected speech data is converted into text and then input into a pre-trained sentiment analysis model. This model can be a deep learning-based neural network model, such as LSTM (Long Short-Term Memory), BERT (Bidirectional Encoder Representation), or the more advanced Transformer architecture. The model analyzes the text content to determine the patient's emotional state and outputs a sentiment vector representing the degree of different emotions such as joy, sadness, anxiety, and calmness. The sentiment analysis model outputs one or more sentiment categories and their corresponding intensity values. For example, the model might output "Anxiety: 0.7" or "Calm: 0.2," indicating that the patient primarily exhibits anxiety.
[0102] Based on the patient's emotional vector, preset fields in the medical record text are adjusted to reflect the patient's emotional state and provide appropriate emotional support. For example, if the patient exhibits anxiety, the doctor's attention to and reassurance of the patient's emotions can be added to the medical record, such as: "The patient was quite tense today, and psychological comfort and support have been provided. It is recommended that family members spend more time with the patient." If the patient's emotions are stable, it can be briefly mentioned to reflect a comprehensive assessment: "The patient's emotions were stable today, and the patient actively cooperated with the treatment."
[0103] The revised medical record text must be reviewed by the doctor or medical team to ensure the information is accurate and conforms to medical ethics, avoiding the neglect of medical facts due to excessive focus on emotions. The medical team can appropriately modify or supplement emotional support content based on professional knowledge and the patient's actual situation. The process of sentiment analysis and text adjustment should be continuously optimized, iterating and upgrading the sentiment analysis model and text adjustment strategy based on feedback from doctors and patients to improve the accuracy of sentiment recognition and the appropriateness of text adjustment.
[0104] Through the above steps, not only can medical record texts based on objective medical information and doctors' writing style be generated, but also an understanding of the patient's emotional state and humanistic care can be incorporated into the text. This makes the medical record no longer a cold data record, but a comprehensive document that can fully reflect the patient's health status and psychological needs, which helps to improve the quality of doctor-patient communication and the patient's medical experience.
[0105] For example, the method for generating medical record text proposed in this application can be applied to the following scenarios:
[0106] 1. Disease progression.
[0107] (1) Admission progress: Automatically generate the patient's medical record text upon admission, including chief complaint, post-admission physical examination content, cardiac ultrasound results, and other information.
[0108] (2) Postoperative course of disease: Generate the patient's postoperative medical record text, including the surgical process, postoperative condition, treatment measures, etc.
[0109] (3) Dressing Change Process: Automatically generate medical record texts of patients during the dressing change process, including reasons for dressing change, specific operations, effect evaluation, etc.
[0110] (4) Discharge record: Automatically generate the patient's medical record text upon discharge, including diagnosis, treatment plan, precautions, etc.
[0111] 2. Generation of present illness history upon second admission: Based on the patient's previous hospitalization medical data, the present illness history upon second admission is automatically generated, including chief complaint, past medical history, diagnosis and treatment process, etc.
[0112] 3. Surgical report generation: Automated generation of detailed reports of the surgical procedure, including surgical steps, intraoperative conditions, surgical results, and other information.
[0113] Two different cases will be given below. For ease of description, sample data will be provided directly below:
[0114] 1. Scenario 1: Admission course of illness.
[0115] The patient profile included: (1) Blood pressure: 136 / 79 mmHg; (2) Heart rate: 72 beats / min; (3) Heart rhythm: regular; (4) Auscultation: clear breath sounds in both lungs, without dry or wet rales; (5) General condition: no discomfort reported; (6) Echocardiography: enlarged left ventricle, mitral regurgitation; (7) Surgery: permanent pacemaker implantation.
[0116] The generated medical record text includes: the patient reported no discomfort, blood pressure 136 / 79 mmHg, clear breath sounds in both lungs, no dry or wet rales, heart rate 72 bpm, regular rhythm, no edema in both lower extremities. Echocardiography revealed: left ventricular enlargement and mitral regurgitation. The attending physicians (names omitted) checked the patient's condition: [Patient's name omitted], there are clear indications for permanent pacemaker implantation, no contraindications, and elective permanent pacemaker implantation will be performed. Intravenous antibiotics were administered half an hour preoperatively to prevent infection. Preoperative examinations were completed, and the patient and family were fully informed of the risks and benefits of the surgery, including potential complications such as inability to complete the surgery, catheter breakage, allergic reactions, severe arrhythmias, cardiac vascular damage, bleeding, angina pectoris, myocardial infarction, heart failure, cardiac tamponade, cerebrovascular accident, pneumothorax, hemothorax, infection, thrombosis, and pacemaker quality issues. The family expressed understanding and cooperation with the treatment. Further observation is required.
[0117] 2. Scenario 2: Postoperative course of disease.
[0118] The patient profile included: (1) Blood pressure: 140 / 75 mmHg; (2) Heart rate: 60 beats / min; (3) Heart rhythm: regular; (4) Drug treatment: intravenous antibiotics for anti-inflammatory purposes; (5) Surgical outcome: successful; (6) General condition: clear consciousness, no complaints of discomfort; (7) Auscultation: heart sounds were normal, breathing was stable, and there were no obvious dry or wet rales in both lungs.
[0119] The generated medical record text includes: The patient's procedure was successful; the patient returned to the ward safely, was alert, and did not complain of discomfort. Blood pressure was 140 / 75 mmHg, heart rate was 60 bpm, regular rhythm, heart sounds were normal, breathing was stable, and there were no intermittent or obvious dry or wet rales in both lungs. There was no bleeding or hematoma at the puncture site, and an elastic bandage was applied for pressure. The electrocardiogram showed sinus rhythm. Postoperatively, the patient received intravenous antibiotics for anti-inflammatory treatment. A pacemaker programming and chest X-ray were scheduled, and the patient's condition was closely monitored.
[0120] Figure 7 This is a structural diagram of a medical record text generation device according to an embodiment of this application, such as... Figure 7 As shown, the device includes:
[0121] The receiving module 72 is used to receive multiple historical medical record texts.
[0122] The first determining module 74 is used to determine the writing style vector corresponding to each historical medical record text using a neural network model, to obtain multiple writing style vectors, and to determine the target average value of the multiple writing style vectors.
[0123] The search module 76 is used to search for the patient's medical information in the patient profile database. The medical information includes at least: target disease information, target indicator information points corresponding to the target disease information, and target indicator values corresponding to the target indicator information points.
[0124] The second determination module 78 is used to generate a large model using medical record text, and to determine the medical record text that corresponds to both medical information and the target average value.
[0125] Optionally, the neural network model is trained using the following method: inputting the first historical medical record text corresponding to the first object into an encoding / decoding module to obtain a first output result, the encoding / decoding module being used to extract information from the first historical medical record text; inputting the second historical medical record text corresponding to the first object into a contrast learning module to obtain a second output result, the contrast learning module being used to mine the internal structure and semantic information of the second historical medical record text; inputting the third historical medical record text corresponding to the second object into the contrast learning module to obtain a third output result, the contrast learning module being used to learn the structural and semantic differences between the third historical medical record text and the second historical medical record text; determining a loss function based on the first output result, the second output result, and the third output result, and completing the training of the neural network model when the loss function satisfies a preset convergence condition.
[0126] Optionally, the patient profile database is constructed by: receiving a data extraction instruction; based on the data extraction instruction, extracting the content indicated by the data extraction instruction from unstructured medical record text using a large-scale patient profile extraction model to obtain the extraction result; merging the extraction result with the structured medical record text to obtain the patient profile database; wherein, the historical medical record text includes both unstructured and structured medical record text.
[0127] Optionally, the large-scale patient profile extraction model is obtained by training the following method: acquiring a disease database, wherein the disease database includes information on different diseases and indicator information points corresponding to each disease; receiving a fine-tuning dataset based on the disease database, wherein each fine-tuning data in the fine-tuning dataset is used to extract disease information, indicator information points corresponding to the disease information, and indicator values; and fine-tuning and training the first preset large-scale model based on the fine-tuning dataset to obtain the large-scale patient profile extraction model.
[0128] Optionally, the large-scale medical record text generation model is obtained by training the model through the following method: obtaining a second preset large-scale model; using pre-collected medical data, performing incremental training of the second preset large-scale model based on the medical domain to obtain a medical large-scale model; using historical medical record text data, performing supervised fine-tuning training of the medical large-scale model based on prompts, and completing the training of the second preset large-scale model when the preset stopping conditions are met, thus obtaining the large-scale medical record text generation model.
[0129] Optionally, the second determining module 78 is further configured to perform the following steps: using a large medical record text generation model to analyze medical information, target average value and scene prompt information to obtain medical record text output by the large medical record text generation model, wherein the scene prompt information includes at least one of the following: admission course of illness and discharge course of illness.
[0130] Optionally, the medical record text generation device is also used to perform the following steps after using the medical record text to generate a large model and determine the medical record text that corresponds to both medical information and the target average value: collecting voice data between the doctor and the patient; analyzing the voice data using a sentiment analysis model to obtain the patient's sentiment vector; and adjusting preset fields in the medical record text according to the patient's sentiment vector.
[0131] It should be noted that the above Figure 7 The modules in can be program modules (e.g., a set of program instructions that implements a specific function) or hardware modules. For the latter, they can be represented in the following forms, but are not limited to these: each of the above modules is represented by a processor, or the functions of each of the above modules are implemented by a processor.
[0132] It should be noted that, Figure 7 Preferred embodiments of the shown examples can be found in [reference needed]. Figure 1 The relevant descriptions of the embodiments shown will not be repeated here.
[0133] Figure 8 A hardware block diagram of a computer terminal for implementing a method for generating medical record text is shown. Figure 8 As shown, the computer terminal 80 may include one or more processors 802 (shown as 802a, 802b, ..., 802n in the figure) 802 (processor 802 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 804 for storing data, and a transmission module 806 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 8 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, the computer terminal 80 may also include... Figure 8 The more or fewer components shown, or having the same Figure 8 The different configurations shown.
[0134] It should be noted that the aforementioned one or more processors 802 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 80. As involved in the embodiments of this application, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).
[0135] The memory 804 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the medical record text generation method in this embodiment. The processor 802 executes various functional applications and data processing by running the software programs and modules stored in the memory 804, thereby realizing the aforementioned medical record text generation method. The memory 804 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 804 may further include memory remotely located relative to the processor 802, and these remote memories can be connected to the computer terminal 80 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0136] The transmission module 806 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 80. In one example, the transmission module 806 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission module 806 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0137] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 80.
[0138] It should be noted here that, in some optional embodiments, the above... Figure 8 The computer terminal shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 8 This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computer terminal.
[0139] It should be noted that, Figure 8 The computer terminal shown is used to execute Figure 1 The method for generating medical record text shown above also applies to this electronic device, and will not be repeated here.
[0140] This application also provides a non-volatile storage medium, which includes a stored program, wherein the program, when running, controls the device where the storage medium is located to execute the above-described method for generating medical record text.
[0141] A program that uses a non-volatile storage medium to perform the following functions: receive multiple historical medical record texts; use a neural network model to determine the writing style vector corresponding to each historical medical record text, obtain multiple writing style vectors, and determine the target average value of the multiple writing style vectors; search for the patient's medical information in a patient profile database, wherein the medical information includes at least: target disease information, target indicator information points corresponding to the target disease information, and target indicator values corresponding to the target indicator information points; and use the medical record texts to generate a large model to determine the medical record texts that correspond to both the medical information and the target average value.
[0142] This application also provides an electronic device, including a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the above-described method for generating medical record text.
[0143] The processor is used to run a program that performs the following functions: receiving multiple historical medical record texts; using a neural network model to determine the writing style vector corresponding to each historical medical record text, obtaining multiple writing style vectors, and determining the target average value of the multiple writing style vectors; searching for the patient's medical information in the patient profile database, wherein the medical information includes at least: target disease information, target indicator information points corresponding to the target disease information, and target indicator values corresponding to the target indicator information points; and using the medical record texts to generate a large model to determine the medical record text that corresponds to both the medical information and the target average value.
[0144] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0145] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0146] In the above embodiments of this application, the information collected is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with relevant laws, regulations and standards, take necessary protective measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.
[0147] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0148] The units described as separate components may or may not be physically separate. 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 units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0149] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0150] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0151] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for generating medical record text, characterized in that, include: Receive multiple historical medical record texts; A neural network model is used to determine the writing style vector corresponding to each of the historical medical record texts, resulting in multiple writing style vectors. A target average value for these multiple writing style vectors is then determined. The neural network model is trained through the following steps: The first historical medical record text corresponding to the first object is input into an encoding / decoding module to obtain a first output result; the encoding / decoding module is used to extract information from the first historical medical record text. The second historical medical record text corresponding to the first object is input into a contrast learning module to obtain a second output result; the contrast learning module is used to mine the internal structure and semantic information of the second historical medical record text. The third historical medical record text corresponding to the second object is input into the contrast learning module to obtain a third output result; the contrast learning module is also used to learn the relationship between the third historical medical record text and the second historical medical record text. The structural and semantic differences between the recorded texts are analyzed; a loss function is determined based on the first output result, the second output result, and the third output result, and the neural network model is trained when the loss function satisfies a preset convergence condition; wherein, the contrastive learning module is further used to maximize the similarity score between positive samples and minimize the similarity score between positive samples and negative samples, where the positive samples are different historical medical record texts of the same object, and the negative samples are different historical medical record texts of different objects; determining the loss function based on the first output result, the second output result, and the third output result includes: determining the reconstruction loss between the first output result and the first historical medical record text; determining the contrast loss between the second output result and the third output result; and determining the loss function based on the reconstruction loss and the contrast loss. Search for the patient's medical information in the patient profile database, wherein the medical information includes at least: target disease information, target indicator information points corresponding to the target disease information, and target indicator values corresponding to the target indicator information points; A large model is generated using medical record text to determine the medical record text that corresponds to both the medical information and the target average value.
2. The method according to claim 1, characterized in that, The patient profile database was constructed through the following steps: Receive data extraction instructions; Based on the data extraction instructions, the content indicated by the data extraction instructions is extracted from the unstructured medical record text using a large patient profile extraction model to obtain the extraction results. The extraction results are merged with the structured medical record text to obtain the patient profile database; The historical medical record text includes both the unstructured medical record text and the structured medical record text.
3. The method according to claim 2, characterized in that, The large-scale patient profile extraction model was obtained through training using the following steps: Obtain a disease database, wherein the disease database includes information on different diseases and indicator information points corresponding to each disease information; Receive a fine-tuning dataset of instructions based on the disease database, wherein each fine-tuning data in the fine-tuning dataset is used to extract the disease information, the indicator information points corresponding to the disease information, and the indicator values; Based on the instructions, the dataset is fine-tuned, and the first preset large model is fine-tuned and trained to obtain a large model for extracting patient profiles.
4. The method according to claim 1, characterized in that, The large-scale medical record text generation model was trained through the following steps: Obtain the second preset large model; Using pre-collected medical data, the second pre-defined large model is incrementally trained based on the medical field to obtain a large medical model; Using historical medical record text data, the medical large model is subjected to supervised fine-tuning training based on prompts, and the training of the second preset large model is completed when the preset stopping conditions are met, thus obtaining the medical record text generation large model.
5. The method according to claim 1, characterized in that, A large model is generated using medical record text to determine the medical record text that corresponds to both the medical information and the target average value, including: The medical record text generation model is used to analyze the medical information, the target average value, and the scene prompt information to obtain the medical record text output by the medical record text generation model. The scene prompt information includes at least one of the following: admission course of illness and discharge course of illness.
6. The method according to claim 1, characterized in that, After generating a large model using medical record text and determining the medical record text that corresponds to both the medical information and the target average value, the method further includes: Collect voice data between doctors and patients; The voice data is analyzed using an emotion analysis model to obtain the patient's emotion vector; Based on the patient's emotional vector, preset fields in the medical record text are adjusted.
7. A device for generating medical record text, characterized in that, include: The receiving module is used to receive multiple historical medical record texts; A first determining module is used to determine the writing style vector corresponding to each of the historical medical record texts using a neural network model, obtaining multiple writing style vectors, and determining the target average value of the multiple writing style vectors. The neural network model is trained through the following steps: inputting the first historical medical record text corresponding to the first object into an encoding / decoding module to obtain a first output result; the encoding / decoding module is used to extract information from the first historical medical record text; inputting the second historical medical record text corresponding to the first object into a comparison learning module to obtain a second output result; the comparison learning module is used to mine the internal structure and semantic information of the second historical medical record text; inputting the third historical medical record text corresponding to the second object into the comparison learning module to obtain a third output result; the comparison learning module is also used to learn the relationship between the third historical medical record text and the second historical medical record text. The structural and semantic differences between historical medical record texts are analyzed. A loss function is determined based on the first, second, and third output results, and training of the neural network model is completed when the loss function satisfies a preset convergence condition. The contrastive learning module further maximizes the similarity score between positive samples and minimizes the similarity score between positive and negative samples, where positive samples are different historical medical record texts of the same object, and negative samples are different historical medical record texts of different objects. Determining the loss function based on the first, second, and third output results includes: determining the reconstruction loss between the first output result and the first historical medical record text; determining the contrastive loss between the second and third output results; and determining the loss function based on the reconstruction loss and the contrastive loss. The search module is used to search for a patient's medical information in a patient profile database. The medical information includes at least: target disease information, target indicator information points corresponding to the target disease information, and target indicator values corresponding to the target indicator information points. The second determining module is used to generate a large model using medical record text to determine the medical record text that corresponds to both the medical information and the target average value.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the non-volatile storage medium to perform the method for generating medical record text as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, performs the method for generating medical record text as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for generating medical record text as described in any one of claims 1 to 6.