Medical record semantic understanding method and device, equipment, medium and product

By using structured prompt word templates to generate training data sets in the medical history semantic understanding task, the problem of insufficient stability and controllability of medical history semantic understanding in the prior art is solved, and a high consistency and reliability of medical history semantic understanding effect is achieved.

CN119808791AActive Publication Date: 2025-04-11TSINGHUA UNIVERSITY +1

Patent Information

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

AI Technical Summary

Technical Problem

The prior art has problems with poor stability and controllability in the semantic understanding of medical history, especially when facing diverse application scenarios, it is difficult for the system to provide consistent and reliable output.

Method used

By obtaining prompt words for the medical semantic understanding task, using the preset prompt word template to generate a structured training data set, ensuring that the model learns how to follow control conditions during the training process, so as to achieve high consistency and reliability of medical semantic understanding in practical applications.

Benefits of technology

The stability and controllability of the medical record semantic understanding model is improved, so that the model can maintain a high degree of consistency and accuracy in diverse application scenarios, ensuring the reliability of the output results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808791A_ABST
    Figure CN119808791A_ABST
Patent Text Reader

Abstract

The invention provides a medical record semantic understanding method and device, equipment, a medium and a product, and the method comprises the steps: obtaining a cue word of a medical record semantic understanding task, the cue word is obtained by filling corresponding contents into each blank filling item in a preset cue word template, each blank filling item comprises task description, control conditions and a medical record text, the control condition is a limiting condition which needs to be followed by the medical record semantic understanding task, a pre-trained medical record semantic understanding model carries out medical record semantic understanding on the medical record text according to the cue word to obtain a medical record semantic understanding result, and the medical record semantic understanding model carries out semantic understanding on the medical record text through a training data set in a cue word template form. And performing medical record semantic understanding task training on the pre-trained large model. According to the method, the stability and controllability of the medical record semantic understanding capability of the model can be improved.
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 method, device, equipment, medium and product for semantic understanding of medical records. Background Art

[0002] Electronic medical records (EMRs) record all medical activities of patients from admission to discharge, and constitute the key basis for medical staff to conduct analysis, diagnosis and treatment. Application systems based on EMRs, such as medical record quality monitoring and medical insurance review, rely on deep semantic understanding to realize their core functions.

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

[0004] However, this type of system may lead to poor stability and controllability of medical record semantic understanding in practical applications. Summary of the invention

[0005] Based on the above-mentioned 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 objectives, this application specifically proposes the following technical solutions:

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

[0008] In some implementations, a pre-trained medical record semantic understanding model performs medical record semantic understanding in the medical record text according to the prompt words to obtain a medical record semantic understanding result, including: a pre-trained medical record semantic understanding model performs medical record semantic understanding in the medical record text according to the prompt words to obtain an initial medical record semantic understanding result; when 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 used as the final medical record semantic understanding result; when it is determined that the initial medical record semantic understanding result does not need to be modified, the initial medical record semantic understanding result is used as the final medical record semantic understanding result.

[0009] In some implementations, the medical record semantic understanding model is trained using the following steps: obtaining an original training data set, each original training data in the original training data set each including a sample medical record text and a sample medical record semantic understanding result; according to a preset prompt word template, converting the original training data set into an initial training data set in the form of the prompt word template; and optimizing and training the pre-trained large model based on 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 various dimensions, and the various dimensions include at least one of semantic granularity, contextual context, annotation details, and the output format of the medical record semantic understanding results. The semantic granularity is the content extraction granularity of the medical record semantic understanding task, the contextual context is the contextual restriction condition of the medical record semantic understanding task, and the annotation details are the restriction rules of the medical record semantic understanding task; wherein, 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 includes: extracting the 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 of 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 real semantic understanding result and each non-real semantic understanding result; optimizing 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 individual initial training data, each initial training data includes the sample medical record semantic understanding result, and the sample medical record semantic understanding result includes a real semantic understanding result or a non-real semantic understanding result; wherein, obtaining the first comparative training data set based on the initial training data set includes: for each initial training data in the individual initial training data, 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 includes violating the sub-control condition of at least one dimension, and / or, when it is determined through the initial medical record semantic understanding model that the predicted semantic understanding result corresponding to the initial training data violates the sub-control condition of at least one dimension, determining the predicted semantic understanding result corresponding to the initial training data as a non-real semantic understanding result; obtaining the first comparative training data set based on the real semantic understanding results and the non-real semantic understanding results corresponding to each of the initial training data.

[0013] In some implementations, the first comparison training data set includes various first comparison training data, and the pre-trained large model is optimized and trained based on the first comparison training data set to obtain the medical record semantic understanding model, including: for each first comparison training data in the various first comparison training data, determining the error cause and modification plan of the non-real semantic understanding result corresponding to the first comparison training data; obtaining the second comparison training data set according to the error cause and modification plan of the non-real semantic understanding result corresponding to each first comparison training data, and the real semantic understanding result; according to the second comparison training data set, the pre-trained large model is optimized and trained to obtain the medical record semantic understanding model.

[0014] According to the second aspect of an embodiment of the present application, a medical record semantic understanding device is provided, comprising: an acquisition unit, used to acquire prompt words for a medical record semantic understanding task, wherein the prompt words are obtained by filling in corresponding contents in each fill-in-the-blank item in a preset prompt word template, wherein each fill-in-the-blank item includes a task description, a control condition and a medical record text, wherein the control condition is a restriction condition that the medical record semantic understanding task must follow; a semantic understanding unit, used to perform medical record semantic understanding on the medical record text according to the prompt words by a pre-trained medical record semantic understanding model, and obtain a medical record semantic understanding result, wherein the medical record semantic understanding model is obtained by training a pre-trained large model for the medical record semantic understanding task using a training data set in the form of the prompt word template.

[0015] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory and a processor; the memory is connected to the processor and is used to store programs; the processor is used to implement the medical record semantic understanding method as described in the first aspect by running the program in the memory.

[0016] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the medical record semantic understanding method as described in the first aspect is implemented.

[0017] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer program instructions, which, when executed by a processor, cause the processor to execute: the medical record semantic understanding method as described in the first aspect.

[0018] The present application provides a method, device, equipment, medium and product for understanding medical records semantics. The method obtains prompt words for the task of understanding medical records semantics. The prompt words are generated based on a preset prompt word template. The prompt word template includes a task description, a control condition and each blank item of the medical record text, wherein the control condition defines the specific restriction conditions that the task of understanding medical records semantics must follow. Afterwards, the pre-trained medical record semantic understanding model performs medical record semantic understanding on the medical record text according to the prompt words to obtain the result of medical record semantic understanding, wherein the medical record semantic understanding model is obtained by training the pre-trained large model for the task of understanding medical records semantics through 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, it can be ensured that 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 a variety of application scenarios. The model trained in this way can accurately perform the task of understanding medical records semantics in practical applications, and exhibits stable performance and high controllability. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0020] Figure 1 A flowchart of a medical record semantic understanding method provided in an embodiment of the present application;

[0021] Figure 2 A schematic diagram of a prompt word template provided in an embodiment of the present application;

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

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

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

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

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

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

[0028] Fig. 9 A schematic diagram of the error causes and correction solutions for determining non-real semantic understanding results provided in an embodiment of the present application;

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

[0030] Fig.11 A schematic diagram of the training process of the medical record semantic understanding model provided in an embodiment of the present application;

[0031] Fig.12 A schematic diagram of the structure of a medical record semantic understanding device provided in an embodiment of the present application;

[0032] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The technical solution provided in the embodiments of the present application can be exemplarily applied to hardware devices such as processors, electronic devices, servers (including cloud servers), or packaged into software programs to be run. When the hardware device executes the processing of the technical solution of the embodiments 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 for the task can be achieved to complete the purpose of the target task. The embodiments of the present application only exemplarily introduce the specific processing 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 of the technical solution of the present application can be adopted by the embodiments of the present application.

[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0035] Before introducing this application solution, the relevant technologies are first introduced:

[0036] Electronic medical records (EMRs) record all medical activities of patients from admission to discharge, including text and image data, and become the basis for medical staff to analyze, diagnose and treat diseases. In practical applications, a series of derivative systems have been developed based on electronic medical records, such as medical record quality inspection and medical insurance review, which rely on deep semantic understanding of medical record content to realize their functions.

[0037] Traditional natural language processing (NLP) technology transforms the task of semantic understanding of medical records into an information extraction problem, including entity recognition, relationship extraction, and event detection. This process involves defining a label system based on phased requirements, and performing data annotation and model training to complete semantic parsing under specific requirements. However, as application scenarios change, fixed label systems are gradually unable to adapt to new semantic understanding requirements, resulting in reduced system performance or failure. For example, early medical record semantic understanding systems were able to extract all "symptom" entities in medical records, but when the new medical insurance review system required "only identifying the patient's previous symptoms", the system could not meet the requirements, which in turn affected the actual application efficiency.

[0038] In recent years, large language models (LLMs), such as ChatGPT, have shown great potential in the field of information extraction due to their strong generalization ability and high fit with human intentions. This type of model has accumulated extensive world knowledge and medical knowledge through large-scale pre-training, and has enhanced its ability to understand and follow complex instructions through supervised fine-tuning (SFT) and human feedback reinforcement learning (RLHF), especially under few or zero sample conditions. Therefore, this type 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, it mainly relies on multi-task learning to enhance the generalization ability in few-shot and zero-shot situations. This approach leads to insufficient stability and controllability of medical record semantic understanding in practical applications. When faced with new semantic understanding and application scenarios, this generalization ability may not provide consistent and reliable output, thus limiting the practical application effect of the system.

[0040] In view of this, the embodiments of the present application are committed to providing a method, device, equipment, medium and product for medical record semantic understanding, which integrates the advantages of a large language model with fine-grained instruction control, that is, adding control conditions to the prompt word template of the training data set to train the model's ability to follow the control conditions, so that in practical applications, when the model is used to understand the semantics of medical records, it can better follow the control conditions, meet the ever-changing needs of medical record semantic understanding, and ensure the controllability and stability of the medical record semantic understanding ability. Detailed descriptions are given one by one in the following embodiments.

[0041] Exemplary Methods

[0042] Figure 1 A flowchart of a medical record semantic understanding method provided in an embodiment of the present application. Figure 1 As shown, the medical record semantic understanding method provided in this embodiment includes step S101 and step S102:

[0043] S101. Obtain prompt words for the medical record semantic understanding task.

[0044] In step S101, structured prompt words are obtained and used to guide the large language model LLM to perform the medical record semantic understanding task to achieve accurate parsing of the medical record text.

[0045] The prompt words are obtained by filling in the corresponding content in each fill-in-the-blank item in the preset prompt word template. The fill-in-the-blank items include task description, control conditions and medical record text, which aims to ensure that the model can fully call on the knowledge and capabilities of the relevant fields to follow the detailed control conditions to complete the medical record semantic understanding task. The prompt word template can be understood as a template framework for realizing the medical record semantic understanding task.

[0046] Figure 2 Schematic diagram of a prompt word template provided in an embodiment of the present application. Figure 2 As shown in the figure, the prompt word template includes fill-in-the-blank items corresponding to the role description, task description, control conditions and medical record text. Among them, the role description part defines the identity setting for performing the task so that the model can better simulate the behavior pattern of professionals. The task description details the specific work content to be completed. The control conditions set the specific restrictions that the medical record semantic understanding task must follow, that is, the fine restrictions that need to be followed to complete the current medical record semantic understanding task, to ensure the accuracy and consistency of the output results. The medical record text part is used to place the actual medical record text to be processed.

[0047] This structured prompt word template not only clarifies the specific requirements of each task, but also provides the model with a clear operating guide to ensure that it can accurately follow the preset rules and conditions when parsing medical record texts.

[0048] In order to further improve the controllability and stability of medical record semantic understanding, Figure 3 The schematic diagram of the control conditions provided in the embodiment of the present application is shown. Figure 3 As shown in the figure, the control conditions can be subdivided into sub-control conditions of various dimensions, each of which includes at least one of the following: semantic granularity, context, annotation details, and output format of medical record semantic understanding results. These sub-control conditions provide detailed guidance for the medical record semantic understanding task, ensuring that the model can strictly abide by the set rules when performing the medical record semantic understanding task, thereby generating high-quality parsing results.

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

[0050] Among them, semantic granularity defines the accuracy level of semantic extraction, that is, the content extraction granularity of the medical record semantic understanding task, which is used to control the granularity of semantic recognition, including concept granularity, fragment granularity and chapter granularity. Concept granularity is usually composed of characters or words, focusing on single words or phrases, such as "headache", "dizziness", etc. Fragment granularity consists of phrases or short text fragments composed of events of the same type, such as "taking amoxicillin twice a day, and then getting better." Chapter granularity contains multiple events of different types, usually a longer text paragraph, such as "the patient had a headache for three days, took amoxicillin twice a day, and then got better."

[0051] The contextual context sets background restrictions for the semantic understanding of medical records, which are contextual restrictions for the task of semantic understanding of medical records, including tense restrictions, negative context restrictions, and disease-related knowledge restrictions. Among them, tense restrictions refer to restrictions related to the current moment, such as "only identify relevant information in the content related to this hospitalization, and avoid identifying relevant information during the patient's previous hospitalization", which aims to limit the focus to content related to the patient's current hospitalization (i.e. the present moment). Negative context restrictions are intended to limit the identification of relevant information in negative contexts when performing semantic understanding of medical records, and avoid identifying information in positive contexts. Disease-related knowledge restrictions are intended to limit the identification of relevant information in the text describing the patient's specific condition when performing semantic understanding of medical records, and avoid identifying information in irrelevant descriptions, thereby ensuring that only information directly related to the condition is identified.

[0052] The annotation rules are the restriction rules for the medical record semantic understanding task, which are a series of rules customized by users according to their own needs. For example, "When identifying the body part, if there is a directional word describing the body part, please identify it at the same time." The directional word describing the body part is the annotation rule. By capturing the directional description while identifying the body part, the accuracy of semantic annotation is improved.

[0053] The output format specifies the presentation method of the results of medical record semantic understanding, aiming to limit the output of medical record semantic understanding results to a specified format, for example, returning them in the form of key-value pairs, such as "Please return in the format of ("label": "annotation content"). Specifically, it can be: ("part", "head") or ("symptoms", "fatigue")", to ensure that the results are easy to parse and use.

[0054] Figure 4 Schematic diagram of a prompt word example provided in the embodiment of the present application. Figure 4 As shown, for the medical record semantic understanding task, the role description can be "You are an expert in medical record semantic understanding."

[0055] The task description requires extracting candidate tags from the medical record text, taking into account candidate tags and control conditions, for example, "Please extract the corresponding tags from the target text based on "candidate tags" and "control conditions".\nCandidate tags\nSymptoms: Symptoms refer to the patient's own experience and feelings of abnormal physiological functions of the body caused by the disease, or abnormal manifestations, and abnormal test results expressed explicitly. For example, "The patient reported that he had a poor appetite, drowsiness, and fear of cold recently", "loss of appetite", "drowsiness", and "fear of cold" are all symptom entities."

[0056] Control conditions can be specific to the semantic granularity (such as the conceptual granularity of "headache", "dizziness") and context (such as limited to relevant information related to this hospitalization).

[0057] The medical record text reads: "The patient came to our hospital for treatment after suffering from a headache for three days and coughing and fatigue. Currently, the symptoms have improved and only a slight cough remains."

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

[0059] Continue reading Figure 1 , after step S101, the medical record semantic understanding method of this embodiment further includes step S102.

[0060] S102. A pre-trained medical record semantic understanding model performs medical record semantic understanding on the medical record text according to prompt words to obtain a 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 a training data set in the form of prompt word templates.

[0061] In step S102, the prompt words are input into the pre-trained medical record semantic understanding model, so that the model can perform semantic understanding on the medical record text according to the prompt words, and finally obtain the medical record semantic understanding result. The model is obtained by training the pre-trained large model with 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 the medical record text, ensuring the consistency and accuracy of the output results. In order to describe this process in more detail, step S102 specifically includes steps a1 to a3:

[0062] Step a1: The pre-trained medical record semantic understanding model performs medical record semantic understanding in the medical record text according to the prompt words to obtain an initial medical record semantic understanding result.

[0063] By inputting the prompt words 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. According to the control conditions set in the prompt words, the model executes the specific work content specified in the task description, performs semantic understanding of the medical record text, and obtains the initial medical record semantic understanding results.

[0064] Step a2: When 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 used as the final medical record semantic understanding result.

[0065] After obtaining the initial medical record semantic understanding result, the model can be used to check whether the initial medical record semantic understanding result meets the control conditions set in the prompt words. 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 modify the initial medical record semantic understanding result in a targeted manner until all control conditions are followed, thereby ensuring the accuracy and consistency of the final output.

[0066] Step a3: When it is determined that the initial medical record semantic understanding result does not need to be modified, the initial medical record semantic understanding result is used as the final medical record semantic understanding result.

[0067] When the model is used to check whether the initial medical record semantic understanding result meets the control conditions set in the prompt words, 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 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 produce semantic understanding results that meet the task requirements and have 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 embodiment, the specific implementation process of applying the medical record semantic understanding model to perform medical record semantic understanding is introduced. In order to make the model perform well in practical applications, the medical record semantic understanding model needs to be pre-trained. The following will describe in detail the training method of the medical record semantic understanding model with reference to the accompanying drawings:

[0070] Figure 5 Flow chart of the training method of the medical record semantic understanding model provided in the embodiment of the present application. Figure 5 As shown, the training method of the medical record semantic understanding model includes the following steps S501 to S503:

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

[0072] To ensure the quality and diversity of training data, original training data sets can be obtained from multiple channels, such as from public medical data sets or data sets published by medical institutions, or by using medical knowledge bases and natural language generation technology to generate virtual medical record texts and their semantic understanding results that conform to actual conditions according to preset rules, or by transforming, expanding or combining existing data to generate new training samples, or by obtaining high-quality medical data sets that have been cleaned, labeled and organized from third-party data service providers.

[0073] Each original training data can be as follows: For example, the sample medical record text is "The patient had a long-term cough and sputum in the past, and took cough medicine to control the condition. Today, he had a severe cough and coughed up blood, and his body temperature was 38.1, so he came to our hospital for treatment." The semantic understanding result of the sample medical record is "Symptoms: cough; Symptoms: coughing up blood".

[0074] S502: According to a preset prompt word template, the original training data set is converted into an initial training data set in the form of a prompt word template.

[0075] Step S502 aims to extract the corresponding contents of the role description, task description, control conditions and medical record text from the original training data to ensure that each training sample conforms to the structured format required for model training.

[0076] The role description part defines the identity settings for performing tasks, so that the model can simulate the behavior patterns of professionals. As mentioned above, this part can refer to the role description settings introduced earlier, and will not be repeated here.

[0077] The task description should clearly state the specific task that needs to be completed, and explain in detail the labels and label explanations involved. By summarizing the sample medical record text and the semantic understanding results of the sample medical records in the original training data set, specific task requirements can be extracted. Labels include not only the original labels corresponding to the original training data, but also labels randomly sampled in the original training data set to increase the diversity and generalization ability of the training data. Label explanations are obtained according to the annotation specifications to ensure that each label has a clear definition and sample explanation. For example, the definition, usage scenarios, and typical examples of labels can be obtained from the annotation specifications 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 dimensions such as semantic granularity, context, annotation details, and output format. For details, please refer to the detailed description of the control conditions above.

[0079] The medical record text section is used to place the actual medical record text to be processed, that is, the sample medical record text in the original training data. Ensure that the text content is complete and correct so that the model can perform effective semantic analysis based on real medical records.

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

[0081] Step b1: extracting the sub-control condition contents corresponding to the sub-control conditions of each dimension from the original training data set.

[0082] Extract the sub-control condition contents of each dimension from the original training data set. Specifically, it is necessary to identify and separate the contents related to different sub-control conditions from all the medical record texts in the original training data set. These sub-control conditions cover multiple dimensions, such as semantic granularity, context, annotation details, and output format. Through data processing and analysis, it can ensure that the sub-control condition contents under each dimension are accurately extracted, and provide a solid foundation for the subsequent generation of prompt word templates.

[0083] For example, when processing semantic granularity, we can identify concept granularity (such as "headache", "dizziness"), fragment granularity (such as "taking amoxicillin twice a day, and it got better"), and chapter granularity (such as "the patient had a headache for three days, took amoxicillin twice a day, and it got better"). For contextual context, we need to distinguish between tense restrictions (such as limited to information related to this hospitalization), negative context restrictions (such as identifying symptom descriptions in negative sentences), and disease-related knowledge restrictions (such as focusing on key information in the description of the condition). The annotation details involve specific rule settings, such as requiring the simultaneous identification of the part and its orientation description. Finally, the output format specifies how the results are presented, such as returning them in the form of key-value pairs.

[0084] In order to ensure that the sub-control condition content of each dimension can be accurately extracted, the original training data set can be summarized to obtain the description content of the semantic granularity corresponding to each original training data. Based on the pre-set annotation guidelines, detailed annotation details are obtained to ensure that the label definition is clear and consistent. For the output format, it can be selected from a variety of pre-set output formats. For the context part, it can be obtained by splitting or combining existing labels. For example, the original training data requires the identification of "denial of disease" in the sample medical record text. At this time, the label of "denial of disease" can be split into "denial of contextual restrictions" and identification of "disease" labels to enhance the model's understanding ability.

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

[0086] After the sub-control condition content is extracted, an initial training data set in the form of a prompt word template is constructed based on the content in step b2. The core of this step is to integrate the extracted sub-control condition content into the preset prompt word template structure to form a series of more instructive and more precise task instructions. Each prompt word template includes a role description, a task description, a control condition, and a target text fill-in-the-blank item, which is intended to simulate the working environment of professionals so that the model can fully call on the knowledge and capabilities of related fields to complete specific tasks.

[0087] In specific implementation, each part of the prompt word template can be filled in 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 "Please extract the corresponding label from the target text based on the 'candidate label' and 'control condition'". Then, according to the previously extracted sub-control condition content, fill in the corresponding control conditions in detail, such as semantic granularity, contextual context, etc. Finally, insert the medical record text to be parsed into the target text fill-in-the-blank item to construct a complete sample prompt word. In this way, the generated sample prompt words not only reflect the key information of the original medical record text, but also incorporate detailed control conditions, ensuring that the model can learn to accurately understand and perform medical record semantic understanding tasks while following the control conditions during the training process.

[0088] The sample prompt words constructed in this way not only reflect the key information of the original medical record text, but also incorporate detailed control conditions to ensure that the model can learn how to follow the control conditions to accurately understand and perform medical record semantic understanding tasks during the training process. This structured training dataset provides the model with rich guidance information, enhancing its adaptability and reliability in complex and changing application scenarios.

[0089] Continue reading Figure 5 , after step S502, it also includes step S503.

[0090] S503. Optimize and train the pre-trained large model based on 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. This embodiment provides multiple implementation methods, which are as follows:

[0092] In some implementations, step S503 includes: performing supervised finetuning (SFT) on the pre-trained large model using a target training data set to obtain an initial medical record semantic understanding model M1, and using model M1 as the final medical record semantic understanding model M0.

[0093] In some implementations, 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 in accordance with these sub-control conditions, the model's ability to follow the control conditions can be improved by contrastive learning. Contrastive learning requires the construction of a contrastive training data set. The specific implementation process of constructing a contrastive training data set will be described in detail below.

[0094] Figure 6 This is a flowchart of the comparative training process of the medical record semantic understanding model provided in the embodiment of the present application. Figure 6 As shown, step S503 includes the following steps S601 and S602:

[0095] Step S601: Obtain a first comparative training data set according to the initial training data set, wherein each first comparative training data in the first comparative training data set includes a true semantic understanding result and each non-true semantic understanding result.

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

[0097] In step S601, the first comparison sample data set may be obtained by "generating an erroneous sample that violates a control condition" and / or "selecting an erroneous sample from multiple samplings".

[0098] In some implementations, when step S601 adopts the method of "generating erroneous samples that violate control conditions" to obtain the first comparison sample data set, it includes: for each initial training data in each initial training data, modifying the real semantic understanding result corresponding to the initial training data into a non-real semantic understanding result according to a preset control condition modification strategy, the control condition modification strategy includes violating a sub-control condition of at least one dimension; according to the real semantic understanding results and the non-real semantic understanding results corresponding to each initial training data, a first comparison training data set is obtained.

[0099] For each initial training data in the initial training data set, an auxiliary model (such as Qwen2.5) can be used to modify the semantic understanding results (i.e., answers) of the sample medical records in each initial training data, so that the answers violate at least one sub-control condition.

[0100] Figure 7 A schematic diagram of constructing a comparative training data set provided in an embodiment of the present application. Figure 7 As shown in the figure, by adding prompt words to guide the modification of the answer, ensure that the modified answer contains specific errors. 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 prompt words to modify the answer, the details are as follows:

[0101] “Please modify the [answer] above so that the modified answer contains the following error: “At least one sub-control condition is violated”.

[0102] Require:

[0103] 1. When answering, please output in the format of [Answer modification plan]: "***", [Modified incorrect answer]: "***".

[0104] The [Answer Modification Plan] is used to describe what kind of logical modification should be followed if a given answer is to be modified into an incorrect answer;

[0105] [The modified wrong answer] is an answer with some errors obtained after modification according to the modification plan, and the modified wrong answer is kept at least 60% similar to the original answer.

[0106] 2. Except for the [Answer Modification Plan] section, no reason for modification is required for other sections.

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

[0108] In some implementations, when step S601 adopts the method of "selecting erroneous samples from multiple samplings" to obtain the first comparison sample data set, it includes: when determining through the initial medical record semantic understanding model M1 that the predicted semantic understanding result corresponding to the initial training data violates the sub-control condition of at least one dimension, the predicted semantic understanding result corresponding to the initial training data is determined as a non-real semantic understanding result; and the first comparison training data set is obtained according to the real semantic understanding results and non-real semantic understanding results corresponding to each initial training data.

[0109] In this implementation, the purpose is to generate predicted semantic understanding results (i.e., answers) for each initial training data in the initial training data set through the initial medical record semantic understanding model M1 for each initial training data, thereby obtaining multiple predicted semantic understanding results. Then, the correctness of the multiple predicted semantic understanding results is analyzed through an auxiliary model (such as Qwen2.5), such as analyzing whether the multiple predicted semantic understanding results accurately follow the control conditions, and selecting the predicted semantic understanding results that do not follow the control conditions as non-real semantic understanding results for constructing the first comparative training data set.

[0110] Figure 8 Another schematic diagram of constructing a comparative training data set provided in an embodiment of the present application. Figure 8As shown in the figure, by checking the prompt words, we analyze whether the answer violates a certain sub-control condition and give the corresponding conclusion. 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 prompt words to check the answer, the details are as follows:

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

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

[0113] Of course, in some embodiments, step S601 can also use the methods of "generating an erroneous sample that violates the control condition" and "selecting an erroneous sample from multiple samplings" to jointly obtain a non-real semantic understanding result. This allows each initial training data to correspond to a real semantic understanding result and at least one non-real semantic understanding result, forming a first comparative training data set.

[0114] Through the above embodiment, each initial training data may 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 constitute a first comparative training data set.

[0115] Continue reading Figure 6 , after step S601, step S602 may also be included.

[0116] Step S602: Optimize and train the pre-trained large model based on the first comparative training data set to obtain a medical record semantic understanding model.

[0117] There are many ways to implement step S602, which can be specifically as follows:

[0118] In some implementations, step S602 includes: after obtaining the first comparative training data set, the initial medical record semantic understanding model M1 can be directly trained by comparative learning through the first comparative training data set to obtain an intermediate medical record semantic understanding model M2, and the intermediate medical record semantic understanding model M2 is used 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 there is still room for further improvement.

[0120] In some implementations, in order to further improve the ability of model M1 to follow control conditions, a second comparative training data set can be constructed based on the first comparative training data set, and the interpretable second comparative training data set is used to train model M1 to discover the core differences between positive and negative samples, thereby obtaining a more controllable medical record semantic understanding model M0. Specifically, step S602 includes steps c1, c2, and c3:

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

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

[0123] Fig. 9 This is a schematic diagram of the error causes and modification solutions for determining non-real semantic understanding results provided by the embodiment of the present application. Fig. 9 As shown in the figure, it shows the process of determining the error causes and modification solutions for non-real semantic understanding results, in which the prompt words for analyzing and modifying the predicted answers are added to guide the model to identify and correct errors. The prompt words for analyzing and modifying the predicted answers are added to the prompt words corresponding to the initial training data on the left side of the arrow, as follows:

[0124] For the above tasks, take the "standard answer" as the completely correct answer. Refer to the "standard answer" to analyze whether there are any errors in the "predicted answer". If there are any errors, please analyze the errors and explain how to correct them.

[0125] 1. When answering, please give the conclusion first. If there is an error, please answer "The predicted answer is wrong". If there is no error, please answer "The predicted answer is completely correct".

[0126] 2. After giving the error analysis, there is no need to give the modification results.

[0127] 3. There should not be any analysis or discussion about the standard answers in the entire analysis and summary. The standard answers here are only implicit reference knowledge and cannot be mentioned explicitly.

[0128] Continue reading Fig. 9 ,To the right of the arrow in the figure is the error situation analysis and summary.

[0129] Step c2: obtaining a second comparative training data set according to the error causes and modification solutions of the non-real semantic understanding results corresponding to each of the first comparative training data, and the real semantic understanding results.

[0130] The comparative training data set includes various comparative training data, and each comparative training data has a one-to-one correspondence with each initial comparative training data. That is, each initial comparative training data can correspond to one comparative training data. The answer part of each comparative training data includes the error cause and modification plan of the real semantic understanding result and the non-real semantic understanding result.

[0131] Fig.10 Schematic diagram of constructing a second comparative training data set provided in an embodiment of the present application. Fig.10 As shown in the figure, it shows how to Fig. 9 On the basis of the previous method, the prompt word of the "re-prediction" part is added, and the "non-real answer + analysis process + real answer" is used as explainable comparative training data to obtain the second comparative training data set, so that the model can have the ability to re-predict, and further improve the controllability and stability of the medical record semantic understanding ability.

[0132] Step c3: Based on the second comparative training data set, the pre-trained large model is optimized and trained to obtain a medical record semantic understanding model.

[0133] The second comparative training data set includes not only the real semantic understanding results, but also the non-real semantic understanding results and their error causes. Therefore, the second comparative training data set can also be called an explainable comparative training data set. By optimizing the model M1 through the second comparative training data set, the model can learn the subtle differences between the real semantic understanding results and the non-real semantic understanding results from the reasoning process, and learn to analyze and follow such subtle differences. In this way, continuing training on the basis of M1 can obtain the medical record semantic understanding model M0, which 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 whether the initial medical record semantic understanding results need to be modified, the initial training data set can also be added to the second comparison training data set, and the pre-trained large model can be optimized and trained to obtain a medical record semantic understanding model.

[0135] In summary, the medical record semantic understanding method proposed in this application makes the task logic clearer and easier to execute by abstracting the medical record semantic understanding task into task descriptions and control conditions. Furthermore, according to actual application needs, multiple sub-control dimensions of medical record semantic understanding are summarized and defined, and each type of sub-control dimension is subdivided into detailed items. This process not only enhances the generalization ability of the model for complex control conditions, but also improves its controllability in medical record semantic understanding tasks. In addition, this application introduces an error analysis path to associate true semantic understanding results (positive samples) with non-true semantic understanding results (negative samples). By deeply analyzing the error causes of non-true semantic understanding results, the model can capture features more accurately during the training process, thereby 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 into three parts: data rewriting, building comparative training data, and comparative training. Fig.11 As shown, specifically including:

[0137] (1) Data rewriting

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

[0139] (2) Constructing a comparative training dataset

[0140] The first comparative training data set is obtained by generating or selecting negative samples based on the initial training data set. The generation of negative samples is to guide the LLM to generate non-real answers that violate any sub-control condition. The selection of negative samples is to make the model M1 sample each initial training data multiple times and select non-real answers from the multiple sampling results, so that 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] In order to further improve the controllability of the model's medical record semantic understanding task, we can also analyze the causes of the errors in the above negative samples and provide modification plans, and use the "non-real answers + analysis process + real answers" as explainable comparative training data to obtain the second comparative training data set.

[0142] (3) Contrast training

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

[0144] Exemplary Devices

[0145] Corresponding to the above-mentioned method for semantic understanding of medical records, an embodiment of the present application also provides a device for semantic understanding of medical records. Fig.12 Schematic diagram of a medical record semantic understanding device provided in an embodiment of the present application. Fig.12 As shown, the medical record semantic understanding device provided in the embodiment of the present application includes: an acquisition unit 1201 and a semantic understanding unit 1202; wherein, the acquisition unit 1201 is used to acquire prompt words for the medical record semantic understanding task, and the prompt words are obtained by filling in corresponding contents in each fill-in-the-blank item in a preset prompt word template, and the each fill-in-the-blank item includes a task description, a control condition and a medical record text, and the control condition is a restriction condition that the medical record semantic understanding task must follow; the semantic understanding unit 1202 is used to perform medical record semantic understanding on the medical record text according to the prompt words by a pre-trained medical record semantic understanding model to obtain a medical record semantic understanding result, and the medical record semantic understanding model is obtained by training the pre-trained large model for the medical record semantic understanding task using the training data set in the form of the prompt word template.

[0146] In some embodiments, when the semantic understanding unit 1202 is used to perform medical record semantic understanding in the medical record text according to the prompt words by a pre-trained medical record semantic understanding model to obtain a medical record semantic understanding result, it specifically includes: performing medical record semantic understanding in the medical record text according to the prompt words by a pre-trained medical record semantic understanding model to obtain an initial medical record semantic understanding result; when it is determined that the initial medical record semantic understanding result needs to be modified, modifying the initial medical record semantic understanding result and using the modified medical record semantic understanding result as the final medical record semantic understanding result; when it is determined that the initial medical record semantic understanding result does not need to be modified, using 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 using the following steps: obtaining an original training data set, each original training data in the original training data set each including a sample medical record text and a sample medical record semantic understanding result; according to a preset prompt word template, converting the original training data set into an initial training data set in the form of the prompt word template; optimizing and training the pre-trained large model based on the initial training data set to obtain the medical record semantic understanding model.

[0148] In some embodiments, the control conditions include sub-control conditions of various dimensions, and the various dimensions include at least one of semantic granularity, contextual context, annotation details and the output format of the medical record semantic understanding results. The semantic granularity is the content extraction granularity of the medical record semantic understanding task, the contextual context is the contextual restriction condition of the medical record semantic understanding task, and the annotation details are the restriction rules of the medical record semantic understanding task; wherein, 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 includes: extracting the 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.

[0149] In some embodiments, the optimizing training of 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 real semantic understanding result and each non-real semantic understanding result; optimizing 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 individual initial training data, each initial training data includes the sample medical record semantic understanding result, and the sample medical record semantic understanding result includes a real semantic understanding result or a non-real semantic understanding result; wherein, obtaining a first comparative training data set based on the initial training data set includes: for each initial training data in the individual initial training data, 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 includes violating the sub-control condition of at least one dimension, and / or, when it is determined through the initial medical record semantic understanding model that the predicted semantic understanding result corresponding to the initial training data violates the sub-control condition of at least one dimension, the predicted semantic understanding result corresponding to the initial training data is determined to be a non-real semantic understanding result; the first comparative training data set is obtained according to the real semantic understanding results and the non-real semantic understanding results corresponding to each of the initial training data.

[0151] In some embodiments, the first comparison training data set includes various first comparison training data, and the pre-trained large model is optimized and trained according to the first comparison training data set to obtain the medical record semantic understanding model, including: for each first comparison training data in the various first comparison training data, determining the error cause and modification plan of the non-real semantic understanding result corresponding to the first comparison training data; obtaining the second comparison training data set according to the error cause and modification plan of the non-real semantic understanding result corresponding to each first comparison training data, and the real semantic understanding result; according to the second comparison training data set, the pre-trained large model is optimized and trained 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 embodiments of this application, and can execute the medical record semantic understanding method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the medical record semantic understanding method. For technical details not fully described in this embodiment, please refer to the specific processing content of the medical record semantic understanding method provided in the above embodiments of this application, and will not be repeated 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 respectively, and the embodiments of the present application are not limited thereto.

[0154] It should be understood that the units in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits. 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 some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by the configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the remaining part is implemented in the form of hardware circuits.

[0155] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.

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

[0157] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0158] Exemplary Electronic Devices

[0159] The present application embodiment provides an electronic device, see Fig.13 As shown, the electronic device includes:

[0160] Memory 200 and processor 210;

[0161] The memory 200 is connected to the processor 210 and is used to store programs;

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

[0163] Specifically, the electronic device may 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 to each other via a bus.

[0165] A bus may include a pathway that transfers information between components of a computer system.

[0166] The processor 210 may 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 the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0167] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.

[0168] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.

[0169] The input device 230 may include a device for receiving 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.

[0170] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.

[0171] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.

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

[0173] An embodiment of the present application also proposes a chip, which includes a processor and a data interface. The processor reads and runs the program stored in the memory through the data interface to execute the medical record semantic understanding method introduced in any of the above embodiments. The specific processing process and its beneficial effects can be found in the introduction to the embodiment of the medical record semantic understanding method mentioned above.

[0174] Exemplary computer program products and storage media

[0175] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the medical record semantic understanding method according to various embodiments of the present application described in any of the above embodiments of this specification.

[0176] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the 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 may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to execute the steps of the medical record semantic understanding method according to various embodiments of the present application described in any of the above embodiments of this specification, and specifically the following steps may be implemented:

[0178] Step S101, obtaining prompt words for the medical record semantic understanding task, wherein the prompt words are obtained by filling in corresponding contents in each fill-in-the-blank item in a preset prompt word template, wherein each fill-in-the-blank item includes a task description, a control condition and a medical record text, and the control condition is a restriction condition that the medical record semantic understanding task must follow.

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

[0180] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0181] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

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

[0183] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.

[0184] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0185] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0186] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.

[0187] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0188] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may 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 article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0190] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for understanding medical record semantics, characterized in that: include: Obtaining prompt words for the medical record semantic understanding task, wherein the prompt words are obtained by filling in corresponding contents in each fill-in-the-blank item in a preset prompt word template, wherein each fill-in-the-blank item includes a task description, a control condition, and a medical record text, wherein the control condition is a restriction condition that the medical record semantic understanding task must follow; The pre-trained medical record semantic understanding model performs medical record semantic understanding on the medical record text according to the prompt words to obtain a medical record semantic understanding result. The medical record semantic understanding model is obtained by training the pre-trained large model for the medical record semantic understanding task using the training data set in the form of the prompt word template.

2. The method according to claim 1, characterized in that The pre-trained medical record semantic understanding model performs medical record semantic understanding in the medical record text according to the prompt words to obtain medical record semantic understanding results, including: The pre-trained medical record semantic understanding model performs medical record semantic understanding in the medical record text according to the prompt words 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 using the modified medical record semantic understanding result as the final medical record semantic understanding result; When it is determined that the initial medical record semantic understanding result does not need to be modified, the initial medical record semantic understanding result is used as the final medical record semantic understanding result.

3. The method according to claim 1, characterized in that The medical record semantic understanding model is trained by the following steps: Acquire an original training data set, wherein each original training data in the original training data set includes a sample medical record text and a sample medical record semantic understanding result; According to a preset prompt word template, converting the original training data set into an initial training data set in the form of the prompt word template; The pre-trained large model is optimized and trained according to the initial training data set to obtain the medical record semantic understanding model.

4. The method according to claim 3, characterized in that The control condition includes sub-control conditions of each dimension, and each dimension includes at least one of semantic granularity, context, annotation details, and 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 context is the context restriction condition of the medical record semantic understanding task, and the annotation details are the restriction rules of the medical record semantic understanding task; The step of 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 includes: Extracting the sub-control condition contents corresponding to the sub-control conditions of each dimension from the original training data set; An initial training data set in the form of the prompt word template is obtained according to the sub-control condition contents corresponding to the sub-control conditions of each dimension.

5. The method according to claim 3 or 4, characterized in that: The step of optimizing and training the pre-trained large model according to the initial training data set to obtain the medical record semantic understanding model includes: According to the initial training data set, a first comparative training data set is obtained, wherein each comparative training data in the first comparative training data set includes a real semantic understanding result and each non-real semantic understanding result; The pre-trained large model is optimized and trained according to the first comparison training data set to obtain the medical record semantic understanding model.

6. The method according to claim 5, characterized in that The initial training data set includes each initial training data, each initial training data includes the sample medical record semantic understanding result, and the sample medical record semantic understanding result includes a true semantic understanding result or a non-true semantic understanding result; Wherein, obtaining a first comparative training data set according to the initial training data set includes: For each of the initial training data, modify the real semantic understanding result corresponding to the initial training data into a non-real semantic understanding result according to a preset control condition modification strategy, wherein the control condition modification strategy includes violating a sub-control condition of at least one dimension, and / or, when it is determined through the initial medical record semantic understanding model that the predicted semantic understanding result corresponding to the initial training data violates the sub-control condition of at least one dimension, determine the predicted semantic understanding result corresponding to the initial training data as a non-real semantic understanding result; The first comparison training data set is obtained according to the real semantic understanding results and the non-real semantic understanding results corresponding to each of the initial training data.

7. The method according to claim 5, characterized in that The first comparison training data set includes various first comparison training data, and the pre-trained large model is optimized and trained according to the first comparison training data set to obtain the medical record semantic understanding model, including: For each first comparison training data in the first comparison training data, determining an error cause and a modification plan for the non-real semantic understanding result corresponding to the first comparison training data; Obtaining a second comparative training data set according to the error causes and modification solutions of the non-real semantic understanding results corresponding to each of the first comparative training data, and the real semantic understanding results; According to the second comparison training data set, the pre-trained large model is optimized and trained to obtain the medical record semantic understanding model.

8. A medical record semantic understanding device, characterized in that: include: An acquisition unit, used to acquire a prompt word for a medical record semantic understanding task, wherein the prompt word is obtained by filling in corresponding contents in each fill-in-the-blank item in a preset prompt word template, wherein each fill-in-the-blank item includes a task description, a control condition, and a medical record text, wherein the control condition is a restriction condition that the medical record semantic understanding task must comply with; A semantic understanding unit is used to perform medical record semantic understanding on the medical record text according to the prompt words by a pre-trained medical record semantic understanding model to obtain a medical record semantic understanding result. The medical record semantic understanding model is obtained by training a pre-trained large model for a medical record semantic understanding task using a training data set in the form of a prompt word template.

9. 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 according to any one of claims 1 to 7 by running the program in the memory.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, cause the processor to implement the method as claimed in any one of claims 1 to 7.

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

  • Method for automatically generating music description text based on large language model with music understanding ability

    CN118800239A

  • Special disease library production method, system and equipment and storage medium

    CN118939805A

Cited By

  • Training data construction method and device for large language model in stomatology field

    CN120873586A

  • Multi-modal data semantic retrieval method and device, equipment and storage medium

    CN120950705A