Method and apparatus for extracting medical events

By using named entity recognition and event argument filling models to process electronic medical records, the problem of difficult information extraction from electronic medical records is solved, improving information processing efficiency and medical service quality, and supporting information extraction in complex scenarios.

CN117009442BActive Publication Date: 2026-03-31ENJOYOR COMPANY LIMITED
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing electronic medical records have limited functionality and cannot effectively extract information, leading to a decline in medical quality, an increased risk of medical disputes, reduced data reliability and utilization value, and impacting statistical analysis and scientific research. Furthermore, inadequate storage and management result in resource waste and security threats.

Method used

The named entity recognition model and the event argument filling model are used to process medical electronic medical records. By using named entity recognition and event extraction, structured event information is generated and the target medical event is identified.

Benefits of technology

It has improved the efficiency of medical information processing, enhanced the quality of medical services, laid the foundation for subsequent alignment and integration of medical knowledge, and increased the speed of information extraction and the ability to cope with complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009442B_ABST
    Figure CN117009442B_ABST
Patent Text Reader

Abstract

The application discloses a medical event extraction method and device. The medical event extraction method comprises the following steps: inputting a medical electronic medical record into a trained named entity recognition model for recognition to obtain a named entity recognition result; inputting the named entity recognition result into a trained event argument filling model for event extraction to obtain structured event information; and determining a target medical event in the medical electronic medical record according to the structured event information. The scheme provided by the application can improve the efficiency of medical information processing and the quality of medical services, and lay a foundation for subsequent medical knowledge alignment and fusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet technology applications, and in particular to a method and apparatus for extracting medical events. Background Technology

[0002] In the medical field, digital tools such as electronic medical records (EMRs) can efficiently record patients' medical information. Taking EMRs as an example, their advantages include the ability to quickly determine appropriate treatment decisions and convenient storage.

[0003] However, electronic medical records (EMRs) are often stored in written form, making semantic analysis and retrieval impossible, thus hindering information extraction. Furthermore, traditional EMRs suffer from issues such as missing content, errors, and duplication, leading to the following drawbacks: impacting medical quality and safety, increasing the risk of medical disputes, reducing data reliability and utilization value, and hindering statistical analysis and research. These deficiencies not only affect hospital management and evaluation but may also diminish the legal status and evidentiary value of EMRs. Simultaneously, inadequate storage and management systems can lead to doctors implementing treatments that do not align with treatment goals, wasting medical resources and potentially threatening patients' lives and property.

[0004] There is currently no effective solution to the problem that existing electronic medical records have limited functionality and cannot extract useful information. Summary of the Invention

[0005] To address the aforementioned technical problems, embodiments of the present invention aim to provide a method and apparatus for extracting medical events, thereby at least resolving the issue that existing electronic medical records have limited functionality and are unable to extract effective information.

[0006] The technical solution of this invention is implemented as follows:

[0007] This invention provides a method for extracting medical events, comprising: inputting a medical electronic medical record into a trained named entity recognition model for recognition, obtaining named entity recognition results; inputting the named entity recognition results into a trained event argument filling model for event extraction, obtaining structured event information; and determining the target medical event in the medical electronic medical record based on the structured event information.

[0008] Optionally, before training the named entity recognition model and the event argument filling model, the method further includes: obtaining medical electronic medical record data, preset event argument roles, and named entity recognition types from a medical database; labeling the medical electronic medical record data according to the named entity recognition types to obtain entity information in the medical electronic medical record data; labeling the medical electronic medical record data according to the preset event argument roles to obtain event information in the medical electronic medical record data; generating a dataset file based on the medical electronic medical record data, event information, and entity information; and generating training data and test data based on the dataset file. The event information includes: label data for preset event argument roles, which include: subject words, descriptive words, anatomical locations, and occurrence status; the entity information includes: label data for named entity recognition types, which include: disease name, location of onset, symptoms, and patient status.

[0009] Further, optionally, a named entity recognition model is trained to obtain a trained named entity recognition model. The training of the named entity recognition model to obtain a trained named entity recognition model includes: inputting training data into the named entity recognition model, performing BIO annotation on the entities in the training data to obtain annotation results, calculating the loss function based on the annotation results and performing backpropagation to obtain entity extraction results, until the named entity recognition model converges to obtain a trained named entity recognition model. The training data includes: medical electronic medical record data and named entity recognition label data.

[0010] Optionally, the method further includes: training an event argument filling model to obtain a trained event argument filling model, wherein training the event argument filling model to obtain a trained event argument filling model includes: inputting medical electronic medical record data, label data of preset event argument roles, and entity extraction results obtained from a named entity recognition model into the event argument filling model; extracting word vectors from the medical electronic medical record data using BERT in the event argument filling model; generating entity vectors from the word vectors through max pooling; superimposing entity position codes on the entity vectors to obtain entity vectors with superimposed entity position codes; and inputting the entity vectors with superimposed entity position codes into an entity vector encoder for encoding to obtain... The encoded entity vectors are then superimposed with the argument role codes to obtain superimposed data. This superimposed data is concatenated with the argument cache queue and input into the event argument decoder. The event argument decoder extracts the entity vectors of the corresponding event argument roles from the concatenated superimposed data and the argument cache queue according to a preset threshold and saves them to the argument cache queue. A special vector is added to the argument cache queue for separation, and a loss function is calculated based on the preset event argument role label data. The average of the calculated loss function is then used for backpropagation. This process continues until the event argument filling model converges, resulting in the trained event argument filling model. The argument cache queue is used to record the extracted arguments.

[0011] Further, optionally, extracting word vectors from medical electronic medical record data using BERT in the event argument imputation model includes: tokenizing the input medical electronic medical record data, and adding special tokens [cls] and [sep] to the beginning and end of the medical electronic medical record data to obtain the text W = [w1, w2, ... w... n ], where w t Let W be the token at position t in the text, and n be the total number of tokens after text segmentation. Inputting W into BERT yields the word vector representation H = [h1, h2, ..., h...]. n The process is represented as follows:

[0012] H = BERT(W).

[0013] Optionally, generating entity vectors from word vectors through max pooling includes: performing max pooling on the word vectors corresponding to the entities in the word vectors to obtain entity vectors; where the entity vectors are denoted as: E = [e1, e2, ... e k ], where k represents the number of entities extracted during the named entity recognition process.

[0014] Further, optionally, entity position codes are superimposed on the entity vector to obtain an entity vector with superimposed entity position codes. This entity vector with superimposed entity position codes is then input into an entity vector encoder for encoding, resulting in an encoded entity vector denoted as:

[0015]

[0016] Where E′ is the encoded entity vector, E′=[e1′,e2′,…e′ k ]; The entity location code is denoted as P.

[0017] Optionally, the encoded entity vector is superimposed with the argument role encoding to obtain superimposed data. This superimposed data is then concatenated with the argument cache queue, and the input event argument decoder is denoted as:

[0018]

[0019] Where RoleProbs represents the probability that each entity is an argument, CacheList represents the argument cache queue, and R is the argument role code.

[0020] Further, optionally, the event argument decoder extracts entity vectors corresponding to event argument roles from the concatenated overlay data and argument cache queue according to a preset threshold, and saves them to the argument cache queue. Adding a special vector for separation in the argument cache queue includes: determining whether the extracted event argument role is a subject word; if the determination result is yes, filtering arguments according to a preset threshold, wherein filtering arguments according to the preset threshold includes: labeling entity vectors with argument probabilities greater than the preset threshold as arguments, creating corresponding event branches for the arguments, concatenating the arguments to the corresponding event's argument cache queue, and using a special vector as a separator to obtain the separated argument cache queue, denoted as:

[0021] CacheList′=concat(CacheList,ArgVec,Role);

[0022] Where Role represents the selected arguments, ArgVec is a special vector, and CacheList′ is the delimited argument cache queue;

[0023] If the judgment result is negative, arguments are filtered according to a preset threshold. This filtering includes: obtaining an argument list from entity vectors whose argument probabilities are greater than the preset threshold; concatenating the argument list into an argument cache queue; and using a special vector as a separator to obtain a separated argument cache queue, denoted as:

[0024] CacheList′=concat(CacheList,ArgVec,RoleList)

[0025] In this context, RoleList is the list of selected arguments, ArgVec is a special vector, and CacheList′ is the delimited argument cache queue.

[0026] Optionally, calculating the loss function based on the preset event argument roles' label data includes: comparing the argument probabilities output by the event argument decoder with the preset event argument roles' label data, and calculating the loss function using binary cross-entropy, denoted as:

[0027]

[0028] Where N represents the total number of entities to be classified into two categories. y represents the probability that the event argument filling model predicts a positive example. i Indicates the sample label.

[0029] This invention provides a medical event extraction device, comprising: an identification module for inputting a medical electronic medical record into a trained named entity recognition model for identification, thereby obtaining a named entity recognition result; an extraction module for inputting the named entity recognition result into a trained event argument filling model for event extraction, thereby obtaining structured event information; and an event acquisition module for determining a target medical event in the medical electronic medical record based on the structured event information.

[0030] This invention provides a method and apparatus for extracting medical events. The method involves inputting a trained named entity recognition model into an electronic medical record for recognition, obtaining named entity recognition results; inputting the named entity recognition results into a trained event argument filling model for event extraction, obtaining structured event information; and determining the target medical event in the electronic medical record based on the structured event information. This achieves the technical effects of improving the efficiency of medical information processing and the quality of medical services, and also lays the foundation for subsequent medical knowledge alignment and integration. Attached Figure Description

[0031] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0032] Figure 1 A flowchart illustrating a method for extracting medical events according to an embodiment of the present invention;

[0033] Figure 2 This is a schematic diagram of entity encoding in a method for extracting medical events provided in an embodiment of the present invention;

[0034] Figure 3 This is a schematic diagram of a medical event extraction device provided in an embodiment of the present invention. Detailed Implementation

[0035] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish different objects, rather than to limit a specific order.

[0037] It should also be noted that the various embodiments of the present invention described below can be executed individually or in combination with each other, and the embodiments of the present invention do not impose specific limitations in this regard.

[0038] Technical terms used in the embodiments of this application:

[0039] BERT: Bidirectional Encoder Representation from Transformers;

[0040] CRF: Conditional Random Fields;

[0041] BIO annotation: (B-begin, I-inside, O-outside) BX represents the beginning of entity X, IX represents the end of entity X, and O represents not belonging to any type. Among them, "BX" means that the fragment in which this element is located belongs to type X and this element is at the beginning of this fragment, "IX" means that the fragment in which this element is located belongs to type X and this element is in the middle of this fragment, and "O" means not belonging to any type.

[0042] This invention provides a method for extracting medical events. Figure 1 This is a flowchart illustrating a method for extracting medical events according to an embodiment of the present invention; as shown below. Figure 1 As shown in the embodiments of this application, the method for extracting medical events includes:

[0043] Step S102: Input the medical electronic medical record into the trained named entity recognition model for recognition, and obtain the named entity recognition result;

[0044] Optionally, before training the named entity recognition model and the event argument filling model, the medical event extraction method provided in this application embodiment further includes: obtaining medical electronic medical record data, preset event argument roles, and named entity recognition types from a medical database; labeling the medical electronic medical record data according to the named entity recognition types to obtain entity information in the medical electronic medical record data; labeling the medical electronic medical record data according to the preset event argument roles to obtain event information in the medical electronic medical record data; generating a dataset file based on the medical electronic medical record data, event information, and entity information; and generating training data and test data based on the dataset file. The event information includes: label data of preset event argument roles, which include: subject words, descriptive words, anatomical locations, and occurrence status; the entity information includes: label data of named entity recognition types, which include: disease name, onset location, symptoms, and patient status.

[0045] Further, optionally, a named entity recognition model is trained to obtain a trained named entity recognition model. The training of the named entity recognition model to obtain a trained named entity recognition model includes: inputting training data into the named entity recognition model, performing BIO annotation on the entities in the training data to obtain annotation results, calculating the loss function based on the annotation results and performing backpropagation to obtain entity extraction results, until the named entity recognition model converges to obtain a trained named entity recognition model. The training data includes: medical electronic medical record data and named entity recognition label data.

[0046] The named entity recognition model in this application embodiment is a combination of BERT and CRF.

[0047] In this embodiment, the label data for named entity recognition is the named entity recognition type in medical electronic medical record data; in this embodiment, the label data is dataset label data.

[0048] It should be noted that the named entity recognition model in this application embodiment is only illustrated using the model combining BERT and CRF as an example. The named entity recognition model may also include: BiLSTM-CRF, BERT-Tagger, Lattice-LSTM, LR-CNN, etc.; the specific model is not limited to the method for extracting medical events provided in this application embodiment, but is based on the implementation of such a method. The process of generating a dataset file based on event information in this application embodiment may include: converting the event information into a dataset file storage format and storing it in JSON format.

[0049] For example:

[0050]

[0051] In this embodiment of the application, the subject term refers to the name of the disease in the patient's electronic medical record or the symptoms caused by the disease, and also includes the patient's general condition such as diet and sleep.

[0052] Descriptive words refer to the description of the subject word in multiple dimensions such as the timing of its occurrence, its degree of severity, and its form and color.

[0053] Anatomical location refers to the part of the patient's body where the subject occurs, including tissues, cells, systems, as well as the direction and number of the location;

[0054] The state of occurrence includes affirmation, negation, and uncertainty.

[0055] For example, in the medical record text, "Admitted to our department by outpatient with a space-occupying lesion in the lumbar spinal canal." The main word is "lesion," the descriptive word is "space-occupying," the anatomical location is "inside the lumbar spinal canal," and the condition is "definite."

[0056] Named entity recognition types include: disease name, affected area, symptoms, or patient status. The process of named entity recognition involves extracting entities that may exist in the text.

[0057] The event argument filling process in this embodiment is the process of filling the identified entities into the event frame; the label category of named entity recognition may be inconsistent with the label category of event argument filling.

[0058] In a preferred embodiment, the annotation of medical electronic medical record data based on preset event argument roles and named entity recognition types in this application embodiment can be as follows: A annotation platform is built, and manual annotation is performed to capture event information in the descriptive text. Specifically, the annotation platform is built based on preset event argument roles and named entity recognition types, and manual annotation is performed to capture event information in the descriptive text. In another preferred embodiment, the named entity recognition model in this application embodiment is a model combining BERT and CRF. Training data is input into the named entity recognition model, and BIO annotation is performed on the entities in the training data to obtain the annotation results. This can be achieved by inputting medical electronic medical record data and named entity recognition label data into the BERT+CRF named entity recognition model, performing BIO annotation on the entities in the medical record text, and obtaining the annotation results.

[0059] Step S104: Input the named entity recognition results into the trained event argument filling model to extract events and obtain structured event information;

[0060] Optionally, the medical event extraction method provided in this application embodiment further includes: training an event argument filling model to obtain a trained event argument filling model, wherein training the event argument filling model to obtain a trained event argument filling model includes:

[0061] The event argument filling model is input into the electronic medical record data, the label data of preset event argument roles, and the entity extraction results obtained from the named entity recognition model. Word vectors are extracted from the electronic medical record data using BERT in the event argument filling model. Entity vectors are generated from the word vectors through max pooling. Entity position codes are superimposed on the entity vectors to obtain superimposed entity position codes. These superimposed entity position codes are then input into the entity vector encoder for encoding. The encoded entity vectors are superimposed with the argument role codes to obtain superimposed data. This superimposed data is concatenated with the argument cache queue and input into the event argument decoder. The event argument decoder extracts the entity vectors of the corresponding event argument roles from the concatenated superimposed data and the argument cache queue according to a preset threshold and saves them to the argument cache queue. Special vectors are added to the argument cache queue for separation, and a loss function is calculated based on the label data of the preset event argument roles. The average of the calculated loss function is then used for backpropagation. This process continues until the event argument filling model converges, resulting in a trained event argument filling model. The argument cache queue is used to record the extracted arguments.

[0062] in, Figure 2 This is a schematic diagram of entity encoding in a medical event extraction method provided by an embodiment of the present invention. In this embodiment, entity position encoding is superimposed on the entity vector to obtain an entity vector with superimposed entity position encoding. The entity vector with superimposed entity position encoding is input into an entity vector encoder for encoding to obtain the encoded entity vector as shown below. Figure 2 As shown, the entity location is encoded in Figure 2 This is denoted as the position code.

[0063] In the embodiments of this application, the entity location encoding is obtained by training trainable parameters. For example, the maximum allowed input length is 512, and a 512*h matrix is ​​preset, where h is the dimension of the hidden layer vector. If the position of the entity in the input sequence is 30, the 30th vector with dimension h is taken as the entity location encoding.

[0064] In this embodiment, the argument role encoding is a trainable parameter. For example, if a total of n argument roles are defined, an n*h trainable matrix is ​​created, where h is the hidden layer dimension. Based on the argument roles to be extracted, the vector with the corresponding number is selected from the n*h dimension matrix as the argument role encoding.

[0065] In this embodiment, the argument cache queue is a queue that stores the entity vectors of the extracted arguments. Initially, there is only one Seg vector, and vectors are gradually added to it as arguments are extracted.

[0066] In a preferred example, the extraction of word vectors from medical electronic medical record data using BERT in the event argument filling model of this application includes: tokenizing the input medical electronic medical record data, and obtaining the text W = [w1, w2, ..., w...] by adding special tokens [cls] and [sep] to the beginning and end of the medical electronic medical record data. n ], where w t Let W be the token at position t in the text, and n be the total number of tokens after text segmentation. Inputting W into BERT yields the word vector representation H = [h1, h2, ..., h...]. n The process is represented as follows:

[0067] H = BERT(W).

[0068] In a preferred embodiment, the generation of entity vectors from word vectors by max pooling in this application includes: max pooling the word vectors corresponding to entities in the word vectors to obtain entity vectors; wherein, the entity vectors are denoted as: E = [e1, e2, ... e k ], where k represents the number of entities extracted during the named entity recognition process.

[0069] In a preferred embodiment, entity position encoding is superimposed on the entity vector to obtain an entity vector with superimposed entity position encoding. This entity vector with superimposed entity position encoding is then input into an entity vector encoder for encoding, resulting in an encoded entity vector denoted as:

[0070]

[0071] Where E′ is the encoded entity vector, E′=[e1′,e2′,…e′ k ]; The entity location code is denoted as P.

[0072] In a preferred embodiment of this application, the encoded entity vector is superimposed with the argument role encoding to obtain superimposed data. The superimposed data is then concatenated with the argument cache queue, and the input event argument decoder is denoted as:

[0073]

[0074] Where RoleProbs represents the probability that each entity is an argument, CacheList represents the argument cache queue, and R is the argument role code. In this embodiment, RoleProbs represents the probability that the current entity is the argument role corresponding to the superimposed argument code vector, and the argument decoder decodes only one type of argument role at a time.

[0075] In a preferred embodiment, the process of extracting entity vectors of corresponding event argument roles from the concatenated superimposed data and argument cache queue using an event argument decoder based on a preset threshold, and saving them to the argument cache queue, includes adding special vectors for separation in the argument cache queue: determining whether the extracted event argument role is a subject word; if the determination result is yes, filtering arguments according to a preset threshold, wherein filtering arguments according to the preset threshold includes: labeling entity vectors with argument probabilities greater than the preset threshold as arguments, creating corresponding event branches for the arguments, concatenating the arguments to the argument cache queue of the corresponding event, and obtaining the separated argument cache queue using special vectors as separators, denoted as:

[0076] CacheList′=concat(CacheList,ArgVec,Role);

[0077] Where Role represents the selected arguments, ArgVec is a special vector, and CacheList′ is the delimited argument cache queue;

[0078] If the judgment result is negative, arguments are filtered according to a preset threshold. This filtering includes: obtaining an argument list from entity vectors whose argument probabilities are greater than the preset threshold; concatenating the argument list into an argument cache queue; and using a special vector as a separator to obtain a separated argument cache queue, denoted as:

[0079] CacheList′=concat(CacheList,ArgVec,RoleList)

[0080] In this context, RoleList is the list of selected arguments, ArgVec is a special vector, and CacheList′ is the delimited argument cache queue.

[0081] It should be noted that, in this embodiment of the application, the preset threshold is 0.5 as an example to illustrate the method for extracting medical events provided in this embodiment of the application, and is not specifically limited.

[0082] In a preferred embodiment, the calculation of the loss function based on the label data of the preset event argument roles in this application includes: comparing the argument probabilities output by the event argument decoder with the label data of the preset event argument roles, and calculating the loss function using binary cross-entropy, denoted as:

[0083]

[0084] Where N represents the total number of entities to be classified into two categories. y represents the probability that the event argument filling model predicts a positive example. i Indicates the sample label.

[0085] In this embodiment, assuming a medical record text identifies 'a' entities through entity recognition, and the argument filling process generates 'b' argument decoding nodes, N in the loss function is a*b. The loss function in this embodiment can be expressed as the average of the binary classification loss for each entity at each node. In this embodiment, the four different roles are not predicted simultaneously; only one role's arguments are predicted at a time and added to the cache queue. The next time, arguments for another role are predicted, and the input vector is concatenated with the previous cache queue.

[0086] The function of the argument decoder is to score entities; entities with a score greater than 0.5 are selected as arguments. If an entity is actually an argument, its label value is 1; if it is not, its label value is 0. The label value is generated before calculating the label. Step S106: Determine the target medical event in the electronic medical record based on the structured event information.

[0087] The medical event extraction method provided in this application addresses the problem of medical event extraction in complex scenarios. It can extract highly readable structured event information from unstructured electronic medical record data expressed in natural language. By utilizing natural language processing-based event extraction techniques to extract structured information from electronic medical records, it helps doctors improve work efficiency and the quality of medical services. Event extraction technology can extract structured text with high information density from unstructured electronic medical records and automatically extract event information helpful for actual diagnosis and treatment using algorithms, assisting doctors in quickly and accurately understanding the patient's condition, thereby improving medical efficiency. The medical event extraction method using extended argument filling can greatly improve the speed of existing event extraction and its ability to handle complex situations, thus significantly improving information extraction efficiency.

[0088] This invention provides a method for extracting medical events. The method involves inputting a trained named entity recognition model into an electronic medical record (EMR) to obtain the named entity recognition result; inputting the named entity recognition result into a trained event argument filling model to extract the event, resulting in structured event information; and determining the target medical event in the EMR based on the structured event information. This method aims to improve the efficiency of medical information processing, enhance the quality of medical services, and lay the foundation for subsequent medical knowledge alignment and integration.

[0089] This invention provides a medical event extraction device, which is applied to a medical event extraction method. Figure 3 This is a schematic diagram of a medical event extraction device provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the medical event extraction device provided in this application embodiment includes: an identification module 32, used to input the medical electronic medical record into a trained named entity recognition model for identification, and obtain named entity recognition results; an extraction module 34, used to input the named entity recognition results into a trained event argument filling model for event extraction, and obtain structured event information; and an event acquisition module 36, used to determine the target medical event in the medical electronic medical record based on the structured event information.

[0090] Before training the named entity recognition model and the event argument filling model, medical electronic medical record data, preset event argument roles, and named entity recognition types are obtained from a medical database. The medical electronic medical record data is labeled according to the named entity recognition types to obtain entity information. The medical electronic medical record data is also labeled according to the preset event argument roles to obtain event information. A dataset file is generated based on the medical electronic medical record data, event information, and entity information. Training data and test data are generated based on the dataset file. The event information includes: label data for preset event argument roles, which include: subject words, descriptive words, anatomical locations, and occurrence status. The entity information includes: label data for named entity recognition types, which include: disease name, location of onset, symptoms, and patient status.

[0091] The training process of a named entity recognition model includes:

[0092] The training data is input into the named entity recognition model, and the entities in the training data are labeled using BIO to obtain the labeling results. The loss function is calculated based on the labeling results and backpropagation is performed to obtain the entity extraction results. This process continues until the named entity recognition model converges, resulting in a trained named entity recognition model. The training data includes medical electronic medical record data and named entity recognition label data.

[0093] The training process of the event argument filling model is as follows:

[0094] The event argument filling model is input into the electronic medical record data, the label data of preset event argument roles, and the entity extraction results obtained from the named entity recognition model. Word vectors are extracted from the electronic medical record data using BERT in the event argument filling model. Entity vectors are generated from the word vectors through max pooling. Entity position codes are superimposed on the entity vectors to obtain superimposed entity position codes. These superimposed entity position codes are then input into the entity vector encoder for encoding. The encoded entity vectors are superimposed with the argument role codes to obtain superimposed data. This superimposed data is concatenated with the argument cache queue and input into the event argument decoder. The event argument decoder extracts the entity vectors of the corresponding event argument roles from the concatenated superimposed data and the argument cache queue according to a preset threshold and saves them to the argument cache queue. Special vectors are added to the argument cache queue for separation, and a loss function is calculated based on the label data of the preset event argument roles. The average of the calculated loss function is then used for backpropagation. This process continues until the event argument filling model converges, resulting in a trained event argument filling model. The argument cache queue is used to record the extracted arguments.

[0095] In a preferred example, the extraction of word vectors from medical electronic medical record data using BERT in the event argument filling model of this application includes: tokenizing the input medical electronic medical record data, and obtaining the text W = [w1, w2, ..., w...] by adding special tokens [cls] and [sep] to the beginning and end of the medical electronic medical record data. n ], where w t Let W be the token at position t in the text, and n be the total number of tokens after text segmentation. Inputting W into BERT yields the word vector representation H = [h1, h2, ..., h...]. n The process is represented as follows:

[0096] H = BERT(W).

[0097] In a preferred embodiment, the generation of entity vectors from word vectors by max pooling in this application includes: max pooling the word vectors corresponding to entities in the word vectors to obtain entity vectors; wherein, the entity vectors are denoted as: E = [e1, e2, ... e k ], where k represents the number of entities extracted during the named entity recognition process.

[0098] In a preferred embodiment, entity position encoding is superimposed on the entity vector to obtain an entity vector with superimposed entity position encoding. This entity vector with superimposed entity position encoding is then input into an entity vector encoder for encoding, resulting in an encoded entity vector denoted as:

[0099]

[0100] Where E′ is the encoded entity vector, E′=[e1′,e2′,…e′ k ]; The entity location code is denoted as P.

[0101] In a preferred embodiment of this application, the encoded entity vector is superimposed with the argument role encoding to obtain superimposed data. The superimposed data is then concatenated with the argument cache queue, and the input event argument decoder is denoted as:

[0102]

[0103] Where RoleProbs represents the probability that each entity is an argument, CacheList represents the argument cache queue, and R is the argument role code.

[0104] In a preferred embodiment, the process of extracting entity vectors of corresponding event argument roles from the concatenated superimposed data and argument cache queue using an event argument decoder based on a preset threshold, and saving them to the argument cache queue, includes adding special vectors for separation in the argument cache queue: determining whether the extracted event argument role is a subject word; if the determination result is yes, filtering arguments according to a preset threshold, wherein filtering arguments according to the preset threshold includes: labeling entity vectors with argument probabilities greater than the preset threshold as arguments, creating corresponding event branches for the arguments, concatenating the arguments to the argument cache queue of the corresponding event, and obtaining the separated argument cache queue using special vectors as separators, denoted as:

[0105] CacheList′=concat(CacheList,ArgVec,Role);

[0106] Where Role represents the selected arguments, ArgVec is a special vector, and CacheList′ is the delimited argument cache queue;

[0107] If the judgment result is negative, arguments are filtered according to a preset threshold. This filtering includes: obtaining an argument list from entity vectors whose argument probabilities are greater than the preset threshold; concatenating the argument list into an argument cache queue; and using a special vector as a separator to obtain a separated argument cache queue, denoted as:

[0108] CacheList′=concat(CacheList,ArgVec,RoleList)

[0109] In this context, RoleList is the list of selected arguments, ArgVec is a special vector, and CacheList′ is the delimited argument cache queue.

[0110] In a preferred embodiment, the calculation of the loss function based on the label data of the preset event argument roles in this application includes: comparing the argument probabilities output by the event argument decoder with the label data of the preset event argument roles, and calculating the loss function using binary cross-entropy, denoted as:

[0111]

[0112] Where N represents the total number of entities to be classified into two categories. y represents the probability that the event argument filling model predicts a positive example. i Indicates the sample label.

[0113] This invention provides a medical event extraction device. It involves inputting a trained named entity recognition model into an electronic medical record to obtain named entity recognition results; inputting the named entity recognition results into a trained event argument filling model to extract events, resulting in structured event information; and determining the target medical event in the electronic medical record based on the structured event information. This device aims to improve the efficiency of medical information processing, enhance the quality of medical services, and lay the foundation for subsequent medical knowledge alignment and integration.

[0114] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0116] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0117] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention.

Claims

1. A medical event extraction method, characterized by, The method comprises the following steps: inputting a medical electronic medical record into a trained named entity recognition model for recognition to obtain a named entity recognition result; inputting the named entity recognition result into a trained event argument filling model for event extraction to obtain structured event information; determining a target medical event in the medical electronic medical record according to the structured event information; The method further comprises training an event argument filling model to obtain the trained event argument filling model, wherein the training of the event argument filling model to obtain the trained event argument filling model comprises: inputting medical electronic medical record data, label data of a preset event argument role, and entity extraction results obtained by a named entity recognition model into the event argument filling model; extracting word vectors in the medical electronic medical record data by BERT in the event argument filling model; generating entity vectors by maximum pooling on the word vectors, superimposing entity position encoding on the entity vectors to obtain the entity vectors superimposed with the entity position encoding, inputting the entity vectors superimposed with the entity position encoding into an entity vector encoder for encoding to obtain encoded entity vectors; superimposing the encoded entity vectors and argument role encoding to obtain superimposed data, splicing the superimposed data and an argument cache queue, inputting the spliced superimposed data and argument cache queue into an event argument decoder, extracting entity vectors of corresponding event argument roles from the spliced superimposed data and argument cache queue according to a preset threshold by the event argument decoder, saving the entity vectors to the argument cache queue, adding special vectors to the argument cache queue for separation, and calculating a loss function according to the label data of the preset event argument role, taking an average of the calculated loss function for back propagation; until the event argument filling model converges, the trained event argument filling model is obtained; wherein the argument cache queue is used to record extracted arguments.

2. The medical event extraction method of claim 1, wherein, Before training the named entity recognition model and the event argument filling model, the method further comprises: obtaining medical electronic medical record data, a preset event argument role, and a named entity recognition type from a medical database; labeling the medical electronic medical record data according to the named entity recognition type to obtain entity information in the medical electronic medical record data; labeling the medical electronic medical record data according to the preset event argument role to obtain event information in the medical electronic medical record data; generating a dataset file according to the medical electronic medical record data, the event information, and the entity information; generating training data and test data according to the dataset file; wherein the event information comprises label data of the preset event argument role, and the preset event argument role comprises subject words, description words, anatomical sites, and occurrence states; the entity information comprises label data of the named entity recognition type, and the named entity recognition type comprises disease names, disease sites, disease symptoms, and patient states.

3. The medical event extraction method of claim 2, wherein, The method further comprises: The training of the named entity recognition model is performed to obtain the trained named entity recognition model, and the training of the named entity recognition model comprises: The training data is input into the named entity recognition model, the entities in the training data are labeled by BIO, a labeling result is obtained, a loss function is calculated according to the labeling result, a reverse propagation is performed, an entity extraction result is obtained, and the named entity recognition model is converged to obtain the trained named entity recognition model. The training data comprises medical electronic medical record data and label data of named entity recognition.

4. The medical event extraction method of claim 1, wherein, The BERT in the event argument filling model is used to extract the word vector in the medical electronic medical record data, and the BERT in the event argument filling model is used to extract the word vector in the medical electronic medical record data. The medical electronic medical record data is tokenized, special tokens [cls] and [sep] are added at the head and tail of the medical electronic medical record data, and text is obtained , wherein is a token at the position of the text t, n is the total number of tokens after the text is tokenized, and is input into BERT to obtain the word vector representation , and the process is represented as: 。 5. The medical event extraction method of claim 4, wherein, The entity vector is generated by maximum pooling of the word vector, and the entity vector is generated by maximum pooling of the word vector. The word vector corresponding to the entity in the word vector is maximum-pooled to obtain the entity vector; wherein the entity vector is denoted as: wherein k represents the number of entities extracted in the named entity recognition process.

6. The medical event extraction method of claim 5, wherein, The entity position encoding is superimposed on the entity vector to obtain the entity vector with superimposed entity position encoding, the entity vector with superimposed entity position encoding is input into the entity vector encoder for encoding, and the encoded entity vector is denoted as: ; wherein, is the encoded entity vector, ; the entity position encoding is denoted P.

7. The medical event extraction method of claim 6, wherein, The encoded entity vector and the argument role encoding are superimposed to obtain superimposed data, the superimposed data and the argument cache queue are spliced, and the event argument decoder is input, denoted as: ; wherein, represents the probability that each entity is an argument, represents the argument cache queue; R is the argument role encoding.

8. The medical event extraction method of claim 7, wherein, The event argument role corresponding to the entity vector is extracted from the spliced superimposed data and argument cache queue according to a preset threshold by the event argument decoder, saved to the argument cache queue, and a special vector is added to the argument cache queue to separate the special vector. It is judged whether the extracted event argument role is a subject word. In the case where the judgment result is yes, the arguments are screened according to the preset threshold, and the arguments are screened according to the preset threshold. ; wherein, the argument, as the special vector, the separated argument cache queue; In the case where the judgment result is no, the arguments are screened according to the preset threshold, and the arguments are screened according to the preset threshold. wherein, is a list of arguments filtered out, as the special vector, is the separated argument cache queue.

9. The medical event extraction method of claim 8, wherein, The loss function is calculated according to the label data of the preset event argument role. The loss function is calculated by comparing the argument probability output by the event argument decoder with the label data of the preset event argument role, and the loss function is calculated by binary cross entropy, denoted as: ; wherein, denotes the total number of entities being classified as positive, denotes the probability that the event argument filling model predicts as a positive, denotes the sample label.

10. A medical event extraction apparatus characterized by comprising: It comprises: The recognition module is used for inputting the medical electronic medical record into the trained named entity recognition model for recognition to obtain a named entity recognition result. The extraction module is used for inputting the named entity recognition result into the trained event argument filling model for event extraction to obtain structured event information. An event obtaining module is configured to determine a target medical event in the medical electronic record according to the structured event information; The event argument filling model is trained to obtain the trained event argument filling model, and the training of the event argument filling model includes: inputting medical electronic record data, label data of a preset event argument role, and entity extraction results obtained by a named entity recognition model into the event argument filling model; extracting word vectors in the medical electronic record data by BERT in the event argument filling model; generating entity vectors by maximum pooling on the word vectors, superimposing entity position encoding on the entity vectors to obtain the entity vectors superimposed with the entity position encoding, inputting the entity vectors superimposed with the entity position encoding into an entity vector encoder to perform encoding to obtain encoded entity vectors; superimposing the encoded entity vectors and argument role encoding to obtain superimposed data, splicing the superimposed data and an argument cache queue, inputting the superimposed data and the argument cache queue into an event argument decoder, extracting entity vectors of corresponding event argument roles from the spliced superimposed data and argument cache queue by the event argument decoder according to a preset threshold, saving the entity vectors into the argument cache queue, adding special vectors into the argument cache queue to separate, and calculating a loss function according to the label data of the preset event argument role, performing back propagation on the average value of the calculated loss function; until the event argument filling model converges, the trained event argument filling model is obtained; and the argument cache queue is configured to record extracted arguments.

Citation Information

Patent Citations

  • Medical event extraction method based on generative model

    CN115545029A