Structured Chinese electronic medical record generation method, system and device and storage medium
Through three-stage training strategies and inference output optimization technology, the accuracy and efficiency of generating structured Chinese electronic medical records in the existing technology are solved, efficient automatic sorting and analysis of medical data is achieved, and good generalization capabilities and privacy security protection are provided.
Patent Information
- Application Number
- CN202510205334.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2045-02-24
AI Technical Summary
The prior art is difficult to accurately generate structured Chinese electronic medical records, especially when processing complex semantics and long texts. The generalization ability is insufficient and it is difficult to meet the needs of automated collation and analysis of medical data.
The base model is trained using a three-stage training strategy. The first stage is pre-trained using the Chinese corpus, the second stage is fine-tuned using the Chinese medical data set, and the third stage is fine-tuned using real structured data combined with low rank weight decomposition. In the inference output optimization stage, information extraction and reconstruction is performed through hierarchical analysis, semantic retrieval and thinking chain technology, combined with medical background knowledge and structured medical records.
It significantly improves the accuracy and efficiency of information extraction, improves the value of automated collation and analysis of medical data, reduces the cost of manual intervention, and has good zero-sample generalization capabilities and privacy and security protection characteristics.
Smart Images

Figure CN119694472A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of structured electronic medical record information generation, and in particular to a structured Chinese electronic medical record generation method, system, device and storage medium. Background Art
[0002] Structured Chinese electronic medical record generation technology is an important research direction in the intersection of medical informationization and artificial intelligence. With the development of information technology, electronic medical record systems have gradually replaced traditional paper medical records and become an indispensable part of modern medical services. Structured electronic medical records not only improve the storage, retrieval and analysis efficiency of medical data, but also provide valuable data resources for clinical decision support, medical research and public health management. Since Chinese is a semantically rich and grammatically flexible language, this increases the difficulty of applying natural language processing (NLP) technology to Chinese electronic medical records.
[0003] There are three main methods for structuring electronic medical records: (1) NLP electronic medical record structuring methods based on statistical methods: Traditional electronic medical record structuring methods are mainly based on statistical methods, including word frequency analysis, hidden Markov model (HMM), conditional random field (CRF), etc. These methods construct the grammatical and semantic relationships of the text through statistical analysis of features such as vocabulary and phrases. For example, using CRF for named entity recognition (NER) of medical entities is a classic method. However, it is difficult to handle complex semantics, the model capability depends on artificial feature engineering, the generalization ability is insufficient, and it performs poorly for long texts and problems with weak context relevance. Therefore, it is difficult to accurately generate structured Chinese electronic medical records.
[0004] (2) Electronic medical record structuring methods based on deep learning models: With the development of deep learning, the structuring of electronic medical records has gradually shifted to neural network models, including convolutional neural networks (CNNs), long short-term memory networks (LSTMs), attention mechanisms, and Transformer-based models. These methods use a large amount of annotated data in medical texts to extract medical information through supervised learning. The combination of bidirectional LSTM and CRF for medical entity recognition and relationship extraction in electronic medical records can effectively improve the model's extraction capabilities. The BERT model (bidirectional encoder representation model) based on Transformer (transformer neural network) is also widely used in the medical field. However, the mastery of domain knowledge is limited, so it is difficult to accurately generate structured Chinese electronic medical records. An example of a literature on this type of method is: Chinese invention patent application with publication number CN118095285A "A method and system for electronic medical record named entity recognition based on deep learning".
[0005] (3) Electronic medical record structuring method based on large language model: In recent years, methods based on large language models have gradually been applied to the structuring of electronic medical records. Through large-scale pre-training, large language models have strong language understanding and generation capabilities. However, when calling API interfaces (application programming interfaces) in the medical field, there are data privacy and security issues. In addition, due to the uniqueness of Chinese and its complex semantic expression, the performance of this method needs to be improved. An example of a literature on this type of method is: Chinese invention patent application with publication number CN119127979A, "A method for structuring electronic medical records based on a large language model." Summary of the invention
[0006] The purpose of the present invention is to provide a structured Chinese electronic medical record generation method, system, device and storage medium, which can significantly improve the accuracy and efficiency of information extraction, accurately generate structured Chinese electronic medical records, reduce the cost of manual intervention, and improve the efficiency of automatic organization of medical data and the value of data analysis.
[0007] The objective of the present invention is achieved through the following technical solutions: A structured Chinese electronic medical record generation method, comprising: Model training: A three-stage training strategy is used to train the selected base model. In the first stage, the Chinese corpus is used for pre-training. In the second stage, the Chinese medical dataset is used for full fine-tuning training. In the third stage, the real structured data used in the project is combined with the low-rank weight decomposition fine-tuning technology for fine-tuning training. Reasoning output optimization: Use the trained base model to perform hierarchical analysis on the input original Chinese medical record text to obtain several structured paragraphs; encode the original Chinese medical record text and the content in the medical record knowledge document library into a shared semantic space, and use the semantic retrieval model to query the medical background knowledge or medical record structured examples that are most relevant to the original Chinese medical record text from the medical record knowledge document library as contextual prompts; use the thinking chain technology and contextual prompts to guide the trained base model to extract information from each structured paragraph and reconstruct a structured Chinese electronic medical record.
[0008] A structured Chinese electronic medical record generation system, comprising: A model training unit, used for model training, wherein the model training includes: training the selected base model using a three-stage training strategy, wherein the first stage uses a Chinese corpus for pre-training, the second stage uses a Chinese medical data set for full fine-tuning training, and the third stage uses the real structured data used in the project combined with a low-rank weight decomposition fine-tuning technology for fine-tuning training; The inference output optimization unit is used for inference output optimization, and the inference output optimization includes: using the trained base model to perform hierarchical analysis on the input original Chinese medical record text to obtain a number of structured paragraphs; encoding the original Chinese medical record text and the content in the medical medical record knowledge document library into a shared semantic space, and querying the medical background knowledge or medical record structured examples most relevant to the original Chinese medical record text from the medical medical record knowledge document library through the semantic retrieval model as context prompts; through the thinking chain technology, combined with the context prompts, guiding the trained base model to extract information from each structured paragraph respectively, and reconstructing a structured Chinese electronic medical record.
[0009] A processing device, comprising: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method.
[0010] A readable storage medium stores a computer program, which implements the above method when the computer program is executed by a processor.
[0011] It can be seen from the technical solution provided by the present invention that the present invention uses the base model for structured extraction of Chinese electronic medical records. The designed series of professional knowledge enhancement training (i.e., three-stage training strategy) and reasoning optimization strategy can help the base model to accurately realize the automated structured output of electronic medical record information. The comparative experiment shows that the solution of the present invention improves the average accuracy of the baseline model from 78.4% to 85.3%, significantly surpassing the traditional electronic medical record structured solution based on the BERT model, and has good zero-sample generalization ability. Compared with the large model of commercial applications, the solution of the present invention has the characteristics of autonomous and controllable iterative development, good privacy and security protection characteristics and low-cost advantages. The solution of the present invention can be deployed in the digital medical intelligent system to realize the large-scale batch Chinese electronic medical record structured extraction requirements, and can also be embedded in the intelligent medical record auxiliary consultation system to realize the automated extraction of electronic medical record information, promote the robotic automation process of medical electronic medical records, and improve the work efficiency of medical staff in handling electronic medical records. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0013] Figure 1A flow chart of a structured Chinese electronic medical record generation method provided by an embodiment of the present invention; Figure 2 A schematic diagram of a structured Chinese electronic medical record generation method provided by an embodiment of the present invention; Figure 3 A schematic diagram showing the visualization results of the accuracy of the model provided by an embodiment of the present invention on a self-built validation set as a function of the number of training rounds; Figure 4 A schematic diagram showing the visualization results of the accuracy of the model provided by an embodiment of the present invention on a self-built validation set as a function of the number of training rounds; Figure 5 A schematic diagram showing the visualization results of the recall rate of the model provided in an embodiment of the present invention on a self-built validation set as a function of the number of training rounds; Figure 6 A schematic diagram showing the visualization results of the F1 score of the model provided by an embodiment of the present invention on a self-built validation set as a function of the number of training rounds; Figure 7 A schematic diagram of the visualization results of the F1 score on the self-built validation set according to the training data ratio provided by an embodiment of the present invention; Figure 8 A schematic diagram of a structured Chinese electronic medical record generation system provided by an embodiment of the present invention; Fig. 9 A schematic diagram of a processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The following is a clear and complete description of 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 of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0015] First, the terms that may be used in this article are explained as follows: The terms "include", "comprises", "contains", "has" or other descriptions with similar semantics should be interpreted as non-exclusive inclusion. For example, including certain technical feature elements (such as raw materials, components, ingredients, carriers, dosage forms, materials, dimensions, parts, components, mechanisms, devices, steps, procedures, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products or products, etc.) should be interpreted as including not only certain technical feature elements explicitly listed, but also other technical feature elements known in the art that are not explicitly listed.
[0016] The term "consisting of..." means excluding any technical feature elements not explicitly listed. If this term is used in a claim, it will make the claim closed, so that it does not contain technical feature elements other than those explicitly listed, except for conventional impurities related to them. If this term only appears in a clause of a claim, it only limits the elements explicitly listed in that clause, and the elements recorded in other clauses are not excluded from the overall claim.
[0017] The following is a detailed description of a structured Chinese electronic medical record generation method, system, device and storage medium provided by the present invention. The contents not described in detail in the embodiments of the present invention belong to the prior art known to professional and technical personnel in the field. If no specific conditions are specified in the embodiments of the present invention, they are carried out according to the conventional conditions in the field or the conditions recommended by the manufacturer. The instruments used in the embodiments of the present invention, if the manufacturer is not specified, are all conventional products that can be purchased commercially.
[0018] Embodiment 1 The embodiment of the present invention provides a structured Chinese electronic medical record generation method, such as Figure 1 As shown, it mainly includes the following steps: Step 1: Model training based on the three-stage training strategy.
[0019] In an embodiment of the present invention, a three-stage training strategy is adopted to train the selected base model. The first stage uses the Chinese corpus for pre-training, the second stage uses the Chinese medical data set for full fine-tuning training, and the third stage uses the real structured data used in the project combined with the low-rank weight decomposition fine-tuning technology for fine-tuning training.
[0020] In an embodiment of the present invention, the second stage fine-tunes the pre-trained model obtained in the first stage to enhance the model's understanding of the medical field language. The third stage uses high-quality real structured data to enable the trained base model to better complete the task of generating structured Chinese electronic medical records.
[0021] Those skilled in the art can understand that the foundation model is an industry term in the field of artificial intelligence and machine learning, and usually refers to a large language model (LLM) pre-trained on a large amount of general data. For example, the foundation model of the present invention can select Qwen2-7B, where Qwen is the model name, 2 represents the second-generation model, and 7B represents that the model has 7 billion parameters; of course, other large language models can also be selected as the foundation model as needed, and the present invention does not limit the specific type of the foundation model.
[0022] Step 2: Reasoning output optimization phase based on retrieval-augmented generation (RAG) and chain of thought (CoT).
[0023] In an embodiment of the present invention, the trained base model performs hierarchical analysis on the input original Chinese medical record text to obtain a number of structured paragraphs, and combines retrieval enhancement technology to achieve high-accuracy, more fine-grained electronic structured case generation. The original Chinese medical record text and the content in the medical medical record knowledge document library are encoded into a shared semantic space, and the medical background knowledge or medical record structured examples most relevant to the original Chinese medical record text are queried from the medical medical record knowledge document library through the semantic retrieval model as contextual prompts. The retrieved contextual prompts will guide the trained base model to extract information from each structured paragraph separately through the thinking chain technology, and finally reconstruct the structured Chinese electronic medical record based on the extracted information.
[0024] Preferably, in the reasoning output optimization, the original Chinese medical record text and the medical record knowledge document library are embedded into the shared space through the semantic vector model BGE, and the Retriever-Reader architecture is introduced. Retriever represents the retriever, which is used to retrieve relevant documents from the medical record knowledge document library through the displayed query matching degree. Reader represents the reader, which is used to extract medical background knowledge from the retrieved relevant documents.
[0025] In order to more clearly demonstrate the technical solution and technical effects provided by the present invention, the method provided by the embodiment of the present invention is described in detail with reference to specific embodiments below.
[0026] In this embodiment, Qwen2-7B is used as the base model, and the original medical record text of ectopic pregnancy-related diseases in the field of Chinese obstetrics and gynecology is taken as an example to introduce the automated structured output scheme of electronic medical record information. The goal of this scheme is to automatically extract key information from the original medical record text, for example, including but not limited to: patient's basic personal information, medical history, number of cesarean sections, progesterone levels, HCG levels and other medical information. Through the structured output capability of the base model, the accuracy and efficiency of information extraction can be significantly improved, the cost of manual intervention can be reduced, and the efficiency of automated organization of medical data for ectopic pregnancy-related diseases and the value of data analysis can be improved. This scheme mainly consists of two parts: a three-stage training strategy and reasoning output optimization based on retrieval enhancement generation (RAG) and chain of thought (CoT). Figure 2 The overall process is shown.
[0027] 1. Three-stage training strategy.
[0028] (1) The first stage: pre-training stage.
[0029] The base model is pre-trained based on a large-scale Chinese corpus to enable it to master extensive Chinese language knowledge and basic language comprehension capabilities. During the pre-training phase, the Chinese medical corpus ChiMed and ChiMST, and the Chinese electronic medical record entity recognition dataset (CCKS17-CCKS20) are mainly used to warm up the knowledge related to the medical record field.
[0030] like Figure 2 As shown in the figure, in this stage, the next language unit (NextToken) is predicted and output based on the current input text (Text). The loss function is constructed based on the difference between the predicted result and the actual result contained in the training data (that is, the real next language unit is used as supervision information) to perform model training.
[0031] (2) The second stage: external data fine-tuning stage.
[0032] Based on the pre-trained model, the model is further fine-tuned using a public Chinese medical dataset to enhance the model's understanding of medical language, especially common terms and diagnostic processes in obstetrics and gynecology. In this stage, the present invention screens out gynecological medical record-related content data from the Chinese medical question-answering dataset CMedQA, the Chinese electronic medical record named entity recognition dataset Yidu-S4k, and the Chinese medical question-answering dataset, and performs full fine-tuning training on the pre-trained base model.
[0033] like Figure 2 As shown, in this stage, the questions in the training data are input into the pre-trained model, and the prompts for answering the questions are used as instructions to guide the pre-trained model to predict the answers to the questions. The loss function is constructed based on the difference between the predicted results and the actual results contained in the training data, and the model parameters are fully fine-tuned.
[0034] (3) The third stage: project data fine-tuning stage.
[0035] Combined with the high-quality real gynecological and obstetric ectopic pregnancy medical records collected in the project, targeted and efficient parameter fine-tuning is performed. For example, 1.2k high-quality data were collected in the experiment. In the case of small-scale training data, the present invention can use low-rank weight decomposition (LoRA) fine-tuning technology to enable the model to adapt to specific data distribution and task requirements, especially specific disease description and feature extraction tasks related to ectopic pregnancy.
[0036] like Figure 2 As shown in the figure, similarly, this stage also involves similar problems and instructions, which guide the model trained in the second stage to predict the structured Chinese electronic medical records (structured output), construct a loss function based on the difference between the predicted results and the actual results contained in the training data, and fine-tune the model parameters.
[0037] Considering that the specific training (fine-tuning) process of each stage can be implemented by referring to conventional technology, only some exemplary descriptions are provided below. Anything not described in detail can refer to conventional technology and will not be elaborated in the present invention.
[0038] In this embodiment, the pre-training stage (i.e., the first stage) uses cross entropy loss as the loss function to guide the entire training process. The AdamW optimizer (Adam optimizer with weight decay) is used, with hyperparameter β1=0.9, hyperparameter β2=0.999, and weight_decay=0.01. Using a linear warm-up learning rate strategy, the learning rate increases linearly from 1e-5 to 5e-4 and gradually decays after 10% of the training progress. The single-card batch size (Batch Size) is set to 64, and the gradient accumulation is set to 2 to speed up the training while maintaining good convergence. In order to reduce video memory consumption and speed up training, FP16 (half-precision floating point) mixed precision training is used. In addition, the gradient clipping value is set to 1.0 to avoid gradient explosion. Hardware configuration: Use multi-GPU (graphics processing unit) distributed training (8 48GB GPUs) and use distributed data parallel strategy to accelerate training. In the second and third stages based on full fine-tuning and LoRA fine-tuning, the initial value of the learning rate is set to 5e-5, the AdamW optimizer is used, the hyperparameter β1=0.9, the hyperparameter β2=0.999, weight_decay=0.01, and the learning rate scheduler uses linear warm-up (5% of the total number of steps) and then gradually decays. The batch size of a single card is set to 64, the gradient accumulation is set to 2, and the rank in the LoRA parameters is set to 16 and the Alpha parameter is set to 32. Furthermore, in the third stage of internal project data fine-tuning, data enhancement strategies for data rewriting and data amplification are designed to improve the training effect of this stage.
[0039] 2. Reasoning output optimization part.
[0040] In order to further enhance the model's knowledge of the professional field of medical records in the reasoning stage, the present invention constructs a medical record knowledge document library (external knowledge library) and uses retrieval enhancement generation and thinking chain prompting technology to assist in the optimization of medical record structured output in the reasoning stage.
[0041] Taking the original medical record text of ectopic pregnancy-related diseases in the field of obstetrics and gynecology in Chinese as an example, in order to achieve the above goals, we first build an external knowledge base of obstetrics and gynecology medical records (i.e., medical medical record knowledge document base), extract obstetrics and gynecology-related professional knowledge documents from the China Clinical Guidelines Database (CCGD), and select a part of representative annotated data from the project training data to provide additional medical background knowledge for the model. By collecting external knowledge bases in advance, we can provide the model with additional medical background knowledge and similar medical record samples to be extracted from the structure, assisting the model in context understanding and reasoning, thereby improving the accuracy of structured information extraction.
[0042] The main technical details involved in this section include: (1) Reconstruction of medical record description based on the big model: For the input original medical record text, a hierarchical parsing method based on the Qwen big model is used to divide the medical record text into different structured paragraphs (such as personal information, chief complaint, current medical history, etc.) according to semantic granularity, and information is extracted separately.
[0043] (2) Vector embedding module: The FlagEmbedding model is used to embed the electronic medical record queries and external professional knowledge documents to be structured into a shared space, and the retrieval effect is improved through explicit query matching. It is suitable for processing complex semantics in medical record text.
[0044] (3) Retriever-Reader architecture: This architecture combines the Retriever (retrieval machine) and the Reader (reader). The Retriever is used to find relevant documents from the medical record knowledge document library, and the Reader extracts the required information from these documents. For example, the BERT model or the RoBERTa model (improved BERT model) can be used as the basis for the Retriever-Reader architecture.
[0045] (4) RAG strategy: Retrieval-augmented generation (RAG) locates the most relevant Top-K Chunks in the medical record knowledge document library through vector retrieval, and introduces the relevant Chunks into the instruction prompts of the large model input; the text content in the medical record knowledge document library will be pre-divided into multiple semantic unit blocks for encoding and storage in advance. The Chunks here are semantic unit blocks, and the Top-K Chunks refer to the first K semantic unit blocks with the highest query matching degree. The specific value of K here can be set according to actual conditions or experience. They can help the structured extraction stage and improve the generation quality, thereby achieving better results in the extraction of medical record information. In addition to retrieving and locating external professional terminology knowledge, the most relevant medical record structured examples will be retrieved from the medical record knowledge document library as thought chain prompt samples. Through the strategy of injecting a few-sample thought chain, the structured extraction capability of unseen electronic medical records can be further improved.
[0046] In order to illustrate the performance of the above scheme of the present invention, a verification evaluation was carried out on the self-built evaluation benchmark data. The evaluation index adopted the accuracy index. The accuracy of structured information extraction on numerical indicators reached 83.7%, and the accuracy of structured information on non-numerical indicators reached 91.4%. The performance evaluation of the present invention on the test data is detailed in Tables 1 and 2.
[0047] Table 1 Performance evaluation of electronic medical record information extraction based on numerical indicators
[0048] Table 2 Performance evaluation of electronic medical record information extraction based on non-numerical indicators
[0049] also, Figure 3~Figure 7 is the visualization result of the verification set accuracy in the training process of the present invention, where: Figure 3~Figure 6 In order: the model's accuracy (Accuracy), precision (Precision), recall (Recall), and F1 score visualization results with the training rounds on the self-built validation set; Figure 7 Visualize the F1 score on the self-built validation set as a function of the training data ratio.
[0050] In the above-mentioned scheme provided by the embodiment of the present invention, the base model is used for structured extraction of Chinese electronic medical records. The designed series of professional knowledge enhancement training and reasoning optimization strategies can help the base model to accurately realize the automated structured output of electronic medical record information. The scheme of the present invention improves the average accuracy of the baseline model (i.e., the "base model" that has not undergone the three-stage training of the present invention) from 78.4% to 85.3%, significantly surpassing the traditional BERT model-based electronic medical record structured scheme, and has good zero-sample generalization ability. Compared with the large model of commercial applications, the scheme of the present invention has the characteristics of autonomous and controllable iterative development, good privacy and security protection characteristics and low-cost advantages. The scheme of the present invention can be deployed in digital medical intelligent systems to meet the needs of large-scale batch Chinese electronic medical record structured extraction, and can also be embedded in the intelligent medical record auxiliary consultation system to realize automated electronic medical record information extraction, promote the robotic automation process of medical electronic medical records, and improve the work efficiency of medical staff in handling electronic medical records.
[0051] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by means of software plus necessary general hardware platforms. Based on such understanding, the technical solutions of the above embodiments can be embodied in the form of software products, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0052] Embodiment 2 The present invention also provides a structured Chinese electronic medical record generation system, which is mainly used to implement the method provided in the above embodiment, such as Figure 8 As shown, the system mainly includes: A model training unit, used for model training, wherein the model training includes: training the selected base model using a three-stage training strategy, wherein the first stage uses a Chinese corpus for pre-training, the second stage uses a Chinese medical data set for full fine-tuning training, and the third stage uses the real structured data used in the project combined with a low-rank weight decomposition fine-tuning technology for fine-tuning training; The inference output optimization unit is used for inference output optimization, and the inference output optimization includes: using the trained base model to perform hierarchical analysis on the input original Chinese medical record text to obtain a number of structured paragraphs; encoding the original Chinese medical record text and the content in the medical medical record knowledge document library into a shared semantic space, and querying the medical background knowledge or medical record structured examples most relevant to the original Chinese medical record text from the medical medical record knowledge document library through the semantic retrieval model as context prompts; through the thinking chain technology, combined with the context prompts, guiding the trained base model to extract information from each structured paragraph respectively, and reconstructing a structured Chinese electronic medical record.
[0053] Preferably, the first stage uses a Chinese corpus for pre-training, including: the Chinese corpus used includes: Chinese medical corpora ChiMed and ChiMST, and Chinese electronic medical record entity recognition datasets (CCKS17-CCKS20); during the pre-training process, the base model predicts and outputs the next language unit based on the current input text, and uses the actual next language unit as supervision information to construct a loss function to guide the entire pre-training process.
[0054] Preferably, the second stage uses Chinese medical datasets for full fine-tuning training, including: the Chinese medical datasets used include: Chinese medical question and answer dataset CMedQA, Chinese electronic medical record named entity recognition dataset Yidu-S4k and Chinese medical question and answer dataset; screening out case-related content data from relevant datasets, and performing full fine-tuning training on the pre-trained base model.
[0055] Preferably, in the reasoning output optimization, the original Chinese medical record text and the medical record knowledge document library are embedded into a shared space through a semantic vector model, and a Retriever-Reader architecture is introduced. Retriever represents a retriever, which is used to retrieve relevant documents from the medical record knowledge document library through the displayed query matching degree. Reader represents a reader, which is used to extract medical background knowledge from the retrieved relevant documents.
[0056] Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.
[0057] Embodiment 3 The present invention also provides a processing device, such as Fig. 9As shown, it mainly includes: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the methods provided in the aforementioned embodiments.
[0058] Furthermore, the processing device also includes at least one input device and at least one output device; in the processing device, the processor, the memory, the input device, and the output device are connected via a bus.
[0059] In the embodiment of the present invention, the specific types of the memory, input device and output device are not limited; for example: The input device may be a touch screen, an image acquisition device, a physical button or a mouse, etc.; The output device may be a display terminal; The memory may be a random access memory (RAM) or a non-volatile memory such as a disk storage.
[0060] Embodiment 4 The present invention also provides a readable storage medium storing a computer program, which implements the method provided in the above embodiment when the computer program is executed by a processor.
[0061] In the embodiment of the present invention, the readable storage medium as a computer-readable storage medium can be set in the aforementioned processing device, for example, as a memory in the processing device. In addition, the readable storage medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk, etc., which can store program codes.
[0062] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. The information disclosed in the background technology section of this article is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as an admission or in any form that the information constitutes prior art known to those skilled in the art.
Claims
1. A method for generating structured Chinese electronic medical records, characterized in that: include: Model training: A three-stage training strategy is used to train the selected base model. In the first stage, the Chinese corpus is used for pre-training. In the second stage, the Chinese medical dataset is used for full fine-tuning training. In the third stage, the real structured data used in the project is combined with the low-rank weight decomposition fine-tuning technology for fine-tuning training. Reasoning output optimization: Use the trained base model to perform hierarchical analysis on the input original Chinese medical record text to obtain several structured paragraphs; encode the original Chinese medical record text and the content in the medical record knowledge document library into a shared semantic space, and use the semantic retrieval model to query the medical background knowledge or medical record structured examples that are most relevant to the original Chinese medical record text from the medical record knowledge document library as contextual prompts; use the thinking chain technology and contextual prompts to guide the trained base model to extract information from each structured paragraph and reconstruct a structured Chinese electronic medical record.
2. A structured Chinese electronic medical record generation method according to claim 1, characterized in that: The first stage uses the Chinese corpus for pre-training, including: The Chinese corpora used include: Chinese medical corpus and Chinese electronic medical record entity recognition dataset; During the pre-training process, the base model predicts the output of the next language unit based on the current input text, and uses the actual next language unit as supervision information to construct a loss function to guide the entire pre-training process.
3. A structured Chinese electronic medical record generation method according to claim 1, characterized in that: The second phase uses the Chinese medical dataset for full fine-tuning training, including: The Chinese medical datasets used include: Chinese medical question and answer dataset, Chinese electronic medical record named entity recognition dataset, and Chinese medical question and answer dataset; Filter case-related content data from the Chinese medical dataset and perform full-scale fine-tuning training on the pre-trained base model.
4. A structured Chinese electronic medical record generation method according to claim 1, characterized in that: In the reasoning output optimization, the original Chinese medical record text and the medical record knowledge document library are embedded into the shared space through the semantic vector model, and the Retriever-Reader architecture is introduced. Retriever represents the retriever, which is used to retrieve relevant documents from the medical record knowledge document library through the displayed query matching degree. Reader represents the reader, which is used to extract medical background knowledge from the retrieved relevant documents.
5. A structured Chinese electronic medical record generation system, characterized in that: include: A model training unit, used for model training, wherein the model training includes: training the selected base model using a three-stage training strategy, wherein the first stage uses a Chinese corpus for pre-training, the second stage uses a Chinese medical data set for full fine-tuning training, and the third stage uses the real structured data used in the project combined with a low-rank weight decomposition fine-tuning technology for fine-tuning training; The inference output optimization unit is used for inference output optimization, and the inference output optimization includes: using the trained base model to perform hierarchical analysis on the input original Chinese medical record text to obtain a number of structured paragraphs; encoding the original Chinese medical record text and the content in the medical medical record knowledge document library into a shared semantic space, and querying the medical background knowledge or medical record structured examples most relevant to the original Chinese medical record text from the medical medical record knowledge document library through the semantic retrieval model as context prompts; through the thinking chain technology, combined with the context prompts, guiding the trained base model to extract information from each structured paragraph respectively, and reconstructing a structured Chinese electronic medical record.
6. A structured Chinese electronic medical record generation system according to claim 5, characterized in that: The first stage uses the Chinese corpus for pre-training, including: The Chinese corpora used include: Chinese medical paper dataset, Chinese electronic medical record data, and medical entity recognition dataset; During the pre-training process, the base model predicts the output of the next language unit based on the current input text, and uses the actual next language unit as supervision information to construct a loss function to guide the entire pre-training process.
7. A structured Chinese electronic medical record generation system according to claim 5, characterized in that: The second phase uses the Chinese medical dataset for full fine-tuning training, including: The Chinese medical datasets used include: Chinese medical question answering dataset CMedQA, Chinese electronic medical record named entity recognition dataset Yidu-S4k, and Chinese medical question answering dataset; Content data related to cases is selected from the Chinese medical question-answering dataset CMedQA, the Chinese electronic medical record named entity recognition dataset Yidu-S4k, and the Chinese medical question-answering dataset, and the pre-trained base model is fully fine-tuned.
8. A structured Chinese electronic medical record generation system according to claim 5, characterized in that: In the reasoning output optimization, the original Chinese medical record text and the medical record knowledge document library are embedded into the shared space through the semantic vector model, and the Retriever-Reader architecture is introduced. Retriever represents the retriever, which is used to retrieve relevant documents from the medical record knowledge document library through the displayed query matching degree. Reader represents the reader, which is used to extract medical background knowledge from the retrieved relevant documents.
9. A processing device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Electronic medical record named entity identification method and system based on deep learning
CN118095285A
Electronic medical record structuring method based on large language model
CN119127979A
Method for extracting post-structured information of Chinese electronic medical record
CN114420233A
Multi-granularity information processing method and device based on electronic medical record
CN117235582A
Outpatient service electronic medical record generation method based on Chinese medical big model
CN117253576A
Cited By
Chinese demand normalization method based on large language model and EARS normal form
CN120704646A
Cognitive reconstruction psychological intervention system and device based on large language model
CN121328740A
Gynecological and obstetric information processing method and system based on Internet
CN121439065A