Method and device for generating medical record text

Through the combination of neural network model and patient portrait database, personalized medical record text is generated, which solves the problem that template generation methods in the prior art cannot adapt to the needs of different patients and doctors, and improves text quality and efficiency.

CN120562389AActive Publication Date: 2025-08-29NAT CENT FOR CARDIOVASCULAR DISEASES
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511059647.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-08-29
Estimated Expiration
2045-07-30

AI Technical Summary

Technical Problem

The existing template-based medical record text generation methods cannot flexibly respond to the patient's condition characteristics and the personalized needs of doctors, resulting in a decrease in the quality and acceptability of generated texts.

Method used

By receiving historical medical record text, using neural network models to determine the writing style vector, combining medical information in the patient's portrait database, using medical record text to generate a large model to generate personalized medical record text.

Benefits of technology

The automated generated medical record text can effectively combine the patient's condition characteristics and the doctor's personalized needs, improve the quality and acceptability of text generation, and reduce the time and energy cost of doctors for writing medical records.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120562389A_ABST
    Figure CN120562389A_ABST
Patent Text Reader

Abstract

The invention discloses a medical record text generation method and device. The method comprises the following steps: receiving a plurality of historical medical record texts; determining a writing style vector corresponding to each historical medical record text by using a neural network model to obtain a plurality of writing style vectors, and determining a target average value of the plurality of writing style vectors; medical information of the patient is searched in a patient portrait database, and the medical information at least comprises target disease type information, target index information points corresponding to the target disease type information and target index values corresponding to the target index information points; and generating a large model by using the medical record text, and determining the medical record text jointly corresponding to the medical information and the target average value. The technical problem that the condition characteristics of different patients and the individual requirements of doctors cannot be effectively combined due to the fact that the medical record content is filled in by adopting a fixed template in a related medical record text generation method is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to a method and device for generating medical record text. Background Art

[0002] Generating medical records is a core task in the medical field. In medical practice, medical records carry crucial information, such as a patient's diagnosis and treatment history, and play an irreplaceable role in doctors' diagnosis and treatment. However, in a busy medical environment, doctors need to spend a considerable amount of time and effort compiling medical records, which is not only inefficient but also prone to omissions and errors. Therefore, methods for automatically generating medical records have become a research hotspot in the medical field.

[0003] In current real-world scenarios, template-based approaches suffer from rigid text generation and lack the flexibility to address physicians' individual needs. This can lead to the generated text not conforming to physicians' writing habits, thus reducing its quality and acceptability. Furthermore, given the complex and ever-changing conditions of individual patients, template-based generation methods lack dynamic flexibility, necessitating continuous expansion for long-term use.

[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0005] The present application provides a method and device for generating medical record text, so as to at least solve the technical problem that the relevant medical record text generation method uses a fixed template to fill in the medical record content, resulting in the inability to effectively combine the medical conditions of different patients and the personalized needs of doctors.

[0006] According to one aspect of the present application, a method for generating a medical record text is provided, comprising: receiving a plurality of historical medical record texts; determining a writing style vector corresponding to each historical medical record text using a neural network model, obtaining a plurality of writing style vectors, and determining a target average value of the plurality of writing style vectors; searching for the patient's medical information in a patient portrait 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; generating a large model using the medical record text, and determining a medical record text corresponding to both the medical information and the target average value.

[0007] Optionally, the neural network model is obtained by training by the following method: inputting the first historical medical record text corresponding to the first object into the encoding and decoding module to obtain a first output result, and the encoding and 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 the comparative learning module to obtain a second output result, and the comparative learning module is used to mine the intrinsic 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 comparative learning module to obtain a third output result, and the comparative 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 the 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 meets the preset convergence condition.

[0008] Optionally, the patient portrait 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 the unstructured medical record text through a patient portrait extraction model to obtain an extraction result; merging the extraction result with the structured medical record text to obtain a patient portrait database; wherein the historical medical record text includes unstructured medical record text and structured medical record text.

[0009] Optionally, the patient portrait extraction big model is obtained by training through the following method: obtaining a disease library, wherein the disease library includes information of different diseases and indicator information points corresponding to each disease information; receiving an instruction fine-tuning data set based on the disease library, wherein each instruction fine-tuning data in the instruction fine-tuning data set is used to extract disease information, indicator information points corresponding to the disease information, and indicator values; based on the instruction fine-tuning data set, fine-tuning training is performed on the first preset big model to obtain the patient portrait extraction big model.

[0010] Optionally, the medical record text generation big model is obtained by training through the following method: obtaining a second preset big model; using pre-collected medical data, performing incremental training based on the medical field on the second preset big model to obtain a medical big model; using historical medical record text data, performing supervised fine-tuning training based on prompt tuning on the medical big model, and completing the training of the second preset big model when the preset stopping conditions are met to obtain the medical record text generation big model.

[0011] Optionally, a medical record text generation big model is used to determine the medical record text corresponding to the medical information and the target average value, including: using the medical record text generation big model to analyze the medical information, the target average value and the scenario prompt information to obtain the medical record text output by the medical record text generation big model, wherein the scenario prompt information includes at least one of the following: admission course of illness, discharge course of illness.

[0012] Optionally, 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: 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.

[0013] According to another aspect of the present application, a device for generating a medical record text is also provided, including: a receiving module for receiving multiple historical medical record texts; a first determination module for using 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; a search module for searching the patient's medical information in a patient portrait 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 second determination module for using the medical record text to generate a large model to determine the medical record text corresponding to the medical information and the target average value.

[0014] According to another aspect of the present application, a non-volatile storage medium is provided, which includes a stored program, wherein when the program is run, the device where the storage medium is located is controlled to execute the above method for generating medical record text.

[0015] According to another aspect of the present application, an electronic device is provided, including: a memory and a processor, wherein the processor is configured to run a program stored in the memory, wherein the above method for generating a medical record text is executed when the program is run.

[0016] According to another aspect of the present application, a computer program is provided, wherein when the computer program is executed by a processor, the above method for generating a medical record text is implemented.

[0017] According to another aspect of the present application, a computer program product is provided, which includes a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above method for generating medical record text is implemented.

[0018] In the present application, a method is adopted in which a plurality of historical medical record texts are received; a neural network model is used to determine the writing style vector corresponding to each historical medical record text, a plurality of writing style vectors are obtained, and a target average value of the plurality of writing style vectors is determined; the patient's medical information is searched in a patient portrait 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 the medical record text to determine the medical record text corresponding to the medical information and the target average value, and the medical information of the patient found in the patient portrait database and the target average value of the doctor's writing style vector determined by the neural network model are analyzed by the large model for generating the medical record text to obtain the medical record text output by the large model for generating the medical record text, thereby achieving the purpose of effectively combining the medical condition characteristics of different patients and the personalized needs of doctors, and automatically generating medical record texts, thereby achieving the technical effect of improving the generation quality of medical record texts, and further solving the technical problem that the relevant medical record text generation method uses a fixed template to fill in the medical record content, resulting in the inability to effectively combine the medical condition characteristics of different patients and the personalized needs of doctors. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 is a flow chart of a method for generating a medical record text according to an embodiment of the present application; Figure 2 is a training diagram of a neural network model according to an embodiment of the present application; Figure 3 This is a schematic diagram of constructing a patient portrait database according to an embodiment of the present application; Figure 4 This is a schematic diagram of training a large model for extracting patient portraits according to an embodiment of the present application; Figure 5 This is a schematic diagram of training a large model for generating medical record text according to an embodiment of the present application; Figure 6 is a schematic diagram of a method for generating a medical record text according to an embodiment of the present application; Figure 7 is a structural diagram of a device for generating a medical record text according to an embodiment of the present application; Figure 8 This is a hardware structure block diagram of a computer terminal according to a method for generating medical record text in an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] According to an embodiment of the present application, a method embodiment of a method for generating a medical record text is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0023] Figure 1 This is a flow chart of a method for generating a medical record text according to an embodiment of the present application, such as Figure 1 As shown, the method includes the following steps: Step S102: Receive multiple historical medical record texts.

[0024] In step S102, taking Doctor A as an example, multiple historical medical records of Doctor A are randomly obtained. Medical records, also known as medical records, are electronic medical records or scanned versions of paper medical records. Medical records are documents that record a patient's medical health information, including but not limited to basic personal information, medical history, physical examination results, diagnosis, treatment plan, medication prescriptions, surgical records, laboratory test results, and the doctor's observations and evaluations.

[0025] Step S104 : Using a neural network model to determine the writing style vector corresponding to each historical medical record text, obtain multiple writing style vectors, and determine a target average value of the multiple writing style vectors.

[0026] According to some optional embodiments of the present application, the neural network model is obtained by training by the following method: inputting the first historical medical record text corresponding to the first object into the encoding and decoding module to obtain a first output result, and the encoding and 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 the comparative learning module to obtain a second output result, and the comparative learning module is used to mine the intrinsic 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 comparative learning module to obtain a third output result, and the comparative 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 the 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 meets the preset convergence condition.

[0027] It is worth explaining that the first historical medical record text corresponding to the above first object is a historical medical record text written by a doctor selected during the training process of the neural network model, such as historical medical record text 1 written by doctor A.

[0028] 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, for example, historical medical record text 2 written by doctor A.

[0029] The third historical medical record text corresponding to the above second object is a historical medical record text written by another second object different from the first object selected during the neural network model training process, such as historical medical record text 3 written by doctor B.

[0030] Figure 2 This is a training diagram of a neural network model according to an embodiment of the present application, wherein Encode-Decode is an encoding and decoding module, Dense is a dense layer, and the dense layer is set in the encoding and decoding module. It can also receive the result of the encoder separately. Multiple encoding and decoding modules and dense layers constitute a comparative learning framework. Figure 2 Describe in detail how the neural network model is trained.

[0031] First, collect the first historical medical record text corresponding to doctor A ( Figure 2 Medical records 1) and the second historical medical record text ( Figure 2 Medical records 2 in the collection), and collect the third historical medical records corresponding to doctor B ( Figure 2 3) Texts in medical records. These texts form the basis of the training dataset.

[0032] Next, the first historical medical record text (Medical Record 1) corresponding to Doctor A is input into the encoding and decoding module. The encoding and decoding module utilizes an autoencoder architecture, which automatically extracts and encodes key information from the medical record text. The module's internal encoder extracts features from the medical record text, and the decoder reconstructs the text, outputting the reconstructed medical record text as the first output. This first output is compared with the original medical record text to evaluate the information extraction capabilities of the encoding and decoding module, thereby verifying and optimizing the accuracy of feature extraction.

[0033] 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, diagnosis results, treatment process, etc. 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 phase are complete and accurate enough to reproduce the main content of the original medical record text. By comparing the reconstructed text with the original text, the model's encoding strategy can be optimized to ensure that important information is not lost.

[0034] Next, the contrastive learning module is fed with the second historical medical record text of Doctor A (Case 2) and the third historical medical record text of Doctor B (Case 3). 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 module then outputs the style and semantic embedding vectors as the second and third output results.

[0035] Specifically, the core functions of the comparative learning module include: 1. Style learning: Identifying and learning the individual characteristics of different doctors' writing from the text, including but not limited to vocabulary selection, sentence structure, and preferences for medical terminology. This learning ability enables the model to generate medical record text that matches the writing style of a specific doctor, increasing the personalization and naturalness of the text. 2. Semantic understanding: By comparing different texts, learning the deep meaning and contextual associations of the text, which is crucial for understanding and generating complex medical descriptions. It not only ensures that the generated text has clear logic and accurate content, but also imitates the thinking process of human doctors when writing medical records to a certain extent. 3. Structural analysis: Analyzing the inherent structure of the text, such as the organization of medical records, the order in which information is presented, etc., helps to improve the readability and consistency of the generated text.

[0036] Through the above-mentioned contrastive learning module, style learning of medical record texts can be achieved. Specifically, the contrastive learning module can regard different medical record texts of the same doctor as positive sample pairs, and the positive sample pairs share the same style features. By maximizing the similarity scores between these texts, the module can learn the writing characteristics of the doctor. At the same time, the contrastive learning module can regard medical record texts from different doctors as negative sample pairs, and the style differences between negative sample pairs are large. By minimizing the similarity scores between positive and negative samples, the contrastive learning module can distinguish the writing styles of different doctors, and then learn the unique style of individual doctors in more detail. Through the above process, the contrastive learning module can generate a style vector, which encodes the style features of the medical record text written by the doctor. Using this style vector as part of the input can guide the large medical model to generate medical record texts with similar styles.

[0037] Furthermore, the aforementioned contrastive learning module enables accurate semantic understanding of medical record text. Specifically, the contrastive learning module can treat different medical records from the same doctor as positive sample pairs, which share common stylistic features. By maximizing the similarity scores between these texts, the contrastive module can learn the doctor's writing style. This helps the subsequent large-scale medical record text generation model gain a deeper understanding of the professional terminology, diagnosis descriptions, and treatment plans in medical texts.

[0038] Finally, a total loss function is calculated based on the difference between the first output (the reconstructed text of Medical Record 1) and the original text, as well as the contrastive loss between the second output (the embedded vector of Medical Record 2) and the third output (the embedded vector of Medical Record 3). Preferably, the loss function includes a reconstruction loss (used to evaluate the accuracy of the encoding and decoding modules) and a contrastive loss (used to evaluate the ability of the contrastive learning module to distinguish different writing styles).

[0039] The above reconstruction loss is specifically implemented by the following formula:

[0040] L CE Represents cross-entropy loss, which is used to measure the difference between the model prediction value and the true value; n represents the total number of samples, that is, the dimension of the input data or the number of samples in the dataset; y i represents the true label of the i-th sample, which can be the true category label of a word; y hati It represents the predicted value of the i-th sample, which is the probability distribution of the model output. It can be the probability that the model predicts that a word is a specific category or a specific word.

[0041] The above contrast loss is specifically implemented by the following formula: ; L contrastive Represents contrastive loss, which is used to measure the similarity or dissimilarity between embedding vectors; y represents the label of the sample pair, for positive sample pairs (i.e., semantically similar sample pairs), y = 1, for negative sample pairs (i.e., semantically dissimilar sample pairs), y = 0; d represents the distance between embedding vectors, and the Euclidean distance can be used, i.e. , where z i and z j are two embedding vectors; m represents the margin, a hyperparameter that controls the minimum distance between the embedding vectors of a pair of negative samples; max(0, m - d) specifies that when d is less than m, m - d is calculated, and otherwise 0. This ensures that the distance between the embedding vectors of a pair of negative samples is at least m. The neural network model parameters are optimized using the backpropagation algorithm until the loss function meets the preset convergence criteria, marking the completion of model training.

[0042] Step S106, searching for the patient's medical information in the patient portrait database, wherein the medical information at least includes: target disease information, target indicator information points corresponding to the target disease information, and target indicator values ​​corresponding to the target indicator information points.

[0043] According to other optional embodiments of the present application, the patient portrait 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 the unstructured medical record text through a patient portrait extraction large model to obtain an extraction result; merging the extraction result with the structured medical record text to obtain a patient portrait database; wherein the historical medical record text includes unstructured medical record text and structured medical record text.

[0044] In the above embodiment, a data extraction instruction submitted by a doctor or other medical professional is first received. For example, the data extraction instruction includes but is not limited to keywords, entity types, and the desired output format. The data extraction instruction is then input into the patient profile extraction model, which then extracts the content indicated by the data extraction instruction from the unstructured medical record text to obtain the extraction result. Simultaneously, structured medical records related to the same patient are collected from historical medical records, such as standardized electrocardiogram results, laboratory test data, and other formatted information.

[0045] The extraction results obtained through data extraction are merged with the structured medical record text to construct a single patient portrait that includes all key information points. The extraction results include unstructured data. The single patient portraits of all patients are merged to build a patient portrait database. When adding a patient portrait to the patient portrait database, if the patient corresponding to the patient portrait is a new patient, a new entry is created for the patient; if the patient corresponding to the patient portrait is an existing patient, the existing entry is updated to ensure the freshness and completeness of the patient information.

[0046] The above steps integrate structured and unstructured medical data, process the unstructured data through large-scale information extraction technology, build a more comprehensive and accurate patient portrait, and provide richer input information for generating a large model of medical record text in step S108.

[0047] Figure 3 This is a schematic diagram of constructing a patient portrait database according to an embodiment of the present application. Figure 3 As shown in FIG, the method for constructing a patient portrait database includes the following steps: First, the required information points are searched in the disease database according to the patient's disease type, and extraction instructions are combined based on the information points (disease type - obtain key indicators and indicator values).

[0048] Specifically, based on the patient's disease type, all the indicators and information points that require attention are searched in the predefined disease database. For example, for coronary heart disease, the indicators and information points that require attention include but are not limited to blood pressure, ejection fraction, and calcium score; for arrhythmia, the indicators and information points that require attention include but are not limited to blood pressure, heart rate, and calcium score.

[0049] Based on the retrieved indicator information points, a set of data extraction instructions is assembled to guide the subsequent information extraction process. For example, a data extraction instruction might be used to extract the calcium score value from the following coronary CT text. Please output the result in JSON format, with the primary key being 'calcification score'. 1. Coronary CT text: 'Coronary CTA: No significant atherosclerosis in the three main coronary arteries and their major branches, CAD-RADS 0; 2. Calcification score 1.4; 3. Anomalous origin of the left coronary artery and abnormal proximal course; 4. Ascending aorta tumor'.

[0050] Secondly, based on the trained patient portrait extraction model, the required information points are extracted from the unstructured medical records using extraction instructions to obtain the extraction results (disease type - key indicators - indicator values).

[0051] The extraction result is data expressed in the form of "disease type-key indicator-indicator value", for example, "coronary heart disease-blood pressure-130 / 80 mmHg".

[0052] Finally, the structured medical records and the extraction results (disease type-key indicators-indicator values) are merged and stored in the patient portrait database.

[0053] Through the above steps, we can effectively extract key indicators from historical medical records, integrate structured and unstructured data, and build a comprehensive and personalized patient profile database. This integrated approach significantly improves the efficiency of medical record organization while ensuring the integrity and accuracy of the information.

[0054] Furthermore, the patient portrait extraction big model is obtained by training through the following method: obtaining a disease library, wherein the disease library includes information of different diseases and indicator information points corresponding to each disease information; receiving an instruction fine-tuning data set based on the disease library, wherein each instruction fine-tuning data in the instruction fine-tuning data set is used to extract disease information, indicator information points corresponding to the disease information, and indicator values; based on the instruction fine-tuning data set, fine-tuning training is performed on the first preset big model to obtain the patient portrait extraction big model.

[0055] Figure 4 This is a schematic diagram of a training large model for extracting patient portraits according to an embodiment of the present application. Figure 4 As shown in FIG, the patient portrait extraction model is trained by the following method.

[0056] First, create a tree-structured disease database. The disease database is a database containing information about 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, information points might focus on blood pressure, heart rate, and calcium score.

[0057] 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 weights of information points to adapt to developments and changes in the medical field.

[0058] Next, obtain the instruction fine-tuning dataset. For example, if you need to extract the patient's calcium score from coronary CT scans for coronary heart disease, the instruction fine-tuning data would be: 1. Coronary CT scans: 'Coronary CTA: No significant atherosclerosis in the three main coronary arteries and their major branches, CAD-RADS 0; 2. Calcification score 1.4; 3. Abnormal left coronary origin and proximal course; 4. Ascending aorta tumor'. When the instruction is called to extract the calcium score, the output is {'Calcification score': '1.4'}. This instruction fine-tuning data is used to extract the calcium score.

[0059] It should be noted that the instruction fine-tuning dataset includes all diseases in the disease database. All diseases are used to construct fine-tuning data, and all fine-tuning data is used to construct the fine-tuning dataset.

[0060] Finally, select a pre-trained large-scale language model as the base model (the first pre-set large model), such as an open-source large-scale model. This model has been pre-trained on a large amount of text data and possesses basic natural language understanding and generation capabilities. Fine-tune the base model using the instruction fine-tuning dataset, with the goal of enabling the model to accurately identify and extract indicator information points and corresponding indicator values ​​for specific diseases.

[0061] During the training process, the model is gradually optimized to improve the accuracy and efficiency of information extraction. At each stage of fine-tuning training, the model's performance on the task of extracting information is evaluated. If the model has low extraction accuracy on certain information points, it is necessary to adjust the training strategy or increase the number of training samples for that information point. It is understandable that if the model is found to perform poorly on a specific type of information point (such as a rare symptom or a complex test result), the model's learning ability can be enhanced by adding more training samples for this type of information point. The newly added training samples contain as many variations and details as possible, which helps the model learn more comprehensive extraction rules. On the other hand, the training strategy can be adjusted by the following methods: 1. Re-acquire a variety of instruction fine-tuning data for the information point; 2. Reduce the capacity of training batches with low accuracy.

[0062] After sufficient fine-tuning training, if the loss between the model's output and the true value is determined to be less than a preset threshold, model fine-tuning concludes. The model is now capable of accurately extracting information from unstructured medical records for various disease types. This model becomes a large-scale patient profile extraction model, ready for application in actual medical record processing. The above steps define the key information points to be extracted for different disease types through a disease database, and fine-tune the large language model using the instruction fine-tuning dataset. The result is a large-scale deep learning model capable of efficiently and accurately extracting patient profile information from unstructured medical record text.

[0063] Step S108: Generate a large model using the medical record text to determine the medical record text that corresponds to both the medical information and the target average value.

[0064] Figure 5 This is a schematic diagram of training a large model for generating medical record text according to an embodiment of the present application, such as Figure 5 As shown in FIG, the large model for generating medical record text is trained by the following method.

[0065] Obtain a second preset large model; use pre-collected medical text data to perform incremental training on the second preset 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 based on prompt tuning (P-tuning) on ​​the medical large model, and complete the training of the second preset large model when the preset stopping conditions are met to obtain a medical record text generation large model.

[0066] Hint tuning optimizes the model's input hints to guide the model to generate outputs that better meet specific task requirements without requiring large-scale adjustments to the model's parameters. This approach effectively improves the model's performance on specific tasks while maintaining its generalization capabilities.

[0067] The goal of SFT training is to make the pre-trained model better adapt to specific tasks or fields. By performing supervised learning on labeled data, the model can learn more specific and detailed language structures and task-related knowledge.

[0068] The basic process of SFT training includes the following steps: 1. Select a pre-trained model from a large library of language models. These models are pre-trained on a large amount of text data and have a wide range of language understanding and generation capabilities.

[0069] Collect and label datasets relevant to a specific task. Labeled data consists of input text and the corresponding correct output (or label). In the medical record generation scenario, the input might be patient information and a doctor's preliminary diagnosis, while the output is the desired standardized medical record text.

[0070] The labeled dataset is fed into the pre-trained model for supervised fine-tuning. The model attempts to predict the correct output for each input, compares it with the actual labeled output, and adjusts the model parameters using optimization algorithms such as gradient descent to minimize the prediction error.

[0071] During training, regularly evaluate the model's performance on the validation dataset to ensure its generalization ability. If performance is poor, adjust parameters such as the learning rate, batch size, and number of training epochs, or add more labeled data. Continue training until the model reaches a satisfactory level of performance. After training is complete, save the fine-tuned model for practical use. This model will outperform the original pre-trained model on a specific task because it has been adapted to the specific requirements and domain knowledge of the task.

[0072] The above steps use historical medical record data for incremental training and continuously update the model, which improves the medical big model's ability to contain medical record writing-related knowledge, enabling the medical big model to better understand and generate medical texts, thereby improving the quality and acceptability of medical record texts.

[0073] Specifically, the medical record text generation big model is obtained by the following method: a second preset big model is selected from an optional pre-trained language model library, and the second preset big model is an open source big language model.

[0074] Collect a large amount of medical-related text data, including medical literature, medical records, medical reports, and drug instructions. The goal is to provide the model with a deeper understanding of the linguistic characteristics and terminology of the medical field. This medical data is used to incrementally train the second pre-trained large model, further optimizing the model's ability to understand and generate medical text based on the existing pre-training. The training process includes cleaning the medical data and converting it into a format readable by the model. Through training, the model learns specific patterns and knowledge within the medical data. Optimize training parameters such as the learning rate and batch size to accelerate training and improve model performance.

[0075] During training, the model's performance on medical text comprehension tasks, such as medical record generation and medical report interpretation, is regularly evaluated. Training strategies are adjusted based on these results until the model achieves optimal adaptability to the medical domain. Upon completion of incremental training, a large medical model is obtained, imbued with deeper medical domain knowledge and comprehension capabilities.

[0076] For example, when evaluating medical record generation capabilities, ROUGE scores can be used to assess the degree of overlap between model-generated medical records and reference medical records. Alternatively, A / B testing can be used to compare the quality of model-generated medical records with reference medical records. Humans can also use medical expertise to determine whether the generated text accurately reflects the information in the original text, conforms to medical text writing standards, and whether any important information is omitted. Furthermore, historical medical record text data is collected and organized. This data will serve as the input and target for supervised fine-tuning, and the model will learn how to generate medical record text similar to these records.

[0077] Using historical medical record text data, supervised fine-tuning training of large medical models using prompt-based fine-tuning is performed. This involves the following steps: Designing specific prompts to guide the model in generating text with a specific format or content. After the model generates text, it compares it with real historical medical records, calculates the loss function, and adjusts the model parameters through backpropagation. Preset stopping conditions can be set, such as reaching a specific metric threshold (such as BLEU score or ROUGE score), completing a preset number of training rounds, or when model performance no longer significantly improves.

[0078] Once the stopping conditions are met, the trained model becomes a large model for generating medical record text. This model not only understands medical knowledge but also learns how to generate medical record text that is correctly formatted, rich in content, and consistent with doctors' writing habits.

[0079] In summary, this application introduces a large model for generating medical record text, enabling intelligent and automated semantic understanding and generation of medical text. The resulting medical records are more accurate and realistic, meeting both physicians' writing needs and patients' individualized demands, thereby improving their quality and acceptability. Furthermore, this reduces the time and effort physicians spend compiling medical records, improving medical work efficiency and reducing information omissions and errors.

[0080] By generating a large model of medical record text, it is possible to flexibly respond to the characteristics of different patients' conditions and the personalized needs of doctors, and realize personalized medical record text generation. At the same time, the above steps S102 to S108 have high scalability, and can dynamically adjust the generated results according to actual needs, and there will be no problem of obsolete or outdated information in long-term use. In some optional embodiments of the present application, the medical record text is generated using a large model, and the medical record text corresponding to the medical information and the target average value is determined. This can be achieved by the following method: using the medical record text generation large model to analyze the medical information, the target average value and the scene prompt information, and obtain the medical record text output by the medical record text generation large model, wherein the scene prompt information includes at least one of the following: admission course, discharge course.

[0081] Figure 6 is a schematic diagram of a method for generating a medical record text according to an embodiment of the present application, such as Figure 6 As shown, the method can be implemented as follows.

[0082] First, we randomly select N medical records from Doctor A. These samples represent the doctor's specific writing style and habits. Each record is fed into a pre-trained neural network model, which extracts and encodes the doctor's writing characteristics. For each record, the model outputs a style vector. For example, for two records from Doctor A, the model outputs vectors v1 = [a1, a2, a3] and v2 = [b1, b2, b3].

[0083] 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 subsequent generation of medical record text.

[0084] Then, the patient portrait of the current patient (i.e., disease type—key information—information value) is queried in the patient portrait database as an information prompt for generating a large model for the medical record text.

[0085] Finally, the final style vector of doctor A and the patient's information prompts are combined as input to the large-scale model for generating medical record text. This means that the large-scale model for generating medical record text must not only understand the patient's basic information but also consider the doctor's writing habits and style.

[0086] The large-scale medical record text generation model generates the final medical record text based on vector instructions, information prompts, and scenario prompts. This generation process ensures that the medical record text conforms to medical standards, reflects the doctor's personalized writing style, and fully reflects the patient's specific situation.

[0087] In other optional embodiments of the present application, after generating a large model using medical record text and determining the medical record text corresponding to both the 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 the preset fields in the medical record text based on the patient's sentiment vector.

[0088] Specifically, record conversations between doctors and patients during consultations, diagnoses, and treatments. Ensure the recording equipment has good audio quality and can clearly capture the voices of both parties. Ensure that privacy policies are adhered to and that patients have explicit authorization for recording.

[0089] The collected speech data is converted into text and then fed into a pre-trained sentiment analysis model. This sentiment analysis 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 that represents the degree of different emotions, such as joy, sadness, anxiety, and calmness. The sentiment analysis model outputs one or more emotion categories and their corresponding intensity values. For example, the model might output "Anxiety: 0.7" or "Calm: 0.2," indicating that the patient is primarily anxious.

[0090] Based on the patient's emotional state, pre-set 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 is anxious, the medical record can include the doctor's concern and reassurance, such as: "The patient is quite nervous today. Psychological comfort and support have been provided. Family members are advised to spend more time with the patient." If the patient is emotionally stable, a brief mention can be made to reflect the overall assessment: "The patient is emotionally stable today and is actively cooperating with treatment."

[0091] The adjusted medical record text must be reviewed by a physician or medical team to ensure accuracy and adherence to medical ethics, avoiding overemphasis on emotion over medical facts. The medical team can modify or supplement the emotional support content as appropriate based on their expertise and the patient's actual condition. The sentiment analysis and text adjustment process should be continuously optimized. Based on physician and patient feedback, the sentiment analysis model and text adjustment strategy should be iteratively upgraded to improve the accuracy of sentiment recognition and the appropriateness of text adjustment.

[0092] Through the above steps, not only can medical records based on objective medical information and the doctor's writing style be generated, but also the understanding of the patient's emotional state and humanistic care can be incorporated into the text, so that the medical record is 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.

[0093] For example, the method for generating medical record text proposed in this application can be applied to the following scenarios: 1. Disease course generation.

[0094] (1) Admission course: Automatically generate the patient's medical record text upon admission, including the chief complaint, physical examination content after admission, cardiac ultrasound results and other information.

[0095] (2) Postoperative course of disease: Generate the patient's medical record text after surgery, including the surgical process, postoperative conditions, treatment measures, etc.

[0096] (3) Dressing change process: Automatically generate the patient's medical record text during the dressing change process, including the reason for the dressing change, specific operations, effect evaluation, etc.

[0097] (4) Discharge record: Automatically generate the patient's medical record text when he or she is discharged, including diagnosis, treatment plan, precautions, etc.

[0098] 2. Generation of current medical history of second hospitalization: Based on the patient's previous hospitalization course data, the patient's current medical history of second hospitalization is automatically generated, including chief complaint, past history, diagnosis and treatment process, etc.

[0099] 3. Surgical report generation: Automatically generate a detailed report of the surgical process, including surgical operation steps, intraoperative conditions, surgical results and other information.

[0100] Two different cases are given below. For the convenience of description, the sample data is given directly below: 1. Scenario 1: Hospitalization course.

[0101] The patient's portrait 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, no dry or wet rales; (5) general condition: no discomfort reported; (6) cardiac ultrasound: left ventricular enlargement, mitral valve regurgitation; (7) surgery: permanent pacemaker implantation.

[0102] The generated medical record text includes: The patient reported no discomfort, blood pressure 136 / 79 mmHg, clear breath sounds bilaterally with no dry or wet rales, heart rate 72 beats / min, regular rhythm, and no lower extremity edema. Echocardiography revealed left ventricular enlargement and mitral regurgitation. Chief Physician xx, Chief Physician xx, and Chief Physician xx reviewed the patient: xxx has a clear indication for permanent pacemaker implantation and no contraindications to surgery. Permanent pacemaker implantation will be performed at an elective time. Intravenous antibiotics were administered half an hour before surgery to prevent infection. Preoperative examinations were completed and surgical preparations were prepared. The patient and family were fully informed of the risks and benefits of the surgery, including possible complications such as inability to complete the procedure, intracorporeal catheter breakage, allergic reactions, severe arrhythmias, cardiovascular 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 treatment. Continued observation.

[0103] 2. Scenario 2: Postoperative course of disease.

[0104] The patient's portrait 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 results: smooth; (6) general condition: clear consciousness, no complaints of discomfort; (7) auscultation: normal heart sounds, stable breathing, no intermittent or obvious dry or wet rales in both lungs.

[0105] The generated medical record includes the following: The patient underwent a smooth procedure and returned safely to the ward. The patient is conscious and has not complained of any discomfort. Blood pressure is 140 / 75 mmHg, heart rate is 60 beats / min, rhythmic, heart sounds are normal, breathing is stable, and there are no intermittent or significant dry or wet rales in both lungs. There is no bleeding or hematoma at the puncture site, and a compression bandage is applied. An electrocardiogram shows sinus rhythm. Postoperative intravenous antibiotics are being administered. A pacemaker program and chest X-ray are scheduled, and the patient's condition is being closely monitored.

[0106] Figure 7 This is a structural diagram of a device for generating a medical record text according to an embodiment of the present application, such as Figure 7 As shown, the device includes: The receiving module 72 is used to receive multiple historical medical record texts.

[0107] The first determination module 74 is configured to determine the writing style vector corresponding to each historical medical record text using a neural network model, obtain multiple writing style vectors, and determine a target average value of the multiple writing style vectors.

[0108] The search module 76 is used to search for the patient's medical information in the patient portrait database, wherein the medical information at least includes: target disease information, target indicator information points corresponding to the target disease information, and target indicator values ​​corresponding to the target indicator information points.

[0109] The second determination module 78 is used to generate a large model using the medical record text, and determine the medical record text corresponding to the medical information and the target average value.

[0110] Optionally, the neural network model is obtained by training by the following method: inputting the first historical medical record text corresponding to the first object into the encoding and decoding module to obtain a first output result, and the encoding and 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 the comparative learning module to obtain a second output result, and the comparative learning module is used to mine the intrinsic 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 comparative learning module to obtain a third output result, and the comparative 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 the 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 meets the preset convergence condition.

[0111] Optionally, the patient portrait 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 the unstructured medical record text through a patient portrait extraction model to obtain an extraction result; merging the extraction result with the structured medical record text to obtain a patient portrait database; wherein the historical medical record text includes unstructured medical record text and structured medical record text.

[0112] Optionally, the patient portrait extraction big model is obtained by training through the following method: obtaining a disease library, wherein the disease library includes information of different diseases and indicator information points corresponding to each disease information; receiving an instruction fine-tuning data set based on the disease library, wherein each instruction fine-tuning data in the instruction fine-tuning data set is used to extract disease information, indicator information points corresponding to the disease information, and indicator values; based on the instruction fine-tuning data set, fine-tuning training is performed on the first preset big model to obtain the patient portrait extraction big model.

[0113] Optionally, the medical record text generation big model is obtained by training through the following method: obtaining a second preset big model; using pre-collected medical data, performing incremental training based on the medical field on the second preset big model to obtain a medical big model; using historical medical record text data, performing supervised fine-tuning training based on prompt tuning on the medical big model, and completing the training of the second preset big model when the preset stopping conditions are met to obtain the medical record text generation big model.

[0114] Optionally, the second determination module 78 is also used to perform the following steps: using the medical record text generation large model to analyze the medical information, target average value and scenario prompt information to obtain the medical record text output by the medical record text generation large model, wherein the scenario prompt information includes at least one of the following: admission course, discharge course.

[0115] Optionally, the device for generating medical record text is also used to generate a large model using the medical record text and determine the medical record text that corresponds to the medical information and the target average value, and then perform the following steps: collecting voice data between the doctor and the patient; analyzing the voice data using the sentiment analysis model to obtain the patient's sentiment vector; and adjusting the preset fields in the medical record text according to the patient's sentiment vector.

[0116] It should be noted that the above Figure 7 Each module in the embodiment can be a program module (for example, a set of program instructions that implement a specific function) or a hardware module. For the latter, it can be expressed in the following forms, but is not limited to this: each of the above modules is expressed in the form of a processor, or the functions of each of the above modules are implemented by a processor.

[0117] It should be noted that Figure 7 The preferred implementation of the embodiment shown can be found in Figure 1 The relevant description of the illustrated embodiment will not be repeated here.

[0118] Figure 8 The hardware structure block diagram of a computer terminal for implementing a method for generating medical record text is shown in FIG. Figure 8 As shown, the computer terminal 80 may include one or more processors 802 (illustrated as 802a, 802b, ..., 802n) (the 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 the 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 only for illustration and does not limit the structure of the above electronic device. Figure 8 More or fewer components than shown, or with Figure 8 Different configurations shown.

[0119] It should be noted that the one or more processors 802 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be fully or partially integrated into any of the other components of the computer terminal 80. As discussed in the embodiments of the present application, the data processing circuitry functions as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0120] 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 method for generating medical record text in the embodiment of the present application. The processor 802 executes various functional applications and data processing by running the software programs and modules stored in the memory 804, that is, implementing the above-mentioned method for generating medical record text. The memory 804 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 804 may further include a memory remotely located relative to the processor 802, and these remote memories may be connected to the computer terminal 80 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0121] Transmission module 806 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of computer terminal 80. In one embodiment, transmission module 806 includes a network interface controller (NIC), which can connect to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission module 806 may be a radio frequency (RF) module, configured to communicate with the Internet wirelessly.

[0122] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 80 .

[0123] It should be noted that, in some optional embodiments, the above Figure 8 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. Figure 8 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.

[0124] It should be noted that Figure 8 The computer terminal shown is used to execute Figure 1 The method for generating the medical record text shown in the figure, therefore, the relevant explanations in the method for executing the above command also apply to the electronic device and will not be repeated here.

[0125] An embodiment of the present application further provides a non-volatile storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above method for generating medical record text.

[0126] A program for a non-volatile storage medium to perform the following functions: receiving a plurality of historical medical record texts; determining a writing style vector corresponding to each historical medical record text using a neural network model, obtaining a plurality of writing style vectors, and determining a target average value of the plurality of writing style vectors; searching for the patient's medical information in a patient portrait 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; generating a large model using the medical record texts, and determining the medical record texts corresponding to both the medical information and the target average value.

[0127] An embodiment of the present application further provides an electronic device, comprising: a memory and a processor, wherein the processor is configured to run a program stored in the memory, wherein the above method for generating a medical record text is executed when the program is run.

[0128] 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 a target average value of the multiple writing style vectors; searching for the patient's medical information in a patient portrait 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; using the medical record text to generate a large model, and determining the medical record text corresponding to the medical information and the target average value.

[0129] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0130] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0131] In the above-mentioned embodiments of the present application, the collected information 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 comply with relevant laws, regulations and standards, take necessary protection measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0132] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0133] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0134] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0135] If the integrated unit is implemented in the form of 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 the present application, or the part that contributes to the relevant technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program code.

[0136] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for generating a medical record text, characterized in that: include: receiving multiple historical medical record texts; Determining a writing style vector corresponding to each of the historical medical record texts using a neural network model to obtain a plurality of the writing style vectors, and determining a target average value of the plurality of the writing style vectors; Searching for the patient's medical information in a patient portrait 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 texts to determine medical record texts that correspond to both the medical information and the target average value.

2. The method according to claim 1, characterized in that The neural network model is obtained by training using the following method: Inputting a first historical medical record text corresponding to the first object into a coding and decoding module to obtain a first output result, wherein the coding and decoding module is used to extract information from the first historical medical record text; Inputting a second historical medical record text corresponding to the first object into a comparative learning module to obtain a second output result, wherein the comparative learning module is used to mine the intrinsic structure and semantic information of the second historical medical record text; inputting a third historical medical record text corresponding to the second object into the comparative learning module to obtain a third output result, wherein the comparative learning module is further configured to learn structural and semantic differences between the third historical medical record text and the second historical medical record text; A loss function is determined based on the first output result, the second output result, and the third output result, and the training of the neural network model is completed when the loss function meets a preset convergence condition.

3. The method according to claim 1, characterized in that The patient portrait database is constructed by the following method: Receive data extraction instructions; Based on the data extraction instruction, extract the content indicated by the data extraction instruction from the unstructured medical record text through the patient portrait extraction model to obtain an extraction result; Merging the extraction results with the structured medical record text to obtain the patient portrait database; The historical medical record text includes the unstructured medical record text and the structured medical record text.

4. The method according to claim 3, characterized in that The patient portrait extraction model is trained by the following method: Obtaining a disease database, wherein the disease database includes information on different diseases and indicator information points corresponding to each disease information; receiving an instruction fine-tuning data set based on the disease database, wherein each instruction fine-tuning data in the instruction fine-tuning data set is used to extract the disease information, the indicator information point corresponding to the disease information, and the indicator value; Based on the instruction fine-tuning data set, the first preset large model is fine-tuned and trained to obtain a patient portrait extraction large model.

5. The method according to claim 1, wherein The medical record text generation model is trained by the following method: Get the second preset large model; Using pre-collected medical data, perform incremental training based on the medical field on the second preset large model to obtain a medical large model; The medical big model is trained with supervised fine-tuning based on prompt tuning using historical medical record text data, and the training of the second preset big model is completed when the preset stop condition is met to obtain the medical record text generation big model.

6. The method according to claim 1, characterized in that Generating a large model using medical record text to determine the medical record text corresponding to the medical information and the target average value includes: The medical record text generation model is used to analyze the medical information, the target average value and the scenario prompt information to obtain the medical record text output by the medical record text generation model, wherein the scenario prompt information includes at least one of the following: admission course of illness and discharge course of illness.

7. The method according to claim 1, characterized in that After generating a large model using medical record text and determining the medical record text corresponding to both the medical information and the target average value, the method further includes: Collect voice data between doctors and patients; Analyzing the speech data using a sentiment analysis model to obtain the patient's sentiment vector; According to the patient's emotion vector, preset fields in the medical record text are adjusted.

8. A device for generating medical record text, characterized in that: include: A receiving module, used for receiving multiple historical medical record texts; A first determination module is configured to determine a writing style vector corresponding to each of the historical medical record texts using a neural network model, obtain a plurality of the writing style vectors, and determine a target average value of the plurality of the writing style vectors; A search module is used to search for the patient's medical information in the patient portrait 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; The second determination module is used to generate a large model using medical record texts, and determine the medical record texts corresponding to the medical information and the target average value.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the method for generating a medical record text according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program, when running, executes the method for generating a medical record text according to any one of claims 1 to 7.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating a medical record text according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Medical record generation method and system, storage medium and electronic equipment

    CN115458113A

  • Similar case matching system and method based on historical case information

    CN117854734A

  • Generation method and generation apparatus of medical report

    US20250118402A1

  • Method for generating mathematical models of a patient using artificial intelligence technologies

    WO2019132686A1