Conversation-based electronic medical record generation method, device and equipment and storage medium
By combining MCBERT-DPCNN and ERNIE-BiLSTM-CRF models, the problem of converting doctor-patient dialogue text into structured medical knowledge was solved, generating accurate and standardized electronic medical records that are applicable to unified standards across multiple departments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAQIAO UNIVERSITY
- Filing Date
- 2022-09-22
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies struggle to accurately convert doctor-patient dialogue texts into structured medical knowledge, Chinese medical named entity recognition has low accuracy, and electronic medical record templates from different departments are difficult to standardize.
A text classification model based on the medical pre-trained model MCBERT and the deep pyramid convolutional neural network DPCNN is adopted, combined with the semantic understanding framework ERNIE, the bidirectional long short-term memory network BiLSTM and the conditional random field CRF entity extraction model to generate rigorous and standardized electronic medical record text.
It enables the direct extraction of information from doctor-patient dialogues to generate accurate, rigorous, standardized electronic medical record texts that conform to medical language.
Smart Images

Figure CN115472252B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and more specifically, to a dialogue-based electronic medical record generation method, apparatus, device, and storage medium. Background Technology
[0002] With the development of medical informatization in hospitals at all levels across China, doctors need to use electronic medical record systems to record patient medical information. However, manually entering electronic medical records adds extra workload to doctors.
[0003] The dialogues between doctors and patients contain a wealth of medical information needed for writing electronic medical records. Making full use of these dialogues to extract key medical information and create electronic medical records provides a basis for patient treatment and plays a significant role in promoting hospital medical informatization.
[0004] Current technologies generally rely on speech recognition to directly convert doctor-patient conversations into text and input them into medical records. This method is highly redundant, containing a large amount of useless text. Building on this, methods have emerged that extract keywords from doctor-patient conversations and convert them into electronic medical records.
[0005] However, existing methods for generating electronic medical records based on keywords suffer from the following four problems, resulting in electronic medical records that are not rigorous, standardized, or consistent with medical language: 1. The medical vocabulary used in doctor-patient dialogue texts is too colloquial, making it difficult for prior technology to convert these texts into structured medical knowledge. 2. Doctor-patient dialogue texts often consist of short, single-sentence texts involving interactions between different roles, making it difficult for prior technology to capture the multi-layered semantic information of these short sentences. 3. Due to the scarcity of Chinese medical corpora and the dependencies between entity tags, the accuracy of named entity recognition in Chinese medical texts is low in prior technology. 4. The medical topics involved in doctor-patient dialogue texts often involve multiple departments, and currently, different departments or diseases require different electronic medical record templates, making it difficult for prior technology to achieve standardization and uniformity in electronic medical record writing.
[0006] In view of this, the applicant hereby submits this application after studying the existing technology. Summary of the Invention
[0007] The present invention provides a dialogue-based electronic medical record generation method, apparatus, device, and storage medium to improve at least one of the above-mentioned technical problems.
[0008] First aspect
[0009] This invention provides a dialogue-based electronic medical record generation method, which includes steps S1 to S4.
[0010] S1. Obtain the text data of the doctor-patient dialogue; wherein the text data is divided into multiple paragraphs according to the order in which the people speak;
[0011] S2. Input the text data into a pre-trained text classification model to obtain the electronic medical record entry category of each paragraph, and aggregate paragraphs with the same electronic medical record entry category to obtain a paragraph category set for each electronic medical record entry category; wherein, the text classification model is constructed based on the medical pre-trained model MCBERT and the deep pyramid convolutional neural network DPCNN;
[0012] S3. Input the paragraphs in each paragraph category set into the pre-trained entity extraction model to obtain the labels of medical named entities in each paragraph and form a set of entity label pairs; wherein, the entity extraction model is constructed based on the semantic understanding framework ERNIE, the bidirectional long short-term memory network BiLSTM and the conditional random field CRF.
[0013] S4. Based on the entity tag pair set and the entity relationship template, generate medical record text, and combine the medical record text to obtain electronic medical records.
[0014] The second aspect
[0015] This invention provides a dialogue-based electronic medical record generation device, comprising:
[0016] The initial data acquisition module is used to acquire text data of doctor-patient dialogue; wherein, the text data is divided into multiple paragraphs according to the order in which the people speak;
[0017] The medical record entry classification module is used to input the text data into a pre-trained text classification model, obtain the electronic medical record entry category of each paragraph, and aggregate paragraphs with the same electronic medical record entry category to obtain a paragraph category set for each electronic medical record entry category; wherein, the text classification model is constructed based on the medical pre-trained model MCBERT and the deep pyramid convolutional neural network DPCNN;
[0018] The entity label acquisition module is used to input paragraphs from each paragraph category set into a pre-trained entity extraction model, obtain the labels of medical named entities in each paragraph, and form a set of entity label pairs; wherein, the entity extraction model is constructed based on the semantic understanding framework ERNIE, the bidirectional long short-term memory network BiLSTM, and the conditional random field CRF.
[0019] The medical record generation module is used to generate medical record text based on the entity tag set and the entity relationship template, and to combine the medical record text to obtain electronic medical records.
[0020] Third aspect
[0021] This invention provides a dialogue-based electronic medical record generation device, which includes a processor, a memory, and a computer program stored in the memory; the computer program can be executed by the processor to implement the dialogue-based electronic medical record generation method as described in any paragraph of the first aspect.
[0022] Fourth aspect
[0023] This invention provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the dialogue-based electronic medical record generation method as described in any paragraph of the first aspect.
[0024] By adopting the above technical solution, the present invention can achieve the following technical effects:
[0025] The electronic medical record generation method of this invention can directly extract information from doctor-patient dialogues to generate accurate, rigorous, standardized, and medically compliant electronic medical record text. Attached Figure Description
[0026] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a flowchart illustrating the electronic medical record generation method.
[0028] Figure 2 This is a network structure diagram of a text classification model.
[0029] Figure 3 This is the network structure diagram of the entity extraction model.
[0030] Figure 4 This is a schematic diagram of generating electronic medical records based on entity relationship templates.
[0031] Figure 5 This is a schematic diagram of the electronic medical record generation device. Detailed Implementation
[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0033] Example 1
[0034] Please see Figures 1 to 4 The first embodiment of the present invention provides a dialogue-based electronic medical record generation method, which can be executed by a dialogue-based electronic medical record generation device (hereinafter referred to as: generation device). In particular, it is executed by one or more processors in the generation device to implement steps S1 to S4.
[0035] S1. Obtain the text data of the doctor-patient dialogue. The text data is divided into multiple paragraphs according to the order in which the people speak.
[0036] Specifically, the doctor-patient dialogue can be a conversation between people in the outpatient clinic, the audio of a video consultation in an online consultation, or the chat log in a text consultation in an online consultation. This invention does not limit the specific form of the doctor-patient dialogue.
[0037] It should be noted that the text data can be a statement made by a doctor or patient, or a chat log containing multiple statements generated after a consultation. This invention does not limit the specific content format of the text data.
[0038] Preferably, the doctor-patient dialogue is a voice dialogue. Therefore, based on the above embodiments, in an optional embodiment of the present invention, step S1 specifically includes steps S11 to S12.
[0039] S11. Obtain the voice data of the doctor-patient dialogue.
[0040] S12. Perform speech recognition based on the speech data to obtain text data.
[0041] Speech recognition converts voice dialogue data into text information to facilitate subsequent extraction of the dialogue content. It is understood that the generating device can be an electronic device with computing power, such as a portable laptop, desktop computer, server, smartphone, or tablet computer.
[0042] In this embodiment of the invention, the training data for the model comes from doctor-patient dialogue data from a well-known domestic online medical website. The acquired doctor-patient dialogue data undergoes data augmentation processing to obtain the current experimental data. The data on this website has been anonymized and does not involve patient privacy; therefore, it can be publicly accessed. The experiment used 891 Chinese doctor-patient dialogue data sets, including dialogue data from departments such as internal medicine, surgery, and pediatrics wards. The dialogue data uses D (Doctor) and P (Patient) to represent the roles of the doctor and patient in the doctor-patient dialogue, respectively, and is stored in the format of "Doctor-Patient Role: Dialogue Content".
[0043] S2. Input the text data into a pre-trained text classification model to obtain the electronic medical record (EMR) entry category for each paragraph. Then, aggregate paragraphs with the same EMR entry category to obtain a set of paragraph categories for each EMR entry category. The text classification model is built based on the medical pre-trained model MCBERT and the deep pyramid convolutional neural network DPCNN.
[0044] Specifically, the dialogue text data is input into the MCBERT-DPCNN Chinese dialogue text classification method, which is based on the medical pre-trained model MCBERT and the deep pyramid convolutional neural network (DPCNN), to identify the electronic medical record entry category to which each paragraph in the dialogue text belongs.
[0045] In this embodiment, a text classification model is used to classify each paragraph to correspond to a medical record entry in the electronic medical record, thereby determining which entry in the electronic medical record the text in the paragraph should be filled in, thus avoiding the problem of messy content in the subsequent generated electronic medical record.
[0046] like Figure 2 As shown, based on the above embodiments, in an optional embodiment of the present invention, the text classification model includes a medical pre-trained model MCBERT, a deep pyramid convolutional neural network DPCNN, a max pooling layer, a fully connected layer, and a softmax classifier connected in sequence. Preferably, step S2 specifically includes steps S21 to S24.
[0047] S21. Input each paragraph in the text data into the medical pre-trained model MCBERT to obtain the word vector matrix.
[0048] S22. Input the word vector matrix into the deep pyramid convolutional neural network DPCNN to obtain the feature representation vector set.
[0049] S23. Input the set of feature representation vectors into the max pooling layer to obtain the global feature representation vector.
[0050] S24. Input the global feature representation vector into the fully connected layer, and then use the Softmax classifier to classify and obtain the electronic medical record entry category for each paragraph.
[0051] Specifically, first, divide each paragraph of text... After being fed into the MCBERT model for word embedding, a word vector matrix is obtained. The formula is:
[0052] In the formula, It is a word vector concatenation operator. For the first Word vectors of individual characters, , For paragraph text The number of characters For word vector dimensions, This is the word vector matrix.
[0053] Then, the resulting word vector matrix A new set of feature representation vectors is generated from the input DPCNN.
[0054] In the formula, This represents the number of convolutional kernels. It generates feature vectors. The formula for calculating sets is:
[0055] In the formula, For convolution kernel, For deviation, This represents a nonlinear transformation function.
[0056] Finally, after max pooling, we get 3D global feature representation vector The text is then fed into a fully connected layer, where it is computed using a Softmax classifier to output the paragraph text. The corresponding electronic medical record entry classification probability distribution The calculation formula is as follows:
[0057] In the formula, These are trainable weight parameters. This is a bias term.
[0058] In this embodiment, a text classification model based on MCBERT and DPCNN was constructed, which effectively captures long-term dependency information at multiple abstract levels by increasing the depth of the CNN network, thereby improving the classification performance of the medical dialogue text classification model.
[0059] The training steps for a text classification model include:
[0060] First, given a sample size of Doctor-patient dialogue dataset
[0061] In the formula, The first in the representative doctor-patient dialogue dataset A sample dialogue This represents the number of dialogue samples in the doctor-patient dialogue dataset. Includes The dialogue paragraph text, in which Representing the A dialogue paragraph text, .
[0062] Specifically, the number of dialogue samples is 891; doctor-patient dialogue dataset. .
[0063] Then, based on the doctor-patient dialogue dataset Design a set of electronic medical record entry categories
[0064] In the formula, yes The corresponding electronic medical record entry categories, This represents the number of electronic medical record entry categories.
[0065] Specifically, R=5. , .
[0066] It is understandable that in step S2, As input data for a text classification model, As output data of the text classification model, a sample pair is formed.
[0067] In this embodiment, a portion of the doctor-patient dialogue dataset and medical category annotation set A medical category annotation dataset was created. Labeling datasets for medical categories. The training set was divided into two parts in an 8:1:1 ratio. Validation set and test set .
[0068] Then, the training set and verification set The input text classification model (i.e., the MCBERT-DPCNN model) is used to train the model. In this embodiment, when training the text classification model, according to... The formula for the design loss function is:
[0069] In the formula, This indicates a real medical category.
[0070] Applying gradient descent algorithm to the loss function on the training set Update the network parameters based on the current parameters until the maximum number of iterations is reached. This yields a well-trained text classification model (i.e., the MCBERT-DPCNN model).
[0071] S3. Input the paragraphs from each paragraph category set into the pre-trained entity extraction model to obtain the labels of medical named entities in each paragraph and form a set of entity label pairs. The entity extraction model is built based on the semantic understanding framework ERNIE, the bidirectional long short-term memory network BiLSTM, and the conditional random field CRF.
[0072] Specifically, each paragraph is input into an entity extraction model built on the semantic understanding framework ERNIE, the bidirectional long short-term memory network BiLSTM, and the conditional random field CRF to identify the labels corresponding to each word in the paragraph.
[0073] In this embodiment, the ERNIE model is used to extract and construct feature vectors that can better represent characters, and then BiLSTM is used to capture the semantics of each character in the context. The CRF model can further learn sequence features based on the previous steps, which further improves the recognition effect of Chinese doctor-patient dialogue named entities.
[0074] like Figure 3 As shown, based on the above embodiments, in an optional embodiment of the present invention, the entity extraction model includes a semantic understanding framework ERNIE, a bidirectional long short-term memory network BiLSTM, a fully connected layer, a conditional random field layer CRF, and a softmax classifier connected in sequence. Preferably, step S3 specifically includes steps S31 to S35.
[0075] S31. Input the paragraphs from each paragraph category set into the semantic understanding framework ERNIE to obtain the word vector matrix.
[0076] S32. Input the word vector matrix into the Bidirectional Long Short-Term Memory (BiLSTM) network to obtain the hidden state sequence.
[0077] S33. Input the hidden state sequence into the fully connected layer to obtain the probability distribution matrix.
[0078] S34. Input the probability distribution matrix into the Conditional Random Field (CRF) layer to obtain the labeling sequence.
[0079] S35. Input the labeled sequence into the Softmax classifier to obtain the labels for each medical named entity.
[0080] Specifically, first analyze each paragraph separately. The word vector matrix is obtained after word embedding is performed on the ERNIE model. The formula is: In the formula, For paragraph text The Middle Word vectors of individual characters, For paragraph text The number of characters.
[0081] Then, the word vector matrix As input to the BiLSTM model, the hidden state sequence of the BiLSTM is obtained after BiLSTM computation: In BiLSTM, the state calculation formula for each LSTM cell is expressed as follows:
[0082] In the formula, the word vector matrix For the entire LSTM unit Input at any time LSTM unit Output at any moment For memory units, For sigmoid activation function, It is a weight matrix. It is the bias vector. Used to control time At that time, input memory storage unit The amount of information, Controlling the retention and forgetting of information Can control memory storage units At the current time Output .
[0083] Then, the hidden state sequence The text is fed into a fully connected layer to obtain any word of the categorized paragraph text. The set of probability distributions in
[0084] In the formula, characters respectively Predicted as the first The probability of the first part of the label and the probability of the second part of the label. The probability of the middle or end of a tag.
[0085] Then, The set of probability distributions Combined to form paragraph text Score probability matrix
[0086]
[0087] Then, As input to the CRF layer, the score probability matrix and transition score matrix Calculate the true label annotation sequence together The total score is calculated using the following formula:
[0088] In the formula, Indicates the first in the classification of medical texts The word was tagged. The probability, Represents the labels in the probability transition matrix Move to label The probability of. )express Classification of medical paragraph text The actual labeling sequence.
[0089] Then, Softmax is used for normalization to obtain the true label sequence. The normalized probability is calculated using the following formula:
[0090]
[0091] Specifically, after classifying the electronic medical record entries by category, the paragraph text is input into the entity extraction model, and the Viterbi dynamic programming algorithm is used to obtain the paragraph text. Optimal prediction sequence Its formula is:
[0092] Then, the text of each categorized medical paragraph input into the model is... Optimal prediction sequence The combination yields a set of medical named entities. .
[0093] In the formula, < >Represents the The named entity and its parent's first Tag pairs formed by individual tags, This represents the number of entity tag pairs.
[0094] The training steps for an entity extraction model include:
[0095] First, based on the doctor-patient dialogue dataset, or the set of paragraph categories for each electronic medical record entry after classification in step 1 (i.e., ...), a named entity tag set is designed. In the formula, The number of named entity tags.
[0096] Specifically, . , {Disease, clinical manifestations, medical procedures, medical equipment, drugs, medical test items, body, department, microorganisms, age, gender, quantitative values, time, time span, lifestyle habits, medical actions}.
[0097] Then, after redefining the BIO annotation pattern, a BIO tag set with 33 tags can be obtained.
[0098] in, This represents the beginning of the tag. Represents the middle or end of a tag. Indicates non-subjective words.
[0099] The specific content items are ={ disease, disease, Clinical manifestations Clinical manifestations Medical procedures Medical procedures Medical equipment Medical equipment drug, drug, Medical testing items Medical testing items Body, Body, Department Department Microorganisms Microorganisms age, age, gender, gender, Quantitative values, Quantitative values, time, time, Time span, Time span, Lifestyle habits Lifestyle habits Medical actions, Medical actions, }
[0100] In this embodiment, the medical text collection will be categorized. Represented as:
[0101] In the formula, Representing the The categorized paragraph texts.
[0102] In the formula, It is paragraph text The Middle One word, It is paragraph text The length.
[0103] Paragraph text The corresponding BIO tag sequence is:
[0104] In the formula, .
[0105] It is understandable that in step S3, As input data for entity extraction models As output data from the entity extraction model, a sample pair is formed.
[0106] In this embodiment, the paragraph category set And categorize medical text BIO tag set An entity annotation dataset was formed. For entity annotation datasets Divide into training set according to proportion Validation set and test set The ratio is 6:2:2.
[0107] Then, the training set and verification set The input entity extraction model (i.e., the ERNIE-BiLSTM-CRF model) is used to train the model. In this embodiment, when training the entity extraction model, the goal is to maximize the accuracy of the true label annotation sequence. The log-likelihood value is the loss function, and the gradient descent algorithm is used on the training set. The above is a sequence of labels for the real tags. The log-likelihood value is iteratively optimized until the maximum number of iterations is reached. Thus, the ERNIE-BiLSTM-CRF model is obtained.
[0108] Real label annotation sequence The log-likelihood is calculated using the following formula:
[0109]
[0110] S4. Based on the entity tag set and the entity relationship template, generate medical record text, and combine the medical record text to obtain electronic medical records.
[0111] Specifically, by leveraging medical named entities and the dependency syntactic relationships between them, medical information is extracted and matched with electronic medical record templates to generate rigorous, standardized electronic medical record text that conforms to medical language. This enables the generation of standardized Chinese electronic medical records from dialogue data.
[0112] In this embodiment, the expression for the entity tag pair is: In the formula, For the first Medical named entities, For the first Each tag. Specifically, the paragraph text input to the entity extraction model contains multiple medical named entities, therefore step S2 ultimately outputs a set of medical named entities composed of multiple entity tag pairs. .
[0113]
[0114] Entity Relationship Template The expression is: In the formula, For the first Placeholders for each tag For the first Placeholders for each tag This indicates the relationship between two tags. Specifically, in this embodiment, multiple entity relationship templates are pre-built. Forming a template set :
[0115] In the formula, For the number of templates, = For the first in the template set One template, < > and < Represented as a set of medical named entities The Middle The and the first One entity tag serves as a placeholder for medical entities in the template, and [link] is a word in the template that indicates the relationship between two entity tags.
[0116] Example of template set M: ={<Medical Examination Items>[Diagnosis]<Disease>,<Clinical Manifestations>[Duration]<Time Span>,<Body>[Appearance]<Clinical Manifestations>,<Lifestyle Habits>[Duration]<Time Span>,[Note]<Medical Procedures>…}. See Table 1 for examples of some electronic medical record templates.
[0117] Table 1. Selected Electronic Medical Record Templates
[0118]
[0119] like Figure 4 As shown, based on the above embodiments, in an optional embodiment of the present invention, step S4 specifically includes steps S41 to S43.
[0120] S41. Generate medical record text based on the entity label set and the entity relationship template.
[0121] Based on the above embodiments, in an optional embodiment of the present invention, step S41 specifically includes: filtering entity relationship templates from the template library according to the entity tag pair set, placing medical named entities in the positions corresponding to their tags, and generating medical record text.
[0122] Specifically, based on the medical named entity set obtained in step S3 Select suitable templates from the template set. Then, combine the medical named entity set. The medical named entities in the text are placed in the medical entity placeholders of the corresponding entity tags. In the process of generating medical record text .
[0123] For example: {<Chest CT, Medical Test Items>, <Bronchiectasis, Disease>} will generate "<Chest CT> diagnosed as <Bronchiectasis>".
[0124] S42. Using a knowledge graph, check the semantic validity of the medical record text. If a medical record is found to be inconsistent with semantic specifications, delete it. Preferably, step S42 specifically includes: inputting the medical named entity in the first placeholder of the medical record text into the knowledge graph, searching for the adjacent node set, and then searching for the medical named entity in the second placeholder of the medical record text within the adjacent node set. If the medical named entity in the second placeholder is not found in the adjacent node set, the current medical record text is deleted.
[0125] Specifically, for the medical record text set obtained in step S41 perform semantic legality checks on the medical record texts in sequence, and retain the electronic medical record texts that comply with the rules to form a natural language expression electronic medical record text set :
[0126] In the formula, is the number of electronic medical record texts that conform to medical common sense and semantic norms.
[0127] For example: For the medical record text “<X-ray and other examinations> diagnosed as <chronic bronchitis>” use the knowledge graph to check the text semantic legality. Send the named entity “X-ray and other examinations” in the medical entity placeholder 1 into the knowledge graph to find its adjacent nodes where is the number of relationship nodes. Search the adjacent nodes of the medical named entity “X-ray and other examinations” in sequence . If the named entity “chronic bronchitis” in the medical entity placeholder 2 is not found, it means that the electronic medical record text generated by this triple does not conform to medical common sense and semantic norms and will be deleted.
[0128] S43. Generate a natural language expression text based on the medical record text that conforms to the semantic norms, and perform combination to obtain an electronic medical record.
[0129] Specifically, the medical record text is triple data and needs to be converted into a natural language text. Preferably, step S43 specifically includes steps S431 and S432.
[0130] S431. Generate a natural language expression text based on the medical record text in the triple format that conforms to the semantic norms.
[0131] S432. Arrange according to the electronic medical record entry category of the paragraph where the natural language expression text is located to generate an electronic medical record.
[0132] Specifically, convert all the medical record texts generated by the templates into natural language expression texts, and then perform permutation and combination to form a medical record text set :
[0133] In the formula, is the number of generated medical record texts.
[0134] For example: “<Chest CT> diagnosed as <bronchiectasis>” is converted to ={Chest CT diagnosed as bronchiectasis.}.
[0135] Finally, the collection of electronic medical record texts expressed in natural language will be used. Each natural language expression in the electronic medical record text is arranged according to the category of electronic medical record entries, thus completing the generation of electronic medical records from doctor-patient dialogue data. The entire process of obtaining electronic medical records.
[0136] The electronic medical record generation method of this invention can directly extract information from doctor-patient dialogues to generate accurate, rigorous, standardized, and medically compliant electronic medical record text.
[0137] To facilitate understanding, the electronic medical record generation method of the present invention will be introduced below using a case study.
[0138] First, obtain the dialogue data. Example dialogue data. As shown below:
[0139] P: Can this chest CT scan detect bronchiectasis? (Male, 43 years old)
[0140] D: Hello, is this your test report?
[0141] P: Yes, I've had a cough and phlegm for half a month and it hasn't gotten better. The doctor said it might be bronchiectasis. Now I have a lot of white, frothy phlegm every day, and occasionally a little yellow-green phlegm. When I suction it out of my throat, I tend to cough when there's green phlegm.
[0142] D: Are these the only symptoms? No other symptoms?
[0143] P: There are no other symptoms.
[0144] D: Based on the chest CT scan results, you most likely have bronchiectasis.
[0145] P: What causes bronchiectasis? Will my smoking for over ten years have any effect?
[0146] D: Tuberculosis, pneumonia, and congenital malformations can all cause bronchiectasis. Smoking does not cause it, but it can worsen it!
[0147] D: You must quit smoking and prevent catching a cold!
[0148] Then, as Figure 2 As shown, the dialogue example data Input a text classification model and output the electronic medical record (EMR) entry category for each paragraph. Then, aggregate paragraphs with the same medical category label into their corresponding EMR modules, denoted as the categorized medical text set.
[0149] In the formula, This represents the collection of paragraph texts after the test set data has been categorized. This refers to the number of electronic medical record classification modules. (Dialogue example data) Table 2 shows an example of the classification results of electronic medical record entries.
[0150] Table 2 Examples of Medical Text Classification Results
[0151]
[0152] Then, as Figure 3 As shown, each classified paragraph is input into the entity extraction model to obtain a set of entity label pairs for all dialogue paragraph texts. .For example:
[0153] ={
[0154] {<Chest CT scan, medical test results>,<Bronchiectasis, disease>,<Male, gender>,<43 years old, age>}
[0155] {<Cough and sputum, clinical manifestations>,<White frothy sputum, clinical manifestations>,<Yellow-green sputum, clinical manifestations>,<Throat, body>}
[0156] {<Chest CT scan, medical laboratory test>, <Bronchiectasis, disease>}
[0157] {<Smoking, lifestyle habits>, <more than ten years, time span>}
[0158] {<Smoking cessation, medical procedure>, <Cold, medical procedure>}
[0159] …}
[0160] Then, as Figure 4 As shown, the set of entity labels output in step S3 Select the corresponding entity relationship template from the template library, and then generate the medical named entity set. The medical named entities in the text are placed in the medical entity placeholders of the corresponding entity tags. In the process of generating medical record text And all medical record texts generated from the templates. After combination, a medical record text set is formed. .For example:
[0161] ={Chest CT scan diagnosed bronchiectasis. Coughing and sputum production has persisted for half a month, with white frothy sputum and yellow-green sputum appearing in the throat. Smoking for over ten years. Consider quitting smoking and be careful to avoid catching a cold. …}
[0162] Finally, the collection of electronic medical record texts expressed in natural language will be used. Each natural language expression in the electronic medical record text is arranged according to the category of electronic medical record entries, thus completing the generation of electronic medical records from doctor-patient dialogue data. The entire process of obtaining electronic medical records. For example:
[0163] Table 3 Examples of Electronic Medical Records
[0164]
[0165] Example 2
[0166] Please see Figure 5 This invention provides a dialogue-based electronic medical record generation device, which includes:
[0167] Initial data acquisition module 1 is used to acquire text data of doctor-patient dialogue. The text data is divided into multiple paragraphs according to the order in which the people speak.
[0168] The medical record entry classification module 2 is used to input text data into a pre-trained text classification model, obtain the electronic medical record entry category for each paragraph, and aggregate paragraphs with the same electronic medical record entry category to obtain a set of paragraph categories for each electronic medical record entry category. The text classification model is built based on the medical pre-trained model MCBERT and the deep pyramid convolutional neural network DPCNN.
[0169] Entity label acquisition module 3 is used to input paragraphs from each paragraph category set into a pre-trained entity extraction model, obtain labels for medical named entities in each paragraph, and form a set of entity label pairs. The entity extraction model is built based on the semantic understanding framework ERNIE, the bidirectional long short-term memory network BiLSTM, and the conditional random field CRF.
[0170] The medical record generation module 4 is used to generate medical record text based on the entity label set and the entity relationship template, and to combine the medical record text to obtain electronic medical records.
[0171] Based on the above embodiments, in an optional embodiment of the present invention, the initial data acquisition module 1 specifically includes:
[0172] The voice acquisition unit is used to acquire voice data of doctor-patient conversations.
[0173] The speech recognition unit is used to perform speech recognition based on speech data and obtain text data.
[0174] Based on the above embodiments, in an optional embodiment of the present invention, the medical record entry classification module 2 specifically includes:
[0175] The unit for obtaining the word vector matrix is used to input each paragraph in the text data into the medical pre-trained model MCBERT to obtain the word vector matrix.
[0176] The feature representation vector acquisition unit is used to input the word vector matrix into the deep pyramid convolutional neural network DPCNN to obtain a set of feature representation vectors.
[0177] The global feature representation vector acquisition unit is used to input the set of feature representation vectors into the max pooling layer to obtain the global feature representation vector.
[0178] The medical record entry classification unit is used to input the global feature representation vector into the fully connected layer, and then use the Softmax classifier to classify and obtain the electronic medical record entry category for each paragraph.
[0179] Based on the above embodiments, in an optional embodiment of the present invention, the entity tag acquisition module 3 specifically includes:
[0180] The second word vector matrix acquisition unit is used to input paragraphs from each paragraph category set into the semantic understanding framework ERNIE to obtain word vector matrices.
[0181] The hidden state sequence acquisition unit is used to input the word vector matrix into the bidirectional long short-term memory network BiLSTM to obtain the hidden state sequence.
[0182] The probability distribution matrix acquisition unit is used to input the hidden state sequence into the fully connected layer and obtain the probability distribution matrix.
[0183] The labeling sequence acquisition unit is used to input the probability distribution matrix into the conditional random field (CRF) layer to obtain the labeling sequence.
[0184] The label classification unit is used to input the label sequence into the Softmax classifier to obtain the labels for each medical named entity.
[0185] Based on the above embodiments, in an optional embodiment of the present invention, the medical record generation module 4 includes:
[0186] The medical record text generation unit is used to generate medical record text based on the entity label set and the entity relationship template.
[0187] The semantic checking unit is used to check the semantic validity of medical record text through a knowledge graph. When a medical record is determined to be inconsistent with semantic specifications, it is deleted.
[0188] The medical record generation unit is used to generate natural language expression text based on medical record text that conforms to semantic specifications, and combine them to obtain electronic medical records.
[0189] Based on the above embodiments, in an optional embodiment of the present invention, the medical record text generation unit specifically includes: filtering entity relationship templates from a template library according to the entity tag pair set, placing medical named entities in the positions corresponding to their tags, and generating medical record text.
[0190] Based on the above embodiments, in an optional embodiment of the present invention, the semantic inspection unit specifically includes: inputting the medical named entity in the first placeholder of the medical record text into the knowledge graph, searching for the adjacent node set, and searching for the medical named entity in the second placeholder of the medical record text in the adjacent node set. If the medical named entity in the second placeholder is not found in the adjacent node set, the current medical record text is deleted.
[0191] Based on the above embodiments, in an optional embodiment of the present invention, the medical record generation unit specifically includes:
[0192] The Natural Language Expression Text Generation Subunit is used to generate natural language expression text based on medical record text in a triplet format that conforms to semantic specifications.
[0193] The electronic medical record generation subunit is used to arrange and generate electronic medical records according to the category of electronic medical record entries in the paragraph containing the natural language expression text.
[0194] Example 3
[0195] This invention provides a dialogue-based electronic medical record generation device, which includes a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement the dialogue-based electronic medical record generation method as described in any paragraph of Embodiment 1.
[0196] Example 4
[0197] This invention provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the dialogue-based electronic medical record generation method as described in any paragraph of Embodiment 1.
[0198] In the several embodiments provided in this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0199] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0200] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. In the absence of further restrictions, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0201] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0202] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0203] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0204] The use of "first" and "second" in the embodiments is merely to distinguish similar objects and does not represent a specific ordering of objects. It is understood that "first" and "second" can be interchanged in a specific order or sequence where permitted. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0205] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A dialogue-based electronic medical record generation method, characterized in that, Include: Acquire text data of doctor-patient dialogue; wherein the text data is divided into multiple paragraphs according to the order in which the people speak; The text data is input into a pre-trained text classification model to obtain the electronic medical record entry category of each paragraph, and paragraphs with the same electronic medical record entry category are aggregated to obtain a paragraph category set for each electronic medical record entry category; wherein, the text classification model is constructed based on the medical pre-trained model MCBERT and the deep pyramid convolutional neural network DPCNN; The paragraphs in each paragraph category set are input into a pre-trained entity extraction model to obtain the labels of medical named entities in each paragraph and form a set of entity label pairs; wherein, the entity extraction model is constructed based on the semantic understanding framework ERNIE, the bidirectional long short-term memory network BiLSTM, and the conditional random field CRF. Based on the entity tag pair set and the entity relationship template, generate medical record text, and combine the medical record text to obtain electronic medical records; The text classification model includes a medical pre-trained model MCBERT, a deep pyramidal convolutional neural network DPCNN, a max pooling layer, a fully connected layer, and a Softmax classifier connected in sequence. The text data is input into a pre-trained text classification model to obtain the electronic medical record entry categories for each paragraph, specifically including: Each paragraph in the text data is input into the medical pre-trained model MCBERT to obtain the word vector matrix; The word vector matrix is input into a deep pyramid convolutional neural network (DPCNN) to obtain a set of feature representation vectors. The set of feature representation vectors is input into a max pooling layer to obtain the global feature representation vector; The global feature representation vector is input into a fully connected layer, and then a Softmax classifier is used for classification to obtain the electronic medical record entry category for each paragraph. The entity extraction model includes a semantic understanding framework ERNIE, a bidirectional long short-term memory network BiLSTM, a fully connected layer, a conditional random field layer CRF, and a softmax classifier connected in sequence. The paragraphs from each paragraph category set are input into a pre-trained entity extraction model to obtain the labels of medical named entities in each paragraph, specifically including: Each paragraph from each paragraph category set is input into the semantic understanding framework ERNIE to obtain a word vector matrix; The word vector matrix is input into a bidirectional long short-term memory network (BiLSTM) to obtain the hidden state sequence. The hidden state sequence is input into the fully connected layer to obtain the probability distribution matrix; Input the probability distribution matrix into the Conditional Random Field (CRF) layer to obtain the labeling sequence; The labeled sequence is input into the Softmax classifier to obtain the labels for each medical named entity.
2. The dialogue-based electronic medical record generation method of claim 1, wherein, Based on the entity tag pair set and an entity relationship template, generate medical record text, and combine the medical record text to obtain an electronic medical record, specifically including: Based on the set of entity tag pairs and the entity relationship template, generate medical record text; The semantic validity of medical record texts is checked using a knowledge graph; when a medical record is found to be inconsistent with semantic specifications, it is deleted. Based on the medical record text that conforms to semantic specifications, natural language expression text is generated and combined to obtain electronic medical records.
3. The dialogue-based electronic medical record generation method according to claim 1, characterized in that, The expression for entity tag pairs is: In the formula, For the first Medical named entities, For the first One tag; Entity Relationship Template The expression is: In the formula, For the first Placeholders for each tag For the first Placeholders for each tag This indicates the relationship between two tags; Based on the set of entity tag pairs and the entity relationship template, medical record text is generated, specifically including: Based on the set of entity tag pairs, entity relationship templates are selected from the template library, medical named entities are placed in the positions corresponding to their tags, and the medical record text is generated. The semantic validity of medical record text is checked using a knowledge graph; when a medical record is determined to be inconsistent with semantic specifications, it is deleted. Specifically, this includes: Input the medical named entity in the first placeholder of the medical record text into the knowledge graph, search for the set of adjacent nodes, and search for the medical named entity in the second placeholder of the medical record text in the set of adjacent nodes; if the medical named entity in the second placeholder is not found in the set of adjacent nodes, delete the current medical record text. Based on medical record text conforming to semantic specifications, natural language expression text is generated and combined to obtain electronic medical records, specifically including: Generate natural language expression text from medical record text in a triplet format that conforms to semantic specifications; The electronic medical record entries are arranged according to the category of the paragraph containing the natural language expression text, and an electronic medical record is generated.
4. The dialogue-based electronic medical record generation method according to any one of claims 1 to 3, characterized in that, Obtain the text data of doctor-patient dialogue, specifically including: Obtain voice data of doctor-patient conversations; Speech recognition is performed based on the speech data to obtain the text data.
5. A dialogue-based electronic medical record generation device, characterized in that, Used to perform the dialogue-based electronic medical record generation method according to any one of claims 1 to 4; The electronic medical record generation device includes: The initial data acquisition module is used to acquire text data of doctor-patient dialogue; wherein, the text data is divided into multiple paragraphs according to the order in which the people speak; The medical record entry classification module is used to input the text data into a pre-trained text classification model, obtain the electronic medical record entry category of each paragraph, and aggregate paragraphs with the same electronic medical record entry category to obtain a paragraph category set for each electronic medical record entry category; wherein, the text classification model is constructed based on the medical pre-trained model MCBERT and the deep pyramid convolutional neural network DPCNN; The entity label acquisition module is used to input paragraphs from each paragraph category set into a pre-trained entity extraction model, obtain the labels of medical named entities in each paragraph, and form a set of entity label pairs; wherein, the entity extraction model is constructed based on the semantic understanding framework ERNIE, the bidirectional long short-term memory network BiLSTM, and the conditional random field CRF. The medical record generation module is used to generate medical record text based on the entity tag set and the entity relationship template, and to combine the medical record text to obtain electronic medical records.
6. The dialogue-based electronic medical record generation apparatus according to claim 5, wherein The medical record generation module includes: The medical record text generation unit is used to generate medical record text based on the entity tag pair set and an entity relationship template. The semantic checking unit is used to check the semantic validity of medical record text through the knowledge graph; when a medical record is found to be inconsistent with the semantic specifications, it is deleted. The medical record generation unit is used to generate natural language expression text based on medical record text that conforms to semantic specifications, and combine them to obtain electronic medical records.
7. A dialogue-based electronic medical record generating apparatus characterized by comprising: It includes a processor, a memory, and a computer program stored in the memory; the computer program can be executed by the processor to implement the dialogue-based electronic medical record generation method as described in any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the dialogue-based electronic medical record generation method as described in any one of claims 1 to 4.