A medical record semantic understanding method, device, equipment, medium and product

By introducing prompt word templates and control conditions into the medical record semantic understanding system, the training model follows detailed control conditions, which solves the problem of insufficient stability and controllability of generative large language models in medical record semantic understanding, and achieves efficient and reliable medical record semantic understanding.

CN119808791BActive Publication Date: 2025-12-05TSINGHUA UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411954620.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-12-05
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

Existing medical record semantic understanding systems based on generative large language models suffer from insufficient stability and controllability in practical applications, making it difficult to provide consistent and reliable output under constantly changing semantic understanding requirements.

Method used

By introducing cue word templates, including task descriptions, control conditions, and medical record text, into the training dataset, a medical record semantic understanding model is trained to follow detailed control conditions, ensuring the consistency and accuracy of the output results.

Benefits of technology

It improves the stability and controllability of medical record semantic understanding, ensuring that the model maintains high consistency and reliability in diverse application scenarios and outputs high-quality parsing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808791B_ABST
    Figure CN119808791B_ABST
Patent Text Reader

Abstract

The application provides a medical record semantic understanding method, device, equipment, medium and product. The method comprises the following steps: obtaining a prompt word of a medical record semantic understanding task, the prompt word is obtained by filling corresponding content in each blank item in a preset prompt word template, each blank item comprises a task description, a control condition and a medical record text, the control condition is a limitation condition that needs to be followed by the medical record semantic understanding task, and a medical record semantic understanding model is pre-trained to perform medical record semantic understanding on the medical record text according to the prompt word, so as to obtain a medical record semantic understanding result, and the medical record semantic understanding model is trained on a pre-training large model through a training data set in the form of the prompt word template to perform the medical record semantic understanding task. The application can improve the stability and controllability of the medical record semantic understanding capability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of semantic understanding, and in particular to a medical record semantic understanding method, device, equipment, medium and product. BACKGROUND

[0002] Electronic medical records (EMR) record all medical activities of patients from admission to discharge, and constitute the key basis for medical personnel to analyze, diagnose and treat. Application systems based on EMR, such as medical record quality monitoring and medical insurance auditing, rely on deep semantic understanding to realize their core functions.

[0003] In recent years, generative large language models (LLM) have accumulated rich world knowledge and professional medical knowledge through pre-training on massive natural language and medical data. These pre-trained LLMs further obtain the ability to understand and respond to user intent through a large number of supervised fine-tuning for medical record semantic understanding tasks, and have the ability to parse medical record semantics, so as to be able to extract various forms of medical semantic information according to user needs.

[0004] However, such systems may result in poor stability and controllability of medical record semantic understanding in actual application. SUMMARY

[0005] Based on the above technical status, the present application provides a medical record semantic understanding method, device, equipment, medium and product, which can improve the stability and controllability of the model's medical record semantic understanding ability.

[0006] In order to achieve the above technical purpose, the present application specifically proposes the following technical solutions:

[0007] According to a first aspect of an embodiment of the present application, a medical record semantic understanding method is provided, comprising: obtaining a prompt word of a medical record semantic understanding task, the prompt word being obtained by filling corresponding content in each blank item in a preset prompt word template, the each blank item including a task description, a control condition and a medical record text, the control condition being a restriction condition to be followed by the medical record semantic understanding task; performing medical record semantic understanding on the medical record text according to the prompt word by a pre-trained medical record semantic understanding model to obtain a medical record semantic understanding result, the medical record semantic understanding model being obtained by training a pre-trained large model on a training data set in the form of the prompt word template for a medical record semantic understanding task.

[0008] In some implementations, the medical record semantic understanding is performed in the medical record text according to the prompt word by the pre-trained medical record semantic understanding model to obtain a medical record semantic understanding result, including: performing medical record semantic understanding in the medical record text according to the prompt word by the pre-trained medical record semantic understanding model to obtain an initial medical record semantic understanding result; in a case where it is determined that the initial medical record semantic understanding result needs to be modified, modifying the initial medical record semantic understanding result, and taking the modified medical record semantic understanding result as the final medical record semantic understanding result; in a case where it is determined that the initial medical record semantic understanding result does not need to be modified, taking the initial medical record semantic understanding result as the final medical record semantic understanding result.

[0009] In some implementations, the medical record semantic understanding model is trained by the following steps: obtaining an original training data set, each original training data in the original training data set including sample medical record text and sample medical record semantic understanding result; converting the original training data set into an initial training data set in the form of a preset prompt word template according to the prompt word template; and optimizing training a pre-trained large model according to the initial training data set to obtain the medical record semantic understanding model.

[0010] In some implementations, the control conditions include sub-control conditions of each dimension, the each dimension including at least one of semantic granularity, context, annotation rules, and output format of the medical record semantic understanding result, the semantic granularity being content extraction granularity of the medical record semantic understanding task, the context being context restriction condition of the medical record semantic understanding task, and the annotation rules being restriction rules of the medical record semantic understanding task; wherein, the converting the original training data set into an initial training data set in the form of a prompt word template according to the preset prompt word template includes: extracting sub-control condition content corresponding to each of the sub-control conditions of each dimension from the original training data set; and obtaining the initial training data set in the form of the prompt word template according to the sub-control condition content corresponding to each of the sub-control conditions of each dimension.

[0011] In some implementations, the optimizing training a pre-trained large model according to the initial training data set to obtain the medical record semantic understanding model includes: obtaining a first comparison training data set according to the initial training data set, each comparison training data in the first comparison training data set including a true semantic understanding result and each non-true semantic understanding result; and optimizing training the pre-trained large model according to the first comparison training data set to obtain the medical record semantic understanding model.

[0012] In some implementations, the initial training data set includes respective initial training data, each initial training data including a sample medical record semantic understanding result, the sample medical record semantic understanding result including a true semantic understanding result or a non-true semantic understanding result; wherein the obtaining, according to the initial training data set, a first comparison training data set includes: for each initial training data in the respective initial training data, modifying the true semantic understanding result corresponding to the initial training data to a non-true semantic understanding result according to a preset control condition modification strategy, the control condition modification strategy including a sub-control condition that violates at least one dimension, and / or determining the predicted semantic understanding result corresponding to the initial training data as a non-true semantic understanding result in a case that the predicted semantic understanding result corresponding to the initial training data is determined to violate at least one dimension of sub-control condition by an initial medical record semantic understanding model; obtaining the first comparison training data set according to the true semantic understanding result and the non-true semantic understanding result corresponding to each of the respective initial training data.

[0013] In some implementations, the first comparison training data set includes respective first comparison training data, and the optimizing training, according to the first comparison training data set, the pre-trained large model to obtain the medical record semantic understanding model includes: for each first comparison training data in the respective first comparison training data, determining an error cause and a modification scheme of the non-true semantic understanding result corresponding to the first comparison training data; obtaining a second comparison training data set according to the error cause and the modification scheme of the non-true semantic understanding result corresponding to each of the respective first comparison training data, and the true semantic understanding result; optimizing training, according to the second comparison training data set, the pre-trained large model to obtain the medical record semantic understanding model.

[0014] According to a second aspect of the embodiments of the present application, a medical record semantic understanding device is provided, including: an acquisition unit configured to acquire a prompt word of a medical record semantic understanding task, the prompt word being obtained by filling respective content into each blank item in a preset prompt word template, the each blank item including a task description, a control condition and a medical record text, the control condition being a limitation condition to be followed by the medical record semantic understanding task; a semantic understanding unit configured to perform medical record semantic understanding on the medical record text according to the prompt word by a pre-trained medical record semantic understanding model to obtain a medical record semantic understanding result, the medical record semantic understanding model being obtained by performing medical record semantic understanding task training on a pre-trained large model by a training data set in the form of the prompt word template.

[0015] According to a third aspect of the embodiments of the present application, an electronic device is provided, comprising a memory and a processor; the memory is connected with the processor, and is configured to store a program; the processor is configured to realize the medical record semantic understanding method according to the first aspect by running the program in the memory.

[0016] According to a fourth aspect of the embodiments of the present application, a storage medium is provided, and the storage medium stores a computer program. When the computer program is run by a processor, the medical record semantic understanding method according to the first aspect is realized.

[0017] According to a fifth aspect of the embodiments of the present application, a computer program product is provided, comprising computer program instructions. When the computer program instructions are run by a processor, the processor executes the medical record semantic understanding method according to the first aspect.

[0018] The medical record semantic understanding method, device, equipment, medium and product provided by the embodiments of the present application, the method comprises the following steps: obtaining a prompt word of a medical record semantic understanding task, the prompt word is generated based on a preset prompt word template, the prompt word template comprises a task description, a control condition and each blank item of a medical record text, wherein the control condition defines specific restriction conditions that the medical record semantic understanding task needs to follow. Then, a pre-trained medical record semantic understanding model performs medical record semantic understanding on the medical record text according to the prompt word, and obtains a medical record semantic understanding result, wherein the medical record semantic understanding model is obtained by training a pre-trained large model on a training data set in the form of a prompt word template. Since the training data set is in the form of a prompt word template, the model can learn how to accurately follow the control conditions during the training process. Specifically, the training data set contains detailed control conditions and task descriptions, so that the model can maintain high consistency and reliability in various application scenarios. The model trained in this way can accurately perform the medical record semantic understanding task and show stable performance and high controllability in actual application. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present application, and those skilled in the art can obtain other drawings according to the provided drawings without creative labor.

[0020] Figure 1 A flowchart of a medical record semantic understanding method provided by the embodiments of the present application;

[0021] Figure 2 A schematic diagram of a prompt word template provided by the embodiments of the present application;

[0022] Figure 3 A schematic diagram of a control condition provided for an embodiment of the present application;

[0023] Figure 4 A schematic diagram of a prompt word example provided for an embodiment of the present application;

[0024] Figure 5 A flowchart of a training method of a medical record semantic understanding model provided for an embodiment of the present application;

[0025] Figure 6 A flowchart of a comparative training process of a medical record semantic understanding model provided for an embodiment of the present application;

[0026] Figure 7 A schematic diagram of a comparative training data set provided for an embodiment of the present application;

[0027] Figure 8 A schematic diagram of another comparative training data set provided for an embodiment of the present application;

[0028] Figure 9 A schematic diagram of determining an error cause and a modification scheme of a non-real semantic understanding result provided for an embodiment of the present application;

[0029] Figure 10 A schematic diagram of constructing a second comparative training data set provided for an embodiment of the present application;

[0030] Figure 11 A schematic diagram of a training process of a medical record semantic understanding model provided for an embodiment of the present application;

[0031] Figure 12 A structural schematic diagram of a medical record semantic understanding device provided for an embodiment of the present application;

[0032] Figure 13 A structural schematic diagram of an electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION

[0033] The technical solution provided by the embodiments of the present application can be exemplarily applied to a hardware device such as a processor, an electronic device, a server (including a cloud server), or packaged into a software program to be run. When the hardware device executes the processing process of the technical solution of the present application, or the above-mentioned software program is run, the automatic splitting of the target task and the automatic calling of the application program interface required by the task can be realized, and the purpose of completing the target task can be achieved. The embodiments of the present application only exemplarily introduce the specific processing process of the technical solution of the present application, and do not limit the specific implementation form of the technical solution of the present application. Any technical implementation form that can execute the processing process of the technical solution of the present application can be adopted by the embodiments of the present application.

[0034] The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor belong to the scope of protection of the present application.

[0035] Before introducing the solutions of the present application, the related art is introduced first:

[0036] Electronic medical record (EMR) records all medical activities of patients from admission to discharge, covering text and image materials, and becomes the basis for medical staff to analyze, diagnose and treat diseases. In practical application, a series of derivative systems have been developed based on electronic medical record, such as medical record quality detection and medical insurance audit, which rely on deep semantic understanding of medical record content to realize its functions.

[0037] Traditional natural language processing (NLP) technology converts medical record semantic understanding task into information extraction problem, including entity recognition, relation extraction and event detection, etc. This process involves defining a label system according to the phased demand, and carrying out data labeling and model training to complete semantic analysis under specific demand. However, with the change of application scene, the fixed label system gradually cannot adapt to the new semantic understanding requirements, leading to the decline or failure of system efficiency. For example, the early medical record semantic understanding system can extract all "symptoms" entities in the medical record, but when the new medical insurance audit system needs to "identify only the patient's past symptoms", the system cannot meet the demand, thereby affecting the actual application efficiency.

[0038] In recent years, large language models (LLM), such as ChatGPT, have shown great potential in information extraction field due to their strong generalization ability and high compatibility with human intent. This kind of model has accumulated extensive world knowledge and medical knowledge through large-scale pre-training, and has enhanced the ability to understand and follow complex instructions through supervised fine-tuning (SFT) and human feedback reinforcement learning (RLHF), especially in the few-shot or zero-shot conditions. Therefore, this kind of model has shown significant advantages in improving the efficiency and accuracy of medical record processing.

[0039] However, although LLM performs well in many aspects, since it mainly relies on multi-task learning to enhance the generalization ability in few-shot and zero-shot conditions, this way may lead to insufficient stability and controllability of medical record semantic understanding in practical application. When facing new semantic understanding and application scene, this generalization ability may not provide consistent and reliable output, thereby limiting the actual application effect of the system.

[0040] Therefore, the embodiments of the present application aim to provide a medical record semantic understanding method, device, equipment, medium and product. By fusing the advantages of large language models and fine-grained instruction control, i.e., adding control conditions in the prompt word templates of the training data set to train the ability of the model to follow the control conditions, the model can better follow the control conditions and meet the changing needs of medical record semantic understanding in actual application, thereby ensuring the controllability and stability of the medical record semantic understanding ability. In the following embodiments, they are described one by one in detail.

[0041] Exemplary method

[0042] Figure 1 A flowchart of a medical record semantic understanding method provided by the embodiments of the present application. As shown in Figure 1 The medical record semantic understanding method provided by the embodiments of the present application includes steps S101 and S102:

[0043] S101, obtaining a prompt word of a medical record semantic understanding task.

[0044] In step S101, by obtaining a structured prompt word, the prompt word is used to guide a large language model LLM to perform a medical record semantic understanding task, so as to realize accurate parsing of medical record text.

[0045] The prompt word is obtained by filling in corresponding contents in a preset prompt word template, and the respective blank items include task description, control condition and medical record text, which aims to ensure that the model can fully call the knowledge and ability of the relevant field to follow the fine control condition, so as to complete the medical record semantic understanding task. The prompt word template can be understood as a template framework for implementing the medical record semantic understanding task.

[0046] Figure 2 A schematic diagram of the prompt word template provided by the embodiments of the present application. As shown in Figure 2 The prompt word template includes respective blank items corresponding to role description, task description, control condition and medical record text. Among them, the role description part defines the identity setting of the task execution, so that the model can better simulate the behavior mode of professional personnel. The task description details the specific work content that needs to be completed. The control condition sets specific restriction conditions that the medical record semantic understanding task needs to follow, that is, fine restriction conditions that need to be followed to complete the current medical record semantic understanding task, to ensure the accuracy and consistency of the output result. The medical record text part is used to place the actual medical record text to be processed.

[0047] Through such a structured prompt word template, not only the specific requirements of each task are clear, but also a clear operation guide is provided for the model, ensuring that it can accurately follow the preset rules and conditions when parsing the medical record text.

[0048] To further improve the controllability and stability of medical record semantic understanding, Figure 3 A schematic diagram illustrating the control conditions provided in an embodiment of this application is shown. For example... Figure 3 As shown, the control conditions can be subdivided into sub-control conditions of various dimensions. Each dimension includes at least one of the following: semantic granularity, contextual information, annotation details, and output format of the medical record semantic understanding results. These sub-control conditions provide detailed guidance for the medical record semantic understanding task, ensuring that the model strictly adheres to the set rules when performing the task, thereby generating high-quality parsing results.

[0049] Specifically, refining the control conditions helps the model maintain a high degree of consistency and accuracy when processing complex and varied medical record texts. The following is a detailed explanation of each sub-control condition:

[0050] Semantic granularity defines the precision level of semantic extraction, specifically the content extraction granularity of the medical record semantic understanding task. It controls the granularity of semantic recognition and includes concept granularity, fragment granularity, and chapter granularity. Concept granularity typically consists of characters or words, focusing on individual words or phrases, such as "headache" or "dizziness." Fragment granularity consists of phrases or short text segments composed of similar events, such as "took amoxicillin twice a day, and then improved." Chapter granularity contains multiple different types of events, usually a longer text paragraph, such as "the patient had a headache for three days, took amoxicillin twice a day, and then improved."

[0051] The contextual framework sets the background constraints for medical record semantic understanding, constraining the task with contextual limitations, including tense constraints, negative context constraints, and disease-related knowledge constraints. Tense constraints refer to restrictions related to the current moment, such as "identifying relevant information only in content related to this hospitalization, avoiding identification of information from the patient's previous hospitalizations," aiming to limit the focus to content relevant to the patient's current hospitalization (i.e., the present moment). Negative context constraints aim to limit the identification of relevant information in negative contexts during medical record semantic understanding, avoiding the identification of information in positive contexts. Disease-related knowledge constraints aim to limit the identification of relevant information in the text describing the patient's specific condition during medical record semantic understanding, avoiding the identification of information in irrelevant descriptions, thereby ensuring that only information directly related to the patient's condition is identified.

[0052] The annotation details are the constraints for the medical record semantic understanding task, a series of rules customized by the user according to their own needs. For example, "When identifying body parts, if there are locative words describing the body parts, please identify them simultaneously." The locative words describing the body parts are the annotation details. By capturing locative descriptions simultaneously when identifying body parts, the accuracy of semantic annotation is improved.

[0053] The output format specifies the presentation mode of the medical record semantic understanding result, and aims to limit the medical record semantic understanding result to be output in a specified format, for example, returned in the form of key-value pairs, such as "(tag: annotation content)".

[0054] Figure 4 The schematic diagram of the prompt word instance provided by the embodiment of the present application. As shown in Figure 4 For the medical record semantic understanding task, the role description can be "You are a medical record semantic understanding expert".

[0055] The task description requires extracting candidate labels from the medical record text, while considering candidate labels and control conditions, for example, "Please extract the corresponding labels from the target text based on the 'candidate label' and 'control condition'.\n Candidate label\nSymptom: Symptom generally refers to the abnormal physiological function of the patient caused by the disease, self-experience and feeling or abnormal performance, explicit expression of abnormal examination results. For example, "the patient self-reports recent loss of appetite, lethargy, and fear of cold", "loss of appetite", "lethargy", and "fear of cold" are all symptom entities."

[0056] The control condition can be specific to semantic granularity (such as "headache" and "dizziness" of concept granularity) and context (such as only relevant information for this hospitalization).

[0057] The medical record text is: "The patient has had a headache for three days, has a cough and is weak, and has come to our hospital for treatment. The symptoms have improved, and only mild cough remains."

[0058] Through the above refinement of the control condition, the high controllability and accuracy of the medical record semantic understanding process can be ensured.

[0059] Continue to refer to Figure 1 After step S101, the medical record semantic understanding method of the present embodiment further comprises step S102.

[0060] S102, the pre-trained medical record semantic understanding model performs medical record semantic understanding on the medical record text according to the prompt word, and obtains a medical record semantic understanding result. The medical record semantic understanding model is trained by a training data set in the form of a prompt word template, and a pre-trained large model is trained for a medical record semantic understanding task.

[0061] In step S102, the prompt word is input into the pre-trained medical record semantic understanding model to perform semantic understanding on the medical record text according to the prompt word, and finally obtain the medical record semantic understanding result. The model is obtained by training a pre-trained large model using a training data set in the form of a prompt word template. In this way, the model can accurately follow the control conditions when processing medical record texts, ensuring the consistency and accuracy of the output results. To describe this process in more detail, step S102 specifically includes steps a1 to a3:

[0062] Step a1, performing medical record semantic understanding in the medical record text according to the prompt word by the pre-trained medical record semantic understanding model to obtain an initial medical record semantic understanding result.

[0063] By inputting the prompt word obtained in step S101 into the medical record semantic understanding model, the model can play the role of a professional medical record semantic understanding expert, perform the specific work content specified in the task description according to the control conditions set in the prompt word, and perform semantic understanding on the medical record text to obtain an initial medical record semantic understanding result.

[0064] Step a2, in the case where it is determined that the initial medical record semantic understanding result needs to be modified, modifying the initial medical record semantic understanding result, and taking the modified medical record semantic understanding result as the final medical record semantic understanding result.

[0065] After obtaining the initial medical record semantic understanding result, the model can check whether the initial medical record semantic understanding result meets the control conditions set in the prompt word. If the initial medical record semantic understanding result does not meet the control conditions, it is determined that the initial medical record semantic understanding result needs to be modified. At this time, the model will specifically correct the initial medical record semantic understanding result until all control conditions are followed, thereby ensuring the accuracy and consistency of the final output.

[0066] Step a3, in the case where it is determined that the initial medical record semantic understanding result does not need to be modified, taking the initial medical record semantic understanding result as the final medical record semantic understanding result.

[0067] When checking whether the initial medical record semantic understanding result meets the control conditions set in the prompt word, if the initial medical record semantic understanding result meets the control conditions, it is determined that the initial medical record semantic understanding result does not need to be modified, and it is output as the final result.

[0068] This embodiment ensures the rigor and reliability of the medical record semantic understanding process, so that the model can output a semantic understanding result that meets the task requirements and has high precision. This structured processing method not only improves the efficiency of medical record semantic understanding, but also ensures the high consistency and controllability of the results.

[0069] In the above embodiments, the specific implementation process of applying the medical record semantic understanding model for medical record semantic understanding is introduced. In order to make the model perform well in actual application, it is necessary to pre-train the medical record semantic understanding model. The training method of the medical record semantic understanding model will be described in detail in combination with the accompanying drawings:

[0070] Figure 5 The flowchart of the training method of the medical record semantic understanding model provided by the embodiments of the present application is shown in FIG. 5. As shown in FIG. 5, the training method of the medical record semantic understanding model includes the following steps S501 to S503: Figure 5

[0071] S501, obtaining an original training data set, each original training data in the original training data set including a sample medical record text and a sample medical record semantic understanding result.

[0072] In order to ensure the quality and diversity of the training data, the original training data set can be obtained from multiple ways, such as from public medical data sets or data sets published by medical institutions, or using medical knowledge base and natural language generation technology, generating virtual medical record texts and their semantic understanding results in accordance with the preset rules, or generating new training samples by transforming, expanding or combining the existing data, or obtaining high-quality medical data sets provided by third-party data service providers after cleaning, labeling and sorting.

[0073] Each original training data can be as follows: for example, the sample medical record text is "the patient has long-term cough and expectoration, and has taken cough medicine to control the disease. Today, he has severe cough and hemoptysis, and his body temperature is 38.1, so he comes to our hospital for treatment". The sample medical record semantic understanding result is "symptom: cough; symptom: hemoptysis".

[0074] S502, converting the original training data set into an initial training data set in the form of a prompt word template according to a preset prompt word template.

[0075] Step S502 aims to extract the role description, task description, control condition and the content corresponding to each part of the medical record text from the original training data, so as to ensure that each training sample conforms to the structured format required by the model training.

[0076] The role description part defines the identity setting of the task execution, so that the model can simulate the behavior mode of professional personnel. As mentioned earlier, this part of the content can refer to the role description setting introduced earlier, and will not be repeated here.

[0077] ​The task description should be clear about the specific task that needs to be completed at present, and the labels and label explanations involved should be detailed. By summarizing the sample medical record text and sample medical record semantic understanding results in the original training data set, the specific task requirements can be refined. The labels not only include the original labels corresponding to the original training data, but also include randomly sampled labels in the original training data set to increase the diversity and generalization ability of the training data. The label explanation is obtained according to the annotation specification to ensure that each label has a clear definition and sample explanation. For example, the definition, usage scenarios, and typical examples of the label can be obtained from the annotation specification to ensure that the model can accurately understand and apply these labels during the learning process.

[0078] The control conditions set specific restrictions that the medical record semantic understanding task must follow to ensure the accuracy and consistency of the output results. These conditions include but are not limited to semantic granularity, contextual context, annotation details, and output format dimensions. See the detailed introduction to the control conditions above.

[0079] The medical record text section is used to place the actual medical record text to be processed, i.e., the sample medical record text in the original training data. Ensure that the text content is complete and accurate so that the model can effectively analyze the semantics based on real medical records.

[0080] Specifically, step S502 includes the following steps b1 and b2:

[0081] Step b1, extract the sub-control condition content corresponding to each dimension of the sub-control condition from the original training data set.

[0082] Extract the sub-control condition content of each dimension from the original training data set. Specifically, the content related to different sub-control conditions needs to be identified and separated from all medical record texts in the original training data set. These sub-control conditions cover multiple dimensions, such as semantic granularity, contextual context, annotation details, and output format. Through data processing and analysis, the sub-control condition content under each dimension can be accurately extracted, providing a solid foundation for the subsequent prompt word template generation.

[0083] For example, in processing semantic granularity, concept granularity (e.g., "headache", "dizziness"), fragment granularity (e.g., "take amoxicillin twice a day, and then get better") and chapter granularity (e.g., "patient has a headache for three days, takes amoxicillin twice a day, and then gets better") can be identified. For contextual context, temporal restrictions (e.g., only information related to this hospitalization), negative context restrictions (e.g., identifying symptom descriptions in negative sentences), and disease-related knowledge restrictions (e.g., focusing on key information in the description of the disease) need to be distinguished. The annotation guidelines involve specific rule settings, such as requiring the identification of both the location and its orientation description. Finally, the output format specifies the way the results are presented, for example, returned in the form of key-value pairs.

[0084] To ensure that the sub-control condition content of each dimension can be accurately extracted, the description content of the semantic granularity part corresponding to each original training data can be obtained by summarizing the original training data set. Based on the pre-set annotation guidelines, detailed annotation guidelines are obtained to ensure that the label definition is clear and consistent. For the output format, it can be obtained by selecting from various pre-set output formats. For the contextual context part, existing labels can be split or combined to obtain it. For example, the original training data requires identifying "denying disease" in the sample medical record text, at this time the label of "denying disease" can be split into "denying context restriction" and "disease" label to enhance the understanding ability of the model.

[0085] Step b2, obtaining an initial training data set in the form of a prompt word template according to the sub-control condition content corresponding to each dimension of the sub-control condition.

[0086] After the extraction of the sub-control condition content is completed, an initial training data set in the form of a prompt word template is constructed in step b2 according to the content. The core of this step is to integrate the extracted sub-control condition content into the pre-set prompt word template structure to form a series of more instructive and more accurate task instructions. Each prompt word template includes role description, task description, control condition and target text blank item, aiming to simulate the working environment of professionals, so that the model can fully call on the knowledge and ability in the relevant field to complete the specific task.

[0087] In specific implementation, each part in the prompt word template can be filled according to the specific situation of each medical record. For example, for a certain medical record text, the role description is set as "you are a medical record semantic understanding expert", and the task description is set as "please extract the corresponding label from the target text based on the 'candidate label' and 'control condition'". Then, the corresponding control conditions such as semantic granularity and context are filled in detail according to the previously extracted sub-control condition content. Finally, the medical record text to be parsed is inserted into the target text blank item, thereby constructing a complete sample prompt word. In this way, the generated sample prompt word not only reflects the key information of the original medical record text, but also integrates detailed control conditions, ensuring that the model can learn to accurately understand and perform the medical record semantic understanding task while following the control conditions during the training process.

[0088] In this way, the sample prompt word constructed not only reflects the key information of the original medical record text, but also integrates detailed control conditions, ensuring that the model can learn how to accurately understand and perform the medical record semantic understanding task while following the control conditions during the training process. This structured training data set provides rich guidance information for the model, enhancing its adaptability and reliability in complex and variable application scenarios.

[0089] Referring back to Figure 5 After step S502, step S503 is further included.

[0090] S503, optimizing and training the pre-trained large model according to the initial training data set to obtain a medical record semantic understanding model.

[0091] In step S503, the pre-trained large model is optimized and trained according to the initial training data set to obtain the final medical record semantic understanding model. The present embodiment provides various implementation manners, which are as follows:

[0092] In some implementation manners, step S503 includes: performing supervised fine-tuning (Supervised Finetuning, SFT) on the pre-trained large model through the target training data set, thereby obtaining an initial medical record semantic understanding model M1, and taking the model M1 as the final medical record semantic understanding model M0.

[0093] In some implementation manners, in order to improve the model's ability to capture complex multi-dimensional sub-control conditions in the control conditions and accurately complete the task while following these sub-control conditions, the model's ability to follow the control conditions can be improved through a contrastive learning manner. Contrastive learning requires the construction of a contrastive training data set, and the specific implementation process of constructing the contrastive training data set will be described in detail below.

[0094] Figure 6 The flowchart of the contrastive training process of the medical record semantic understanding model provided by the embodiments of the present application is shown in FIG. 7. As shown in FIG. 7, the process includes the following steps: S701, constructing a contrastive training data set.Figure 6 As shown in FIG. 6, step S503 includes step S601 and step S602.

[0095] Step S601: obtaining a first contrast training data set according to the initial training data set, each first contrast training data in the first contrast training data set including a real semantic understanding result and each non-real semantic understanding result.

[0096] In step S601, the initial training data set includes each initial training data, which is one-to-one corresponding to the original training data, that is, each piece of original training data can be converted into an initial training data. Each initial training data includes a sample medical record semantic understanding result, which includes a real semantic understanding result or a non-real semantic understanding result. The real semantic understanding result is a correct semantic understanding result manually annotated. The non-real semantic understanding result refers to an error semantic understanding result generated by a model.

[0097] In step S601, the initial training data set includes each initial training data, which is one-to-one corresponding to the original training data, that is, each piece of original training data can be converted into an initial training data. Each initial training data includes a sample medical record semantic understanding result, which includes a real semantic understanding result or a non-real semantic understanding result. The real semantic understanding result is a correct semantic understanding result manually annotated. The non-real semantic understanding result refers to an error semantic understanding result generated by a model.

[0098] In some implementations, when step S601 obtains the first contrast sample data set in the manner of "generating error samples that violate control conditions", it includes: for each initial training data in the initial training data set, modifying the real semantic understanding result corresponding to the initial training data to a non-real semantic understanding result according to a preset control condition modification strategy, the control condition modification strategy including a sub-control condition that violates at least one dimension; obtaining the first contrast training data set according to the real semantic understanding result and the non-real semantic understanding result corresponding to each initial training data.

[0099] For each initial training data in the initial training data set, the sample medical record semantic understanding result (i.e. the answer) in each initial training data can be modified by an auxiliary model (such as Qwen2.5) to make the answer violate at least one sub-control condition.

[0100] Figure 7 A schematic diagram for constructing a contrast training data set is provided for the embodiments of the present application. As shown in FIG. 6, by adding a prompt word to guide the modification of the answer, it is ensured that the modified answer has a specific error. The "task description", "control condition", "sample medical record text" and "answer" in the rectangular box on the left side of the arrow in the figure are the initial training data. By adding the prompt word for modifying the answer, the specific steps are as follows: Figure 7

[0101] "Please modify the

answer

[0102] Require:

[0103] 1. When answering, please output the following format: [Answer Modification Plan]: "***", [Modified Incorrect Answer]: "***".

[0104] The [Answer Modification Scheme] describes the logical steps required to change a given answer into an incorrect one.

[0105] [Modified Incorrect Answer] is an answer that contains some error after being modified according to the modification plan. The modified incorrect answer should maintain at least 60% similarity to the original answer.

[0106] 2. Except for the [Answer Modification Plan] section, no further explanation is required for the modifications.

[0107] Continue reading Figure 7 The content in the rectangle to the right of the arrow is the "answer modification plan" and the modified incorrect answer (i.e., the result of non-true semantic understanding).

[0108] In some implementations, when step S601 obtains the first comparison sample dataset by "selecting erroneous samples from multiple samplings", it includes: if the predicted semantic understanding result corresponding to the initial training data is determined to be a non-true semantic understanding result by the initial medical record semantic understanding model M1 if it violates the sub-control conditions of at least one dimension; and obtaining the first comparison training dataset based on the true semantic understanding result and the non-true semantic understanding result corresponding to each initial training data.

[0109] In this implementation, the aim is to generate multiple predicted semantic understanding results (i.e., answers) for each initial training data point in the initial training dataset using the initial medical record semantic understanding model M1, thereby obtaining multiple predicted semantic understanding results. Then, an auxiliary model (such as Qwen2.5) is used to analyze the correctness of these multiple predicted semantic understanding results, such as whether they accurately follow the control conditions. Predicted semantic understanding results that do not follow the control conditions are selected as non-true semantic understanding results and used to construct the first comparative training dataset.

[0110] Figure 8 This is a schematic diagram illustrating another method for constructing a comparative training dataset, as provided in an embodiment of this application. Figure 8As shown, the answer is analyzed whether it violates a sub-control condition by checking the prompt words, and the corresponding conclusion is given. The "task description", "control condition", "sample medical record text" and "answer" in the rectangular box on the left side of the arrow in the figure are the initial training data. By adding the prompt words for checking the answer, the specific implementation is as follows:

[0111] Please analyze whether the answer violates a sub-control condition in the above task and answer. If it violates, please analyze the situation in detail and give the conclusion of "violating control condition". If not, please answer "no violation of control condition".

[0112] The right side of the arrow in the figure is the checking and analysis process of the answer and the conclusion.

[0113] Of course, in some embodiments, step S601 can also use the way of "generating error samples violating control conditions" and "selecting error samples in multiple samplings" to obtain non-real semantic understanding results. This makes each initial training data correspond to a real semantic understanding result and at least one non-real semantic understanding result, forming a first contrast training data set.

[0114] Through the above embodiments, each initial training data can correspond to a real semantic understanding result and at least one non-real semantic understanding result. Each initial training data and its real semantic understanding result and at least one non-real semantic understanding result form a first contrast training data set.

[0115] Continue to refer to Figure 6 After step S601, step S602 can also be included.

[0116] Step S602, according to the first contrast training data set, the pre-trained large model is optimized and trained to obtain a medical record semantic understanding model.

[0117] There are many implementation ways for step S602, which can be as follows:

[0118] In some implementations, step S602 includes: after obtaining the first contrast training data set, the initial medical record semantic understanding model M1 can be directly contrastively learned and trained by the first contrast training data set to obtain an intermediate medical record semantic understanding model M2, and the intermediate medical record semantic understanding model M2 is taken as the final medical record semantic understanding model M0.

[0119] Compared with the initial medical record semantic understanding model M1, the intermediate medical record semantic understanding model M2 has improved ability to follow control conditions when applied to medical record semantic understanding tasks, but still has room for further improvement.

[0120] In some implementations, to further improve the ability of the model M1 to follow the control condition, a second contrast training data set can also be constructed based on the first contrast training data set, and the ability of the model M1 to discover the core difference between positive and negative samples through the interpretable second contrast training data set, so as to obtain a medical record semantic understanding model M0 with stronger controllability. Specifically, step S602 includes steps c1, c2 and c3:

[0121] Step c1, for each first contrast training data, determine the error cause and modification scheme of the non-real semantic understanding result corresponding to the first contrast training data.

[0122] Specifically, step c1 can still be implemented by the auxiliary model introduced above.

[0123] Figure 9 The schematic diagram for determining the error cause and modification scheme of the non-real semantic understanding result provided by the embodiments of the present application. As shown in Figure 9 , it shows the process of determining the error cause and modification scheme of the non-real semantic understanding result, in which the prompt words for analyzing and modifying the predicted answer are added to guide the model to identify and correct errors. The arrow on the left adds prompt words for analyzing and modifying the predicted answer on the basis of the prompt words corresponding to the initial training data, as follows:

[0124] For the above task, take the "standard answer" as the completely correct answer, analyze whether the "predicted answer" has errors with reference to the "standard answer", and if so, analyze the error situation and explain how to modify the error.

[0125] 1. When answering, first give the conclusion. If there is an error, answer "the predicted answer has errors", and if there is no error, answer "the predicted answer is completely correct".

[0126] 2. After giving the error situation analysis, no modification result is required.

[0127] 3. In the entire analysis and summary, there should be no analysis and discussion about the standard answer. The standard answer here is only implicit reference knowledge and cannot be explicitly mentioned.

[0128] Continue to refer to Figure 9 , the right side of the arrow in the figure is the error situation analysis and summary content.

[0129] Step c2, according to the error cause and modification scheme of the non-real semantic understanding result corresponding to each first contrast training data, and the real semantic understanding result, obtain a second contrast training data set.

[0130] The contrast training data set includes each contrast training data, and each contrast training data is in a one-to-one correspondence with each initial contrast training data. That is, each initial contrast training data can correspond to one contrast training data. The answer part of each contrast training data includes the true semantic understanding result and the error reason and modification scheme of the non-true semantic understanding result.

[0131] Figure 10 The schematic diagram for constructing the second contrast training data set is provided for the embodiments of the present application. As shown in Figure 10 , it is shown how to increase the prompt words of the "re-prediction" part on the basis of Figure 9 , "non-true answer + analysis process + true answer" is taken as the explainable contrast training data to obtain the second contrast training data set, so that the model can have the re-prediction ability, and further improve the controllability and stability of the medical record semantic understanding ability.

[0132] Step c3, according to the second contrast training data set, the pre-trained large model is optimized and trained to obtain the medical record semantic understanding model.

[0133] The second contrast training data set not only includes the true semantic understanding result, but also includes the non-true semantic understanding result and the error reason thereof, so the second contrast training data set can also be called the explainable contrast training data set. By optimizing and training the model M1 through the second contrast training data set, the model can learn the detailed differences between the true semantic understanding result and the non-true semantic understanding result from the inference process, and learn to analyze and follow the detailed differences. In this way, the medical record semantic understanding model M0 can be obtained by continuing to train on the basis of M1, the model M0 can better follow the control conditions, and automatically analyze and improve the generated answers.

[0134] It should be noted that in order to train the model to check the ability of the initial medical record semantic understanding result whether it needs to be modified, the initial training data set can also be added in the second contrast training data set, and the pre-trained large model is optimized and trained to obtain the medical record semantic understanding model.

[0135] To sum up, the medical record semantic understanding method proposed in the application abstracts the medical record semantic understanding task into task description and control conditions, making the task logic clearer and easier to execute. Further, according to the actual application requirements, various sub-control dimensions of medical record semantic understanding are induced and defined, and each type of sub-control dimension is subdivided in detail. This process not only enhances the generalization ability of the model to complex control conditions, but also improves its controllability in the medical record semantic understanding task. In addition, the application introduces an error analysis path for associating real semantic understanding results (positive samples) and non-real semantic understanding results (negative samples). By in-depth analysis of the error causes of non-real semantic understanding results, the model can more accurately capture features during training, thus more clearly learning how to follow the control conditions to complete the medical record semantic understanding task. This mechanism ensures that the model can maintain stability when facing diverse application scenarios.

[0136] The training process of the medical record semantic understanding model introduced above can be summarized as three parts: data rewriting, constructing contrast training data, and contrast training. As shown in Figure 11 , it specifically includes:

[0137] (1) Data rewriting

[0138] In the data rewriting part, a condition-controllable semantic understanding template framework is proposed, which abstracts various semantic understanding tasks into information extraction constraints. Meanwhile, sub-control conditions of each dimension are designed to accommodate common semantic understanding control requirements. Finally, the original training data set is converted into an initial training data set according to the designed semantic understanding template framework and sub-control conditions, and an initial medical record semantic understanding model M1 is obtained through SFT.

[0139] (2) Constructing contrast training data set

[0140] By generating or selecting negative samples based on the initial training data set, a first contrast training data set is obtained. The generation of negative samples is achieved by guiding the LLM to generate non-real answers that violate any sub-control condition. The selection of negative samples is achieved by having the model M1 sample each initial training data multiple times and selecting non-real answers from the multiple sampling results. Thus, for each initial training data, a positive sample (i.e., a real answer) and at least one negative sample (i.e., a non-real answer) can be obtained.

[0141] To further improve the controllability of the model in the medical record semantic understanding task, the error causes of the above negative samples can also be analyzed and modification schemes can be given. The "non-real answer + analysis process + real answer" is used as the explainable contrast training data to obtain a second contrast training data set.

[0142] (3) Contrast training

[0143] In the process, the first contrast training dataset or the second contrast training dataset can be used to continue training the model M1 to obtain the medical record semantic understanding model M0.

[0144] Exemplary apparatus

[0145] Corresponding to the medical record semantic understanding method described above, the embodiments of the present application also provide a medical record semantic understanding device. Figure 12 is a structural schematic diagram of a medical record semantic understanding device provided by the embodiments of the present application. As shown in Figure 12 the medical record semantic understanding device provided by the embodiments of the present application includes an acquisition unit 1201 and a semantic understanding unit 1202; wherein the acquisition unit 1201 is configured to acquire a prompt word of a medical record semantic understanding task, the prompt word being obtained by filling in corresponding content in each blank item in a preset prompt word template, the each blank item including a task description, a control condition and a medical record text, the control condition being a restriction condition to be followed by the medical record semantic understanding task; the semantic understanding unit 1202 is configured to perform medical record semantic understanding on the medical record text according to the prompt word by a pre-trained medical record semantic understanding model to obtain a medical record semantic understanding result, the medical record semantic understanding model being obtained by performing medical record semantic understanding task training on a pre-trained large model by using a training dataset in the form of the prompt word template.

[0146] In some embodiments, when the semantic understanding unit 1202 is configured to perform medical record semantic understanding on the medical record text according to the prompt word by the pre-trained medical record semantic understanding model to obtain the medical record semantic understanding result, it specifically includes: performing medical record semantic understanding on the medical record text according to the prompt word by the pre-trained medical record semantic understanding model to obtain an initial medical record semantic understanding result; in the case where it is determined that the initial medical record semantic understanding result needs to be modified, modifying the initial medical record semantic understanding result and taking the modified medical record semantic understanding result as the final medical record semantic understanding result; in the case where it is determined that the initial medical record semantic understanding result does not need to be modified, taking the initial medical record semantic understanding result as the final medical record semantic understanding result.

[0147] In some embodiments, the medical record semantic understanding model is trained by the following steps: acquiring an original training dataset, each of the original training data in the original training dataset including a sample medical record text and a sample medical record semantic understanding result; converting the original training dataset into an initial training dataset in the form of the prompt word template according to a preset prompt word template; and performing optimization training on a pre-trained large model according to the initial training dataset to obtain the medical record semantic understanding model.

[0148] In some embodiments, the control condition includes a sub-control condition of each dimension, the each dimension including at least one of a semantic granularity, a context, a labeling rule, and an output format of the medical record semantic understanding result, the semantic granularity being a content extraction granularity of the medical record semantic understanding task, the context being a context restriction condition of the medical record semantic understanding task, and the labeling rule being a restriction rule of the medical record semantic understanding task; and wherein the converting the original training data set into the initial training data set in the form of the prompt word template according to the preset prompt word template includes: extracting a sub-control condition content corresponding to each of the sub-control conditions of the each dimension from the original training data set; and obtaining the initial training data set in the form of the prompt word template according to the sub-control condition content corresponding to each of the sub-control conditions of the each dimension.

[0149] In some embodiments, the optimizing and training the pre-trained large model according to the initial training data set to obtain the medical record semantic understanding model includes: obtaining a first comparison training data set according to the initial training data set, each comparison training data in the first comparison training data set including a true semantic understanding result and each non-true semantic understanding result; and optimizing and training the pre-trained large model according to the first comparison training data set to obtain the medical record semantic understanding model.

[0150] In some embodiments, the initial training data set includes each initial training data, each initial training data including the sample medical record semantic understanding result, the sample medical record semantic understanding result including a true semantic understanding result or a non-true semantic understanding result; and wherein the obtaining the first comparison training data set according to the initial training data set includes: modifying the true semantic understanding result corresponding to each initial training data in the each initial training data according to a preset control condition modification strategy to a non-true semantic understanding result, the control condition modification strategy including violating at least one sub-control condition of each dimension and / or determining the predicted semantic understanding result corresponding to the initial training data as a non-true semantic understanding result in a case where the predicted semantic understanding result corresponding to the initial training data determined by an initial medical record semantic understanding model violates at least one sub-control condition of each dimension; and obtaining the first comparison training data set according to the true semantic understanding result and the non-true semantic understanding result corresponding to the each initial training data.

[0151] In some embodiments, the first contrast training data set includes respective first contrast training data, and the optimizing training of the pre-trained large model according to the first contrast training data set to obtain the medical record semantic understanding model includes: determining, for each of the respective first contrast training data, an error cause and a modification scheme of the non-real semantic understanding result corresponding to the first contrast training data; obtaining a second contrast training data set according to the error cause and the modification scheme of the non-real semantic understanding result corresponding to each of the respective first contrast training data, and the real semantic understanding result; and optimizing training of the pre-trained large model according to the second contrast training data set to obtain the medical record semantic understanding model.

[0152] The medical record semantic understanding device provided in this embodiment belongs to the same application concept as the medical record semantic understanding method provided in the above-mentioned embodiments of the present application, can execute the medical record semantic understanding method provided in any of the above-mentioned embodiments of the present application, and has the corresponding function modules and beneficial effects of executing the medical record semantic understanding method. Technical details not described in detail in this embodiment can be found in the specific processing content of the medical record semantic understanding method provided in the above-mentioned embodiments of the present application, which will not be described here.

[0153] The functions implemented by the above acquisition unit 1201 and semantic understanding unit 1202 can be implemented by the same or different processors, and the embodiments of the present application are not limited.

[0154] It should be understood that the units in the above device can be implemented in the form of processor calling software. For example, the device includes a processor connected with a memory, the memory stores instructions, and the processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of the units of the device, wherein the processor can be a general processor, such as a CPU or a microprocessor, and the memory can be an internal memory of the device or an external memory of the device. Alternatively, the units in the device can be implemented in the form of hardware circuit. The functions of part or all of the units can be implemented by designing the hardware circuit. The hardware circuit can be understood as one or more processors. For example, in one implementation, the hardware circuit is an ASIC, and the functions of part or all of the units are implemented by designing the logical relationship of elements in the circuit. For another example, in another implementation, the hardware circuit can be implemented by a PLD. Taking an FPGA as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to implement the functions of part or all of the units. All units of the above device can be implemented in the form of processor calling software, or implemented in the form of hardware circuit, or part of them are implemented in the form of processor calling software, and the remaining part is implemented in the form of hardware circuit.

[0155] In the embodiments of the present application, the processor is a circuit with signal processing capability. In one implementation, the processor can be a circuit with instruction reading and running capability, such as a CPU, a microprocessor, a GPU, or a DSP, etc. In another implementation, the processor can implement certain functions through a logic relationship of a hardware circuit, which is fixed or can be reconfigured. For example, the processor is a hardware circuit implemented by an ASIC or a PLD, such as an FPGA, etc. In the reconfigurable hardware circuit, the processor loads a configuration document to implement the hardware circuit configuration. It can be understood that the processor loads instructions to implement the functions of the above units.

[0156] It can be seen that each unit in the above apparatus can be one or more processors (or processing circuits) configured to implement the above method, for example: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0157] In addition, each unit in the above apparatus can be integrated together or can be independently implemented. In one implementation, these units are integrated together to implement a SOC. The SOC can include at least one processor for implementing any of the above methods or implementing the functions of the units of the apparatus. The at least one processor can be different, such as including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0158] Exemplary electronic device

[0159] The embodiments of the present application provide an electronic device, referring to Figure 13 The electronic device includes:

[0160] a memory 200 and a processor 210;

[0161] The memory 200 is connected with the processor 210, and is configured to store programs.

[0162] The processor 210 is configured to implement the medical record semantic understanding method disclosed in any of the above embodiments by running the programs stored in the memory 200.

[0163] Specifically, the above electronic device can further include a bus, a communication interface 220, an input device 230, and an output device 240.

[0164] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected with each other through a bus. Among them:

[0165] The bus can include a path for transmitting information between various components of the computer system.

[0166] The processor 210 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs of the present application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready-to-use programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0167] The processor 210 can include a main processor, and can also include a baseband chip, a modem, etc.

[0168] The memory 200 stores programs for executing the technical solutions of the present application, and can also store operating systems and other key services. Specifically, the program can include program code, and the program code includes computer operation instructions. More specifically, the memory 200 can include read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), other types of dynamic storage devices that can store information and instructions, disk storage, flash, etc.

[0169] The input device 230 can include a device that receives data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer or a gravity sensor, etc.

[0170] The output device 240 can include a device that allows information to be output to a user, such as a display screen, a printer, a speaker, etc.

[0171] The communication interface 220 can include a device using any transceiver, such as an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc., to communicate with other devices or communication networks.

[0172] The processor 210 executes the programs stored in the memory 200, and calls other devices, which can be used to implement each step of any one of the medical record semantic understanding methods provided by the above-mentioned embodiments of the present application.

[0173] The embodiment of the present application also provides a chip, which comprises a processor and a data interface, wherein the processor reads and runs a program stored on a memory through the data interface to execute the medical record semantic understanding method described in any of the above embodiments, and the specific processing process and advantages thereof can be referred to the above description of the medical record semantic understanding method.

[0174] Exemplary computer program product and storage medium

[0175] In addition to the above method and device, the embodiment of the present application can also be a computer program product, which comprises computer program instructions, and the computer program instructions make the processor execute the steps in the medical record semantic understanding method according to various embodiments of the present application described in any of the above embodiments of the present application when the processor runs.

[0176] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of the present application, including an object-oriented programming language, such as Java, C++, and the like, and a conventional procedural programming language, such as "C" language or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0177] In addition, the embodiment of the present application can also be a storage medium, which stores a computer program, and the computer program makes the processor execute the steps in the medical record semantic understanding method according to various embodiments of the present application described in any of the above embodiments of the present application when the processor runs. The specific steps can include the following steps:

[0178] Step S101, obtaining a prompt word of a medical record semantic understanding task, wherein the prompt word is obtained by filling corresponding content in each blank item in a preset prompt word template, the each blank item comprises a task description, a control condition and a medical record text, and the control condition is a limitation condition to be followed by the medical record semantic understanding task.

[0179] Step S102, performing medical record semantic understanding on the medical record text according to the prompt word by a pre-trained medical record semantic understanding model, to obtain a medical record semantic understanding result, wherein the medical record semantic understanding model is obtained by training a pre-trained large model on a training data set in the form of the prompt word template.

[0180] For each method embodiment described above, for the sake of simplicity, the method embodiments are described as a series of acts. But those skilled in the art will appreciate that the method embodiments are not limited by the order of acts, as some steps could occur in other orders or concurrently with each other. Moreover, those skilled in the art will appreciate that described acts could be implemented other ways, such as at least partially in hardware, and that the disclosure is not limited to the described or disclosed acts or to the order of such acts.

[0181] It should be noted that each of the above-described embodiments can be implemented in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between embodiments can be mutually referred to. For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.

[0182] The steps in the method embodiments of the present application can be adjusted in order, combined, and reduced according to actual needs. The technical features recorded in each embodiment can be replaced or combined.

[0183] The modules and sub-modules in the device and terminal in each embodiment of the present application can be combined, divided, and reduced according to actual needs.

[0184] In several embodiments provided by the present application, it should be understood that the disclosed terminal, device and method can be implemented by other ways. For example, the terminal embodiments described above are merely schematic. For example, the division of modules or sub-modules is merely a logical function division. In actual implementation, another division mode can be used. For example, a plurality of sub-modules or modules can be combined or integrated into another module, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed ones can be indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0185] The modules or sub-modules described as separate components can or can not be physically separate, and the components of the modules or sub-modules can or can not be physical modules or sub-modules, that is, they can be located in one place or distributed on a plurality of network modules or sub-modules. Some or all modules or sub-modules can be selected according to actual needs to achieve the purpose of the embodiment.

[0186] In addition, each functional module or sub-module in each embodiment of the present application can be integrated in one processing module, or each module or sub-module can exist physically alone, or two or more modules or sub-modules can be integrated in one module. The integrated module or sub-module can be realized in the form of hardware or in the form of a software functional module or sub-module.

[0187] The skilled person can further realize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, each example has been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0188] The steps of the method or algorithm described in connection with the embodiments disclosed herein can be directly implemented by hardware, a software unit executed by a processor, or a combination of both. The software unit can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0189] Finally, it should be noted that, in this document, relational terms such as first and second, and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.

[0190] The above description of disclosed embodiments enables one of ordinary skill in the art to make and use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for semantic understanding of medical records, characterized in that, include: The prompt words for the medical record semantic understanding task are obtained by filling in the corresponding content in each blank in the preset prompt word template. Each blank includes a task description, control conditions and medical record text. The control conditions are the constraints that the medical record semantic understanding task must follow. The medical record semantic understanding model is trained by a pre-trained medical record semantic understanding model to perform medical record semantic understanding on the medical record text based on the prompt words, and the medical record semantic understanding model is obtained by training a pre-trained large model on the medical record semantic understanding task using an initial training dataset in the form of prompt word templates; The medical record semantic understanding model is trained using the following steps: Based on the initial training dataset, a first comparison training dataset is obtained, wherein each comparison training data in the first comparison training dataset includes real semantic understanding results and each non-real semantic understanding result; Based on the first comparative training dataset, the pre-trained large model is optimized and trained to obtain the medical record semantic understanding model.

2. The method according to claim 1, characterized in that, A pre-trained medical record semantic understanding model performs semantic understanding of the medical record text based on the prompt words, obtaining the medical record semantic understanding results, including: The pre-trained medical record semantic understanding model performs medical record semantic understanding on the medical record text based on the prompt words to obtain the initial medical record semantic understanding result; If it is determined that the initial medical record semantic understanding result needs to be modified, the initial medical record semantic understanding result is modified, and the modified medical record semantic understanding result is taken as the final medical record semantic understanding result; If it is determined that the initial medical record semantic understanding result does not need to be modified, the initial medical record semantic understanding result shall be used as the final medical record semantic understanding result.

3. The method according to claim 1, characterized in that, The initial training dataset was obtained using the following steps: Obtain the original training dataset, wherein each original training data in the original training dataset includes sample medical record text and sample medical record semantic understanding results; Based on the preset prompt word template, the original training dataset is converted into an initial training dataset in the form of the prompt word template.

4. The method according to claim 3, characterized in that, The control conditions include sub-control conditions of various dimensions. Each dimension includes at least one of semantic granularity, contextual context, annotation details, and the output format of the medical record semantic understanding result. The semantic granularity is the content extraction granularity of the medical record semantic understanding task. The contextual context is the contextual constraint condition of the medical record semantic understanding task. The annotation details are the constraint rules of the medical record semantic understanding task. The step of converting the original training dataset into an initial training dataset in the form of a preset prompt word template includes: Extract the sub-control condition content corresponding to each of the sub-control conditions in each dimension from the original training dataset; Based on the sub-control condition content corresponding to each of the sub-control conditions of each dimension, the initial training dataset in the form of the prompt word template is obtained.

5. The method according to claim 1, characterized in that, The initial training dataset includes various initial training data, and each initial training data includes sample medical record semantic understanding results, which may include real semantic understanding results or non-real semantic understanding results. The step of obtaining the first comparative training dataset based on the initial training dataset includes: For each initial training data in the initial training data, the true semantic understanding result corresponding to the initial training data is modified to a non-true semantic understanding result according to the preset control condition modification strategy. The control condition modification strategy includes violating at least one dimension of sub-control condition, and / or, if the predicted semantic understanding result corresponding to the initial training data is determined to be a non-true semantic understanding result by the initial medical record semantic understanding model in the case that it violates at least one dimension of sub-control condition. The first comparative training dataset is obtained based on the true semantic understanding results and the non-true semantic understanding results corresponding to each of the initial training data.

6. The method according to claim 1, characterized in that, The first contrast training dataset includes various first contrast training data. The step of optimizing and training the pre-trained large model based on the first contrast training dataset to obtain the medical record semantic understanding model includes: For each of the first comparative training data in the first comparative training data, determine the error cause and modification scheme of the non-real semantic understanding result corresponding to the first comparative training data; Based on the error causes and modification schemes of the non-real semantic understanding results corresponding to each of the first comparative training data, and the real semantic understanding results, a second comparative training dataset is obtained; Based on the second comparative training dataset, the pre-trained large model is optimized and trained to obtain the medical record semantic understanding model.

7. A medical record semantic understanding device, characterized in that, include: The acquisition unit is used to acquire prompt words for the medical record semantic understanding task. The prompt words are obtained by filling in the corresponding content in each blank in the preset prompt word template. Each blank includes a task description, control conditions and medical record text. The control conditions are the constraints that the medical record semantic understanding task must follow. The semantic understanding unit is used to perform medical record semantic understanding on the medical record text based on the prompt words by a pre-trained medical record semantic understanding model, and to obtain the medical record semantic understanding result. The medical record semantic understanding model is obtained by training a pre-trained large model on a medical record semantic understanding task using an initial training dataset in the form of prompt word templates. The medical record semantic understanding model is trained using the following steps: Based on the initial training dataset, a first comparison training dataset is obtained, wherein each comparison training data in the first comparison training dataset includes real semantic understanding results and each non-real semantic understanding result; Based on the first comparative training dataset, the pre-trained large model is optimized and trained to obtain the medical record semantic understanding model.

8. An electronic device, characterized in that, Including memory and processor; The memory is connected to the processor and is used to store programs; The processor is configured to implement the method as described in any one of claims 1 to 6 by running a program in the memory.

9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, It includes computer program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Work order processing method and device, computer equipment and computer readable storage medium

    CN116797195A

  • Outpatient service electronic medical record generation method based on Chinese medical big model

    CN117253576A