Electronic medical record text event extraction method, device, electronic device and storage medium
By conducting sentence-by-text and vector representation of electronic medical record text, combining bidirectional long and short-term memory neural network and named entity recognition model, the problem that traditional methods cannot accurately extract medical visits is solved, and more efficient and accurate event extraction is achieved.
Patent Information
- Application Number
- CN202111580066.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-12-22
AI Technical Summary
The traditional method of extracting electronic medical record text events cannot accurately determine whether the sentence describes a new medical visit or the medical visit mentioned above, resulting in the inability to effectively extract the medical visit.
A sentence list is generated by punctuating paragraphs based on medical record text, and a sentence is represented by a trained word vector and a two-way long and short-term memory neural network. Calculate the weight of each word in the sentence, calculate the number of events contained in the sentence through the softmax function, and divide and merge events using the division marker and named entity recognition model.
It improves the accuracy of event extraction in electronic medical record text, can more accurately identify and extract medical visits, and enhances the ability to provide clinical basis in the medical process.
Smart Images

Figure CN114464281B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a method, device, electronic device and readable storage medium for extracting events from electronic medical record text. Background Art
[0002] Doctors can obtain the patient's medical history by browsing the patient's electronic medical record. The information obtained is extremely important for understanding the occurrence and development of the disease, the diagnosis and treatment process, the previous health status and the condition of the disease. It also provides the most important basic information for the subsequent physical examination and various diagnostic examinations of the patient. In the electronic medical record text, the diagnosis and treatment process and results of the patient since the onset of the disease can be quickly and intuitively displayed, which will greatly improve the doctor's work efficiency and provide clinical basis for the medical process.
[0003] Since the electronic medical record records the detailed information of the occurrence, evolution, diagnosis and treatment of the patient's disease, it is written in chronological order. Therefore, the traditional electronic medical record text event extraction is mainly based on rules and template methods. However, the disadvantage of this method is that it is impossible to determine whether the sentence describes a new visit event or a visit event mentioned in the previous text. As shown in the following example, "The patient began to experience chest tightness, shortness of breath, dry cough and other symptoms after activities or mild physical labor in 1992, which could be relieved after rest. No special treatment was given. In 1993, the symptoms worsened. Cardiac ultrasound found mitral stenosis with regurgitation. In 1994, mitral valve replacement was performed in *** Hospital and replaced with a mechanical valve. After the operation, long-term warfarin anticoagulation treatment (less regular), no obvious chest tightness and shortness of breath after activities, and then the patient intermittently experienced palpitations and chest tightness, and was admitted to the local hospital for treatment many times." It is obviously not feasible to simply count the "time" or "hospital" entities that appear in the above description. The reason is that although "1992" appears, there is no medical treatment event in "1992"; "1993" does not mention the hospital, but according to the description, it can be judged that the patient went to the hospital for treatment. In this case, it is difficult for the rule-based and template-based methods to accurately extract medical treatment events. Summary of the invention
[0004] In order to solve at least one of the above technical problems, the present disclosure provides a method, device, electronic device and readable storage medium for extracting events from electronic medical record text.
[0005] According to one aspect of the present disclosure, a method for extracting events from electronic medical record text is provided, comprising:
[0006] Based on the punctuation marks of the medical record text, the paragraphs are divided into sentences and a list of k sentences S = [S 1 , S 2 , S 3 , ..., S k ];
[0007] Segment each sentence in the sentence list one by one, and the kth sentence S k The word list is S k =[C 1 , C 2 , C 3 , ..., C m ];
[0008] Each word in the sentence is vectorized through the trained word vector. The kth sentence S k The word list of S is vectorized as S k =[e 1 , e 2 , e 3 ,……,e m ];
[0009] Get the vector representation of each sentence after the bidirectional long short-term memory neural network, the kth sentence S k The vector set obtained by the bidirectional long short-term memory neural network is H = [h 1 ,h 2 ,h 3 ,……,h m ];
[0010] Calculate the weight of each word in the sentence, and take the weighted sum of all word vectors as the feature vector h*, h * =tanh(γ), where γ=Hα T , α=softmax(ω T M),ω T Represents the parameters that need to be learned, and the dimension of ω is d w *1, the dimension of α is 1*m, M=tanh(H), the dimension of M is d w *m,d w represents the dimension of the vector, m is the number of word segments in the kth sentence;
[0011] The number of events n contained in each sentence is calculated by the feature vector h* of each sentence, and the number of events at each sentence level array N = [n 1 , n 2 , n 3 ,……,n q ], where n q is the number of events predicted by the qth sentence; and,
[0012] Get the total number of sentence-level events
[0013] According to the electronic medical record text event extraction method provided by at least one embodiment of the present disclosure, the method for obtaining the trained word vector is: obtaining the word vector by segmenting the electronic medical record text and then training the word segmentation.
[0014] According to at least one embodiment of the present disclosure, a method for extracting events from electronic medical record text is provided. m The word vector e of the sentence is obtained by using a bidirectional long short-term memory neural network m Trained to obtain word vector e m The forward output of the bidirectional long short-term memory neural network is The reverse output is Then the vector obtained by the mth word after passing through the bidirectional long short-term memory network is in It means to add corresponding vector elements.
[0015] According to the electronic medical record text event extraction method provided by at least one embodiment of the present disclosure, the number of events n contained in each sentence is calculated through the feature vector h* of each sentence, including: calculating through the softmax function, taking the maximum probability of the number of events n (10≥n≥0) as the number of events n contained in each sentence.
[0016] According to at least one embodiment of the present disclosure, the electronic medical record text event extraction method provided further includes:
[0017] Add delimiter marks at the beginning and end of a paragraph <delimiter>;
[0018] The electronic medical record sentences are divided based on the sentence-level event number array N, and the array N is scanned. When n i ≠0 and i>1, add a division mark before the beginning of this sentence <delimiter>, when n i =0 and i>1, no processing is done and the next sentence is scanned until the scan is completed; and,
[0019] Based on partition marking <delimiter>Get the description paragraphs corresponding to each event.
[0020] According to at least one embodiment of the present disclosure, the electronic medical record text event extraction method further includes: dividing the mark <delimiter>The length of the text between the two paragraphs verifies the effectiveness of the paragraph division.
[0021] According to the electronic medical record text event extraction method provided by at least one embodiment of the present disclosure, by dividing the mark <delimiter>Verify the validity of paragraph division by the length of text between them, including: <delimiter>The length of the text between them is less than the threshold L min When <delimiter>The text between is used as the sentence to be merged.
[0022] If the sentence to be merged is the first sentence of a paragraph, the division mark after the sentence to be merged <delimiter>Remove, merge the current description sentence with the next description sentence, and the total number of paragraph events N a =N a -1;
[0023] If the sentence to be merged is the last sentence of a paragraph, the division mark before the sentence to be merged <delimiter>Remove, merge the current description sentence with the previous description sentence, and the total number of paragraph events N a =N a -1; and,
[0024] If the sentence to be merged is in the middle of a paragraph, use the named entity recognition model to identify the last entity Ea of the sentence before the sentence to be merged, the first entity Eb, the last entity Ec, and the first entity Ed of the sentence after the sentence to be merged, and calculate the correlation coefficient between Ea and Eb, which is recorded as<Ea,Eb> , calculate the correlation coefficient of Ec and Ed<Ec,Ed> ,like<Ea,Eb> ≥<Ec,Ed> , mark the division before the sentence to be merged <delimiter>Remove, merge the current description sentence with the previous description sentence, and the total number of paragraph events N a =N a -1, if<Ea,Eb> <<Ec,Ed> , mark the division after the sentence to be merged <delimiter>Remove, merge the current description sentence with the next description sentence, and the total number of paragraph events N a =N a -1.
[0025] According to the electronic medical record text event extraction method provided by at least one embodiment of the present disclosure, the association coefficient is obtained through an entity association coefficient matrix, and the entity association coefficient matrix is defined as an array of m rows and m columns arranged by m entities. It is called an m-row and m-column matrix, where a ij is the correlation coefficient between entity i and entity j.
[0026] According to another aspect of the present disclosure, there is provided an electronic medical record text event extraction device, comprising:
[0027] The sentence segmentation module is used to segment paragraphs based on punctuation marks in the medical record text, and generates a list of k sentences S=[S 1 , S 2 , S 3 , ..., S k ];
[0028] The word segmentation module performs word segmentation on each sentence in the sentence list one by one. The kth sentence S k The word list is S k =[C 1 , C 2 , C 3 , ..., C m ];
[0029] The vectorization module vectorizes each word of the sentence through the trained word vector. The kth sentence S k The word list of S is vectorized as S k =[e 1 , e 2 , e 3 ,……,e m ];
[0030] The vector representation acquisition module of the neural network obtains the vector representation of each sentence through the bidirectional long short-term memory neural network. The kth sentence S k The vector set obtained by the bidirectional long short-term memory neural network is H = [h 1 ,h 2 ,h 3 ,……,h m ];
[0031] The feature vector acquisition module calculates the weight of each word in the sentence, and the weighted sum of all word vectors is used as the feature vector h*, h * =tanh(γ), where γ=Hα T , α=softmax(ω T M),ω T Represents the parameters that need to be learned, and the dimension of ω is d w *1, the dimension of α is 1*m, M=tanh(H), the dimension of M is d w *m,d w represents the dimension of the vector, m is the number of word segments in the kth sentence;
[0032] The event number acquisition module calculates the number of events n contained in each sentence through the feature vector h* of each sentence, and obtains the number of events at each sentence level array N = [n 1 , n 2 , n 3 ,……,n q ], where n q is the number of events predicted by the qth sentence; and,
[0033] The total number of events acquisition module obtains the total number of sentence-level events
[0034] According to the electronic medical record text event extraction device provided by at least one embodiment of the present disclosure, the method for obtaining the trained word vector is: obtaining the word vector by segmenting the electronic medical record text and then training the word segmentation.
[0035] According to at least one embodiment of the present disclosure, a device for extracting events from electronic medical record text is provided, wherein the h m The word vector e of the sentence is obtained by using a bidirectional long short-term memory neural network m Trained to obtain word vector e m The forward output of the bidirectional long short-term memory neural network is The reverse output is Then the vector obtained by the mth word after passing through the bidirectional long short-term memory network is in It means to add corresponding vector elements.
[0036] According to at least one embodiment of the present disclosure, the electronic medical record text event extraction device provides a method for calculating the number of events n contained in each sentence through the feature vector h* of each sentence, including: calculating through the softmax function, taking the maximum probability of containing the number of events n (10≥n≥0) as the number of events n contained in each sentence.
[0037] According to at least one embodiment of the present disclosure, the electronic medical record text event extraction device further includes an event description generation module, wherein the event description generation module:
[0038] Add delimiter marks at the beginning and end of a paragraph <delimiter>;
[0039] The electronic medical record sentences are divided based on the sentence-level event number array N, and the array N is scanned. When n i ≠0 and i>1, add a division mark before the beginning of this sentence <delimiter>, when n i =0 and i>1, no processing is done and the next sentence is scanned until the scan is completed; and,
[0040] Based on partition marking <delimiter>Get the description paragraphs corresponding to each event.
[0041] According to at least one embodiment of the present disclosure, the electronic medical record text event extraction device also includes a paragraph division validity verification module, which divides the paragraph division validity verification module by dividing the mark <delimiter>The length of the text between the two paragraphs verifies the effectiveness of the paragraph division.
[0042] According to at least one embodiment of the present disclosure, the electronic medical record text event extraction device is provided by dividing the mark <delimiter>Verify the validity of paragraph division by the length of text between them, including: <delimiter>The length of the text between them is less than the threshold L min When <delimiter>The text between is used as the sentence to be merged.
[0043] If the sentence to be merged is the first sentence of a paragraph, the division mark after the sentence to be merged <delimiter>Remove, merge the current description sentence with the next description sentence, and the total number of paragraph events N a =N a -1;
[0044] If the sentence to be merged is the last sentence of a paragraph, the division mark before the sentence to be merged <delimiter>Remove, merge the current description sentence with the previous description sentence, and the total number of paragraph events N a =N a -1; and,
[0045] If the sentence to be merged is in the middle of a paragraph, use the named entity recognition model to identify the last entity Ea of the sentence before the sentence to be merged, the first entity Eb, the last entity Ec, and the first entity Ed of the sentence after the sentence to be merged, and calculate the correlation coefficient between Ea and Eb, which is recorded as<Ea,Eb> , calculate the correlation coefficient of Ec and Ed<Ec,Ed> ,like<Ea,Eb> ≥<Ec,Ed> , mark the division before the sentence to be merged <delimiter>Remove, merge the current description sentence with the previous description sentence, and the total number of paragraph events N a =N a -1, if<Ea,Eb> <<Ec,Ed> , mark the division after the sentence to be merged <delimiter>Remove, merge the current description sentence with the next description sentence, and the total number of paragraph events N a =N a -1.
[0046] According to the electronic medical record text event extraction device provided by at least one embodiment of the present disclosure, the association coefficient is obtained through an entity association coefficient matrix, and the entity association coefficient matrix is defined as an array of m rows and m columns arranged by m entities. It is called an m-row and m-column matrix, where a ij is the correlation coefficient between entity i and entity j.
[0047] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0048] a memory storing execution instructions; and,
[0049] A processor, wherein the processor executes the execution instruction stored in the memory, so that the processor executes any one of the methods described above.
[0050] According to another aspect of the present disclosure, a readable storage medium is provided, wherein the readable storage medium stores execution instructions, and the execution instructions are used to implement any of the above-mentioned methods when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0052] Figure 1 It is a flowchart of a method for extracting events from electronic medical record text according to an embodiment of the present disclosure.
[0053] Figure 2 It is a flowchart of a method for extracting events from electronic medical record text according to yet another embodiment of the present disclosure.
[0054] Figure 3 It is a flowchart of a method for extracting events from electronic medical record text according to yet another embodiment of the present disclosure.
[0055] Figure 4 It is a structural schematic diagram of an electronic medical record text event extraction device according to an embodiment of the present disclosure.
[0056] Figure 5 It is a structural schematic diagram of an electronic medical record text event extraction device according to another embodiment of the present disclosure.
[0057] Figure 6 It is a structural schematic diagram of an electronic medical record text event extraction device according to another embodiment of the present disclosure.
[0058] Description of Reference Numerals
[0059] 1000, 1001, 1003 Electronic medical record text event extraction device
[0060] 1002 Sentence Module
[0061] 1004 Word segmentation module
[0062] 1006 Vectorization Module
[0063] 1008 Vector representation acquisition module via neural network
[0064] 1010 Feature vector acquisition module
[0065] 1012 Event number acquisition module
[0066] 1014 Total Event Acquisition Module
[0067] 1016 Event description generation module
[0068] 1018 Paragraph division validity verification module
[0069] 1100 Bus
[0070] 1200 processor
[0071] 1300 Memory
[0072] 1400 Other circuits. DETAILED DESCRIPTION
[0073] The present disclosure is further described in detail below in conjunction with the accompanying drawings and implementations. It is understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0074] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0075] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged without departing from the technical concept of the present disclosure.
[0076] The use of cross-hatching and / or shading in the accompanying drawings is generally used to make the boundaries between adjacent components clear. As such, unless otherwise specified, the presence or absence of cross-hatching or shading does not convey or indicate any preference or requirement for the specific materials, material properties, dimensions, proportions, commonalities between the components shown, and / or any other characteristics, attributes, properties, etc. of the components. In addition, in the accompanying drawings, the sizes and relative sizes of the components may be exaggerated for clarity and / or descriptive purposes. When the exemplary embodiments can be implemented differently, the specific process sequence can be performed in a different order than described. For example, two successively described processes can be performed substantially simultaneously or in an order opposite to the described order. In addition, the same figure numbers represent the same components.
[0077] When a component is referred to as being "on" or "over," "connected to," or "coupled to" another component, the component may be directly on, directly connected to, or directly coupled to the other component, or intervening components may be present. However, when a component is referred to as being "directly on," "directly connected to," or "directly coupled to" another component, there are no intervening components. For this purpose, the term "connected" may refer to a physical connection, an electrical connection, etc., with or without intervening components.
[0078] The terms used herein are for the purpose of describing specific embodiments and are not intended to be restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, components and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, components and / or their groups. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values and / or provided values that will be recognized by those of ordinary skill in the art.
[0079] Figure 1 It is a flowchart of a method for extracting events from electronic medical record text according to an embodiment of the present disclosure.
[0080] like Figure 1 As shown, the electronic medical record text event extraction method S100 includes:
[0081] S102: Divide the paragraph into sentences based on the punctuation marks of the medical record text, and generate a list of k sentences S = [S 1 , S 2 , S 3 , ..., S k ];
[0082] S104: Segment each sentence in the sentence list one by one. k The word list is S k =[C 1 , C 2 , C 3 , ..., C m ];
[0083] S106: vectorize each word of the sentence using the trained word vector. k The word list of S is vectorized as S k =[e 1 , e 2 , e 3 ,……,e m ];
[0084] S108: Obtain the vector representation of each sentence after passing through the bidirectional long short-term memory neural network. The kth sentence S k The vector set obtained by the bidirectional long short-term memory neural network is H = [h 1 ,h 2 ,h 3 ,……,h m ];
[0085] S110: Calculate the weight of each word in the sentence, and take the weighted sum of all word vectors as the feature vector h*, h * =tanh(γ), where γ=Hα T , α=softmax(ω T M),ω T Represents the parameters that need to be learned, and the dimension of ω is d w *1, the dimension of α is 1*m, M=tanh(H), the dimension of M is d w *m,d w represents the dimension of the vector, m is the number of word segments in the kth sentence;
[0086] S112: Calculate the number of events n contained in each sentence through the feature vector h* of each sentence, and obtain the number of events at each sentence level array N=[n 1 , n 2 , n 3 ,……,n q ], where n q is the number of events predicted by the qth sentence; and,
[0087] S114: Obtain the total number of sentence-level events
[0088] The method for obtaining the trained word vector is: segmenting the electronic medical record text and then training the segmentation.
[0089] Among them, h m The word vector e of the sentence is obtained by using a bidirectional long short-term memory neural network m Trained to obtain word vector e m The forward output of the bidirectional long short-term memory neural network is The reverse output is Then the vector obtained by the mth word after passing through the bidirectional long short-term memory network is in It means to add corresponding vector elements.
[0090] The number of events n contained in each sentence is calculated by using the feature vector h* of each sentence, including: calculating by a softmax function, taking the maximum probability of the number of events n (10≥n≥0) as the number of events n contained in each sentence.
[0091] Figure 2 It is a flowchart of a method for extracting events from electronic medical record text according to another embodiment of the present disclosure.
[0092] like Figure 2 As shown, the electronic medical record text event extraction method S101 also includes:
[0093] S116: Divide the electronic medical record into paragraphs and generate descriptions corresponding to the events. Specifically, add division marks at the beginning and end of the paragraphs. <delimiter>;
[0094] The electronic medical record sentences are divided based on the sentence-level event number array N, and the array N is scanned. i ≠0 and i>1, add a division mark before the beginning of this sentence <delimiter>, when n i =0 and i>1, no processing is done and the next sentence is scanned until the scan is completed; and,
[0095] Based on partition marking <delimiter>Get the description paragraphs corresponding to each event.
[0096] Figure 3 It is a flowchart of a method for extracting events from electronic medical record text according to another embodiment of the present disclosure.
[0097] like Figure 3 As shown, the electronic medical record text event extraction method S103 also includes:
[0098] S118: By dividing the mark <delimiter>The length of the text between the two paragraphs verifies the effectiveness of the paragraph division.
[0099] Among them, by dividing the mark <delimiter>Verify the validity of paragraph division by the length of text between them, including: <delimiter>The length of the text between them is less than the threshold L min When <delimiter>The text between is used as the sentence to be merged.
[0100] If the sentence to be merged is the first sentence of a paragraph, the division mark after the sentence to be merged <delimiter>Remove, merge the current description sentence with the next description sentence, and the total number of paragraph events N a =N a -1;
[0101] If the sentence to be merged is the last sentence of a paragraph, the division mark before the sentence to be merged <delimiter>Remove, merge the current description sentence with the previous description sentence, and the total number of paragraph events N a =N a -1; and,
[0102] If the sentence to be merged is in the middle of a paragraph, use the named entity recognition model to identify the last entity Ea of the sentence before the sentence to be merged, the first entity Eb, the last entity Ec, and the first entity Ed of the sentence after the sentence to be merged, and calculate the correlation coefficient between Ea and Eb, which is recorded as<Ea,Eb> , calculate the correlation coefficient of Ec and Ed<Ec,Ed> ,like<Ea,Eb> ≥<Ec,Ed> , mark the division before the sentence to be merged <delimiter>Remove, merge the current description sentence with the previous description sentence, and the total number of paragraph events N a =N a -1, if<Ea,Eb> <<Ec,Ed> , mark the division after the sentence to be merged <delimiter>Remove, merge the current description sentence with the next description sentence, and the total number of paragraph events N a =N a -1.
[0103] The correlation coefficient is obtained through the entity correlation coefficient matrix, which is defined as an array of m entities arranged in m rows and m columns. It is called an m-row and m-column matrix, where a ij is the correlation coefficient between entity i and entity j, including null.
[0104] The present invention converts the problem of event extraction from electronic medical record text into a classification problem, obtains the number of sentences in a paragraph and the position of division marks, uses an entity recognition model to identify medical entities in the sentence, and calculates the correlation coefficient between sentences, thereby obtaining more accurate sentence division and improving the accuracy of event extraction in electronic medical record text.
[0105] Figure 4 It is a structural schematic diagram of an electronic medical record text event extraction device according to an embodiment of the present disclosure.
[0106] like Figure 4 As shown, the electronic medical record text event extraction device 1000 includes:
[0107] Sentence segmentation module 1002, which segments paragraphs into sentences based on punctuation marks in the medical record text, generates a list of k sentences S=[S 1 , S 2 , S 3 , ..., S k ];
[0108] The word segmentation module 1004 performs word segmentation on each sentence in the sentence list one by one. The kth sentence S k The word list is S k =[C 1 , C 2 , C 3 , ..., C m ];
[0109] Vectorization module 1006, vectorization module 1006 vectorizes each word of the sentence through the trained word vector. k The word list of S is vectorized as S k =[e 1 , e 2 , e 3 ,……,e m ];
[0110] The vector representation acquisition module 1008 of the neural network obtains the vector representation of each sentence through the bidirectional long short-term memory neural network. The kth sentence S k The vector set obtained by the bidirectional long short-term memory neural network is H = [h 1 ,h 2 ,h 3 ,……,h m ];
[0111] Feature vector acquisition module 1010, which calculates the weight of each word in the sentence, and the weighted sum of all word vectors is used as the feature vector h*, h * =tanh(γ), where γ=Hα T , α=softmax(ω T M),ω T Represents the parameters that need to be learned, and the dimension of ω is d w *1, the dimension of α is 1*m, M=tanh(H), the dimension of M is d w *m,d w represents the dimension of the vector, m is the number of word segments in the kth sentence;
[0112] The event number acquisition module 1012 calculates the number of events n contained in each sentence through the feature vector h* of each sentence, and obtains the number of events in each sentence level array N = [n 1 , n 2 , n 3 ,……,n q ], where n q is the number of events predicted by the qth sentence; and,
[0113] Event total acquisition module 1014, acquires the total number of sentence-level events
[0114] The method for obtaining the trained word vector is: segmenting the electronic medical record text and then training the segmentation.
[0115] Among them, h m The word vector e of the sentence is obtained by using a bidirectional long short-term memory neural network m Trained to obtain word vector e m The forward output of the bidirectional long short-term memory neural network is The reverse output is Then the vector obtained by the mth word after passing through the bidirectional long short-term memory network is in It means to add corresponding vector elements.
[0116] The number of events n contained in each sentence is calculated by using the feature vector h* of each sentence, including: calculating by a softmax function, taking the maximum probability of the number of events n (10≥n≥0) as the number of events n contained in each sentence.
[0117] Figure 5 It is a schematic diagram of the structure of an electronic medical record text event extraction device according to an embodiment of the present disclosure.
[0118] like Figure 5 As shown, the electronic medical record text event extraction device 1001 further includes an event description generating module 1016, and the event description generating module 1016:
[0119] Add delimiter marks at the beginning and end of a paragraph <delimiter>;
[0120] The electronic medical record sentences are divided based on the sentence-level event number array N, and the array N is scanned. i ≠0 and i>1, add a division mark before the beginning of this sentence <delimiter>, when n i =0 and i>1, no processing is done and the next sentence is scanned until the scan is completed; and,
[0121] Based on partition marking <delimiter>Get the description paragraphs corresponding to each event.
[0122] Figure 6 It is a schematic diagram of the structure of an electronic medical record text event extraction device according to an embodiment of the present disclosure.
[0123] like Figure 6 As shown, the electronic medical record text event extraction device 1003 also includes a paragraph division validity verification module 1018, which divides the paragraph into sections by marking the sections. <delimiter>The length of the text between the two paragraphs verifies the effectiveness of the paragraph division.
[0124] Among them, by dividing the mark <delimiter>Verify the validity of paragraph division by the length of text between them, including: <delimiter>The length of the text between them is less than the threshold L min When <delimiter>The text between is used as the sentence to be merged. If the sentence to be merged is the first sentence of a paragraph, the division mark after the sentence to be merged is <delimiter>Remove, merge the current description sentence with the next description sentence, and the total number of paragraph events N a =N a -1;
[0125] If the sentence to be merged is the last sentence of a paragraph, the division mark before the sentence to be merged <delimiter>Remove, merge the current description sentence with the previous description sentence, and the total number of paragraph events N a =N a -1; and,
[0126] If the sentence to be merged is in the middle of a paragraph, use the named entity recognition model to identify the last entity Ea of the sentence before the sentence to be merged, the first entity Eb, the last entity Ec, and the first entity Ed of the sentence after the sentence to be merged, and calculate the correlation coefficient between Ea and Eb, which is recorded as<Ea,Eb> , calculate the correlation coefficient of Ec and Ed<Ec,Ed> ,like<Ea,Eb> ≥<Ec,Ed> , mark the division before the sentence to be merged <delimiter>Remove, merge the current description sentence with the previous description sentence, and the total number of paragraph events N a =N a -1, if<Ea,Eb> <<Ec,Ed> , mark the division after the sentence to be merged <delimiter>Remove, merge the current description sentence with the next description sentence, and the total number of paragraph events N a =N a -1.
[0127] The correlation coefficient is obtained through the entity correlation coefficient matrix, which is defined as an array of m entities arranged in m rows and m columns. It is called an m-row and m-column matrix, where a ij is the correlation coefficient between entity i and entity j, including null.
[0128] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0129] a memory storing execution instructions; and,
[0130] The processor executes the execution instructions stored in the memory, so that the processor executes any one of the above methods.
[0131] According to another aspect of the present disclosure, a readable storage medium is provided, in which execution instructions are stored. When the execution instructions are executed by a processor, they are used to implement any of the above methods.
[0132] Figures 4 to 6 An exemplary diagram of an apparatus using a hardware implementation of a processing system is shown.
[0133] The device may include a corresponding module for performing each or several steps in the above flowchart. Therefore, each step or several steps in the above flowchart may be performed by a corresponding module, and the device may include one or more modules in these modules. The module may be one or more hardware modules specially configured to perform the corresponding steps, or implemented by a processor configured to perform the corresponding steps, or stored in a computer-readable medium for implementation by a processor, or implemented by some combination.
[0134] The hardware structure can be implemented using a bus architecture. The bus architecture can include any number of interconnecting buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.
[0135] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.
[0136] Any process or method description in the flowchart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes other implementations, in which the functions may not be performed in the order shown or discussed, including performing the functions in a substantially simultaneous manner or in a reverse order according to the functions involved, which should be understood by a person skilled in the art of the present disclosure. The processor performs the various methods and processes described above. For example, the method implementation in the present disclosure can be implemented as a software program, which is tangibly contained in a machine-readable medium, such as a memory. In some embodiments, part or all of the software program can be loaded and / or installed via a memory and / or a communication interface. When the software program is loaded into the memory and executed by the processor, one or more steps in the method described above can be performed. Alternatively, in other embodiments, the processor can be configured to perform one of the above methods in any other appropriate manner (e.g., by means of firmware).
[0137] The logic and / or steps represented in the flowchart or otherwise described herein may be embodied in any readable storage medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions on an instruction execution system, apparatus, or device), or in combination with such instruction execution systems, apparatuses, or devices.
[0138] For the purposes of this specification, a "readable storage medium" may be any device that can contain, store, communicate, propagate or transmit a program for use with or in conjunction with an instruction execution system, device or apparatus. More specific examples of readable storage media (a non-exhaustive list) include the following: an electrical connection with one or more wirings (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), a fiber optic device, and a portable read-only memory (CDROM). In addition, the readable storage medium may even be paper or other suitable medium on which the program may be printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a memory.
[0139] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0140] A person skilled in the art may understand that all or part of the steps of implementing the above-mentioned implementation method may be completed by instructing related hardware through a program, and the program may be stored in a readable storage medium, which, when executed, includes one or a combination of the steps of the implementation method.
[0141] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a readable storage medium. The storage medium may be a read-only memory, a disk or an optical disk, etc.
[0142] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present application. In this specification, the schematic representations of the above terms are not necessarily the same embodiment / method or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments / methods or examples described in this specification and the features of the different embodiments / methods or examples, unless they are contradictory.
[0143] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0144] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.< / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter> < / delimiter>
Claims
1. A method for extracting events from electronic medical record text, characterized in that: include: Based on the punctuation marks of the medical record text, the paragraphs are divided into sentences and a list of k sentences S = [S1, S2, S3, ..., Sk] is generated; Segment each sentence in the sentence list one by one, and the segmentation list of the k-th sentence Sk is Sk=[C1, C2, C3, ..., Cm]; Each word segment of the sentence is vectorized through the trained word vector, and the word segment list of the k-th sentence Sk is vectorized as Sk=[e1, e2, e3, …, em]; Obtain the vector representation of each sentence after passing through the bidirectional long short-term memory neural network. The vector set obtained by the k-th sentence Sk after passing through the bidirectional long short-term memory neural network is H=[h1, h2, h3, …, hm]; Calculate the weight of each word in the sentence, and take the weighted sum of all word vectors as the feature vector h*. ,in, , , , represents the parameters that need to be learned, The dimension is dw *1, The dimension is 1*m, , the dimension of M is dw*m, dw represents the dimension of the vector, and m is the number of word segments in the kth sentence; Calculate the number of events n contained in each sentence through the feature vector h* of each sentence, and obtain the number of events array N=[n1, n2, n3, ..., nq] at each sentence level, where nq is the number of events predicted for the qth sentence; and Get the total number of sentence-level events Na= ; The number of events n contained in each sentence is calculated by using the feature vector h* of each sentence, including: calculating by the softmax function, taking the maximum probability of the number of events n (10≥n≥0) as the number of events n contained in each sentence; It also includes: adding division marks at the beginning and end of a paragraph; Divide the electronic medical record sentences based on the sentence-level event number array N, scan the array N, and when ni≠0 and i>1, add a division mark before the beginning of this sentence, and when ni=0 and i>1, do not process, and continue to scan the next sentence until the scanning is completed; and Obtain the description paragraphs corresponding to each event based on the division marks; Also included: Verify the effectiveness of paragraph divisions by the length of text between division tags.
2. The method for extracting events from electronic medical record text according to claim 1, characterized in that: The method for obtaining the trained word vector is: segmenting the electronic medical record text and then training the segmented words.
3. The method for extracting events from electronic medical record text according to claim 2, characterized in that: The hm is obtained by training the word vector em of the sentence through a bidirectional long short-term memory neural network. The word vector em is positively outputted by the bidirectional long short-term memory neural network as follows: , the reverse output is , then the vector obtained by the mth word after passing through the bidirectional long short-term memory network is hm= , where ⊕ means adding corresponding vector elements.
4. The method for extracting events from electronic medical record text according to claim 3, characterized in that: The effectiveness of paragraph division is verified by the length of text between division marks, including: when the length L of text between two division marks is less than the threshold Lmin, the text between them is used as the sentence to be merged. If the sentence to be merged is the first sentence of a paragraph, remove the division mark after the sentence to be merged, so that the current description sentence is merged with the next description sentence, and the total number of paragraph events Na=Na-1; If the sentence to be merged is the last sentence of a paragraph, remove the division mark before the sentence to be merged, so that the current description sentence is merged with the previous description sentence, and the total number of paragraph events Na=Na-1; and If the sentence to be merged is in the middle of a paragraph, use the named entity recognition model to identify the last entity Ea of the sentence before the sentence to be merged, the first entity Eb, the last entity Ec, and the first entity Ed of the sentence after the sentence to be merged, and calculate the correlation coefficient between Ea and Eb, which is recorded as<Ea,Eb> , calculate the correlation coefficient of Ec and Ed<Ec,Ed> ,like<Ea,Eb> ≥<Ec,Ed> , remove the division mark before the sentence to be merged, merge the current description sentence with the previous description sentence, and at the same time, the total number of paragraph events Na=Na-1, if<Ea,Eb> <<Ec,Ed> , remove the division mark after the sentence to be merged, merge the current description sentence with the next description sentence, and the total number of paragraph events Na=Na-1.
5. An electronic medical record text event extraction device, used to implement the electronic medical record text event extraction method according to any one of claims 1 to 4, characterized in that: include: A sentence segmentation module, which segments paragraphs into sentences based on punctuation marks in the medical record text and generates a list of k sentences S=[S1, S2, S3, ..., Sk]; A word segmentation module, which performs word segmentation on each sentence in the sentence list one by one, and the word segmentation list of the k-th sentence Sk is Sk=[C1, C2, C3, ..., Cm]; A vectorization module, which vectorizes each word of a sentence using trained word vectors. The word list of the k-th sentence Sk is vectorized as Sk=[e1, e2, e3, ..., em]; A vector representation acquisition module through a neural network, wherein the vector representation acquisition module through a neural network acquires the vector representation of each sentence through a bidirectional long short-term memory neural network, and the vector set acquired by the k-th sentence Sk through the bidirectional long short-term memory neural network is H=[h1, h2, h3, ..., hm]; A feature vector acquisition module calculates the weight of each word in the sentence, and the weighted sum of all word vectors is used as the feature vector h*. ,in, , , , represents the parameters that need to be learned, The dimension is dw *1, The dimension is 1*m, , the dimension of M is dw*m, dw represents the dimension of the vector, and m is the number of word segments in the kth sentence; An event number acquisition module, wherein the event number acquisition module calculates the number of events n contained in each sentence through the feature vector h* of each sentence, and obtains an array of the number of events at the sentence level N=[n1, n2, n3, ..., nq], where nq is the number of events predicted for the qth sentence; and The total number of events acquisition module obtains the total number of sentence-level events Na= .
6. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory so that the processor executes the method according to any one of claims 1 to 4.
7. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which are used to implement the method according to any one of claims 1 to 4 when executed by a processor.
Citation Information
Patent Citations
Extraction method of entity relationship of electronic medical record, based on BLSTM and attention mechanism
CN108536754A
Method and apparatus of recognizing named entity
US20210103701A1