A medical text generation method, device, equipment and storage medium
By converting speech data into text and using medical thesaurus and entity participle models to screen and embed target entities, the problem of inefficient generation of structured electronic medical records is solved, and the generation efficiency and quality of medical texts is improved.
Patent Information
- Application Number
- CN202111044788.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-07
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-09-07
AI Technical Summary
In the prior art, it takes a long time for medical personnel to generate structured electronic medical records, resulting in inefficiency.
By converting the voice data into text data, and using pre-constructed medical thesaurus and entity word segmentation models, the target entities are filtered out according to the weights of the entities to be selected and embedded in the medical template to generate structured medical text.
It improves the efficiency of generating structured medical texts, liberates the doctor's hands, and allows doctors to focus more on understanding the patient's physical state, thereby improving the quality of medical texts.
Smart Images

Figure CN113761899B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for generating medical text. Background Art
[0002] Electronic medical records are records of medical personnel's medical activities such as examination, diagnosis, and treatment of patients' diseases, including their occurrence, development, and outcome. Among them, structured electronic medical records play an important role in medical treatment, prevention, teaching, scientific research, and hospital management due to their automatic tracking characteristics.
[0003] At present, medical staff usually generate structured electronic medical records by keyboard input based on electronic medical record editor software during conversations with patients. However, due to the complexity of text information in structured electronic medical records, it takes a long time to obtain structured medical texts. Summary of the invention
[0004] The purpose of this application is to provide a medical text generation method, device, equipment and storage medium to improve the efficiency of generating structured medical texts in response to the deficiencies in the above-mentioned prior art.
[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for generating medical text, the method comprising:
[0007] Converting received voice data into text data;
[0008] Parsing the text data based on a pre-built medical word library to obtain a title and a plurality of entities to be selected included in the text data;
[0009] Filtering at least one target entity from the multiple entities to be selected according to the weight of each entity to be selected, wherein the weight of the entity to be selected is used to represent the importance of the entity to be selected;
[0010] According to the title included in the text data, the at least one target entity is embedded in a corresponding position of the title in a medical template retrieved based on the voice data to obtain a medical text.
[0011] Optionally, the text data is parsed based on a pre-built medical word library to obtain a title and a plurality of entities to be selected included in the text data, including:
[0012] Revising the text data based on a pre-built medical word library to obtain revised text data;
[0013] Comparing the revised text data with a pre-built title library to obtain the titles included in the text data;
[0014] The revised text data is input into a pre-trained entity segmentation model to obtain a plurality of entities to be selected included in the text data.
[0015] Optionally, the voice data includes: doctor voice data and patient voice data;
[0016] The text data is parsed based on the pre-built medical word library to obtain the title and multiple entities to be selected included in the text data, including:
[0017] Performing semantic analysis on the text data to obtain doctor text data, titles in the doctor text data, patient text data, and titles in the patient text data;
[0018] The doctor text data and the patient text data are respectively input into a pre-trained entity segmentation model to obtain a plurality of entities to be selected included in the text data.
[0019] Optionally, before selecting at least one target entity from the plurality of entities to be selected according to the weights of the entities to be selected, the method further includes:
[0020] Determine the subject words associated with each of the entities;
[0021] The weight of each of the candidate entities is determined according to the type of the medical template, the time decay factor, the number of times the doctor uses each of the candidate entities, and the probability of each of the candidate entities appearing in the subject word.
[0022] Optionally, the embedding of the at least one target entity into a corresponding position of the title in a medical template retrieved based on the voice data according to the title included in the text data to obtain a medical text comprises:
[0023] Based on the title included in the text data, searching for a target location associated with the title word from the medical module;
[0024] The target entity is embedded into the target position associated with the title word in the medical template to obtain the medical text.
[0025] Optionally, the method further comprises:
[0026] Convert the voice query data input by the doctor into text query data;
[0027] Result data corresponding to the text query data is retrieved from the database and the result data is output.
[0028] Optionally, after selecting at least one target entity from the plurality of entities to be selected according to the weights of the entities to be selected, the method further comprises:
[0029] Determining the association between the target entities according to the entity type of the target entities and the element information in the predefined triple;
[0030] A knowledge graph is constructed based on the correlation between the target entities.
[0031] In a second aspect, the present application also provides a medical text generation device, the device comprising:
[0032] A conversion module, used for converting received voice data into text data;
[0033] A processing module, used for parsing the text data based on a pre-built medical word library to obtain a title and a plurality of entities to be selected included in the text data;
[0034] A screening module, used to screen out at least one target entity from the plurality of entities to be selected according to the weight of each entity to be selected, wherein the weight of the entity to be selected is used to represent the importance of the entity to be selected;
[0035] An embedding module is used to embed the at least one target entity into a corresponding position of the title in a medical template retrieved based on the voice data according to the title included in the text data, so as to obtain a medical text.
[0036] Optionally, the processing module is specifically used to revise the text data based on a pre-built medical vocabulary to obtain revised text data; compare the revised text data with a pre-built title library to obtain the titles included in the text data; input the revised text data into a pre-trained entity segmentation model to obtain multiple candidate entities included in the text data.
[0037] Optionally, the voice data includes: doctor voice data and patient voice data;
[0038] Correspondingly, the processing module is also specifically used to perform semantic analysis on the text data to obtain doctor text data, titles in the doctor text data, patient text data, and titles in the patient text data; the doctor text data and the patient text data are respectively input into a pre-trained entity segmentation model to obtain multiple candidate entities included in the text data.
[0039] Optionally, the device further comprises: a determination module;
[0040] The determination module is used to determine the main words associated with each of the entities; and determine the weight of each of the candidates according to the type of the medical template, the time decay factor, the number of times the doctor uses each of the candidates, and the probability of each of the candidates appearing in the main words.
[0041] Optionally, the embedding module is specifically used to find the target position associated with the title word from the medical module based on the title included in the text data; embed the target entity into the target position associated with the title word in the medical template to obtain the medical text.
[0042] Optionally, the device further comprises: an output module;
[0043] The output module is used to convert the voice query data input by the doctor into text query data; retrieve the result data corresponding to the text query data from the database, and output the result data.
[0044] Optionally, the device further comprises: a construction module;
[0045] The construction module is used to determine the association between each target entity according to the entity type of each target entity and the element information in the pre-defined triple; and construct a knowledge graph according to the association between each target entity.
[0046] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the medical text generation method of the first aspect above.
[0047] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the medical text generation method of the first aspect are executed.
[0048] The beneficial effects of this application are:
[0049] The embodiments of the present application provide a medical text generation method, apparatus, device and storage medium, the method comprising: converting received voice data into text data; parsing the text data based on a pre-constructed medical vocabulary to obtain a title and multiple entities to be selected included in the text data; screening out at least one target entity from the multiple entities to be selected based on the weight of each entity to be selected, the weight of the entity to be selected being used to characterize the importance of the entity to be selected; and embedding at least one target entity into a corresponding position of the title in a medical template retrieved based on the voice data based on the title included in the text to obtain a medical text.
[0050] By adopting the medical text generation method provided in the embodiment of the present application, the voice data collected during the diagnosis process can be directly converted into text data through voice conversion technology, and a pre-built medical vocabulary can be used to obtain the title and multiple entities to be selected included in the text data, and then the target entity is obtained according to the weight of each entity to be selected, and then the title in the text data is matched with the title in the medical template, and the target entity associated with the title is embedded in the corresponding position of the matching title in the medical template to obtain a structured medical text. It can be seen that this can not only improve the efficiency of generating structured medical texts, but also free the hands of doctors, allowing doctors to more attentively understand the patient's physical condition, thereby improving the quality of the generated structured medical texts. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 A schematic diagram of a scenario of a medical text generation system provided in an embodiment of the present application;
[0053] Figure 2 A flowchart of a method for generating medical text provided in an embodiment of the present application;
[0054] Figure 3 A flowchart of another method for generating medical text provided in an embodiment of the present application;
[0055] Figure 4 A flowchart of another method for generating medical text provided in an embodiment of the present application;
[0056] Figure 5 A flowchart of another method for generating medical text provided in an embodiment of the present application;
[0057] Figure 6 A flowchart of another method for generating medical text provided in an embodiment of the present application;
[0058] Figure 7 A schematic diagram of the structure of a medical text generation device provided in an embodiment of the present application;
[0059] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0061] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0062] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0063] Before explaining the embodiments of the present application in detail, the application scenario of the present application is first introduced. The application scenario can be specifically a scenario of generating structured electronic medical records, that is, structured medical texts, based on voice input. Figure 1 A schematic diagram of a scenario of a medical text generation system provided in an embodiment of the present application, such as Figure 1 As shown, the system includes a voice acquisition module 101 and a data processing module 102. The voice acquisition module 101 may include a voice acquisition device, such as a microphone, a voice recorder, and other devices with a voice collection function, and may also include a voice conversion module. The voice conversion module may convert the voice data collected by the voice acquisition device into text data, and send the text data to the data processing module 102. The data processing module 102 may parse and process the text data based on a pre-built medical vocabulary, and may also segment the text data through a pre-built entity segmentation model to obtain multiple entities, and embed the entity into the corresponding position on the medical template retrieved based on the voice data according to the title in the text data, thereby obtaining a structured medical text.
[0064] The medical text generation method mentioned in this application is illustrated as follows with reference to the accompanying drawings. Figure 2 A schematic diagram of a process for generating medical text provided in an embodiment of the present application. Figure 2 As shown, the method may include:
[0065] S201: Convert received voice data into text data.
[0066] Optionally, during the communication between the doctor and the patient, the doctor can wake up the voice assistant supported by the medical text generation system through the "wake-up word", and the voice assistant can display the text data corresponding to the voice data on its interface, and can also interact with the doctor. The doctor can output voice information according to the patient's current state, and retrieve the medical module corresponding to the patient's current state from the database. For example, if the patient's current state is hospitalized, the doctor can output similar voice information such as "admission record", and retrieve the medical template corresponding to the voice data of "admission record" from the database. The medical template may include titles such as chief complaint, current medical history, past history, etc. It is understandable that after the doctor and the patient communicate, the audio file collected by the voice collection device (such as a voice recorder) during the communication process can be uploaded to the medical text generation system, and the voice data in the audio file is processed by the medical text generation system to obtain a structured medical text. It should be noted that this application does not limit it.
[0067] Specifically, the received voice data may be input into a pre-trained text generation model, and after the text generation model recognizes the voice data, the voice data may be converted into text data.
[0068] S202: parse the text data based on a pre-built medical vocabulary to obtain a title and multiple entities to be selected included in the text data.
[0069] The medical word library can be generated in advance based on the medical standardized vocabulary and the actual medical corpus collected. Specifically, a static medical word library can be generated based on the medical standardized vocabulary, and a dynamic medical word library can be generated based on the actual medical corpus collected. The dynamic medical word library can be updated according to actual needs. It can be understood that the entities included in the dynamic medical word library are some common medical words, that is, medical words expressed by doctors in colloquial language. The dynamic medical word library can also be divided into multiple sub-dynamic medical word libraries according to the category of the entity, such as a surgical word library, a part word library, an examination word library, etc.
[0070] The text data converted from voice data, for example, "The main complaint is pain in the right lower abdomen for one day", can be matched with the medical terms included in the medical vocabulary to obtain the title included in the text data (such as main complaint) and multiple entities to be selected (such as right lower abdomen, pain, day).
[0071] S203 , selecting at least one target entity from a plurality of entities to be selected according to the weight of each entity to be selected, wherein the weight of the entity to be selected is used to represent the importance of the entity to be selected.
[0072] Among them, each candidate entity in the text data has a corresponding weight, and the size of the weight is related to the doctor's word usage habits, the department where the doctor is located, and other information. Assuming that there are 80 candidate entities associated with a title, the weights corresponding to these 80 candidate entities can be determined according to the importance of each candidate entity under the doctor's department and the correlation with the doctor's word usage habits. It can be understood that the larger the weight corresponding to the candidate entity, the more important the candidate entity is under the title, that is, the more it can reflect the patient's physiological health information. In an achievable embodiment, the candidate entity with a weight greater than the preset weight can be used as the target entity.
[0073] It is understandable that each department and each doctor has its own characteristics. By introducing the concept of weight, the screened target entities can be more closely matched with the doctor's semantics. This can not only improve the efficiency of generating structured medical texts, but also improve the quality of structured medical texts and avoid the influence of some unnecessary information (such as the doctor's accent).
[0074] S204. According to the title included in the text data, embed at least one target entity into a corresponding position of the title in the medical template retrieved based on the voice data to obtain a medical text.
[0075] Among them, it can be known from the above description that the doctor can retrieve the medical template that matches the patient's current state according to the voice data corresponding to the patient's current state output, such as the medical template corresponding to the admission record, which may include titles, such as chief complaint, current medical history, etc. The title included in the text data can be compared with the title included in the medical text, and the multiple target entities under the title in the text data can be embedded into the position corresponding to the title in the medical template. For example, assuming that the title is the chief complaint, the multiple target entities associated with the chief complaint in the text data can be added to the position corresponding to the title in the medical template, and then a structured medical text can be obtained, and a structured electronic medical record can be generated.
[0076] In summary, in the medical text generation method provided in the embodiment of the present application, the voice data collected during the diagnosis process can be directly converted into text data through voice conversion technology, and a pre-built medical vocabulary can also be used to obtain the title and multiple entities to be selected included in the text data, and then the target entity is obtained according to the weight of each entity to be selected, and then the title in the text data is matched with the title in the medical template, and the target entity associated with the title is embedded in the corresponding position of the matching title in the medical template to obtain a structured medical text. It can be seen that this can not only improve the efficiency of generating structured medical texts, but also free the hands of doctors, allowing doctors to more attentively understand the patient's physical condition, thereby improving the quality of the generated structured medical texts.
[0077] Figure 3 A flowchart of another method for generating medical text provided in an embodiment of the present application is shown as follows: Figure 3 As shown, optionally, the text data is parsed based on the pre-built medical word library to obtain the title and multiple entities to be selected included in the text data, including:
[0078] S301. Revise the text data based on a pre-built medical vocabulary to obtain revised text data.
[0079] Among them, the medical terms included in the medical vocabulary are all verified entities, that is, the meaning and form of each medical term are correct. The text data can be revised first according to the medical terms in the medical vocabulary, and the incorrectly converted words in the text data can be modified into correct medical terms. For example, because some doctors have accent problems, the text data after voice conversion includes the word "right lower abdomen", and the medical term included in the medical vocabulary is "right lower abdomen", then the word "right lower abdomen" in the text data can be modified to "right lower abdomen", which can avoid the phenomenon that the text data does not match the patient's actual condition due to external factors.
[0080] S302: Compare the revised text data with a pre-built title library to obtain the titles included in the text data.
[0081] Among them, the pre-built title library may also belong to the medical word library mentioned above, or it may be a word library outside the medical word library, which is not limited by this application. The titles included in the title library include chief complaint, current medical history, past medical history, etc. In an achievable embodiment, the text data is equivalent to a sentence, and the revised text data can be compared with the titles in the title library, and the title with the greatest matching degree is used as the title contained in the text data.
[0082] In a feasible embodiment, when the speech data is an audio file, the text data converted from the speech data is first revised according to the medical vocabulary to obtain revised text data, and the revised text data is input into a pre-trained segmentation model. The segmentation model can segment the revised text data to obtain multiple sentences, and then compare each sentence with the title library to obtain the scored title contained in each sentence.
[0083] S303: input the revised text data into a pre-trained entity segmentation model to obtain a plurality of entities to be selected included in the text data.
[0084] Among them, the initial entity segmentation model can be trained according to the pre-constructed training samples. After meeting the training conditions, the entity segmentation model is obtained. The revised text data is input into the entity segmentation model. After passing through the encoder and decoder in the entity segmentation model, multiple candidate entities can be obtained, and each candidate entity corresponds to an entity category, such as the entity type corresponding to the "right lower abdomen" entity is "part".
[0085] It should be noted that the text data may also include specific values such as body temperature, pulse, respiration, blood pressure, weight, height, etc., and the voice data may also be converted into some necessary medical formulas.
[0086] Figure 4 A flowchart of another method for generating medical text provided in an embodiment of the present application is shown as follows: Figure 4 As shown, optionally, the voice data includes: doctor voice data and patient voice data; the text data is parsed based on the pre-built medical vocabulary to obtain the title included in the text data and multiple candidates, including:
[0087] S401. Perform semantic analysis on text data to obtain doctor text data, titles in the doctor text data, patient text data, and titles in the patient text data.
[0088] S402: Input the doctor text data and the patient text data into pre-trained entity segmentation models respectively to obtain multiple entities to be selected included in the text data.
[0089] Among them, in the process of conversation between doctors and patients, generally speaking, doctors ask questions from the perspective of inquiry, and patients answer the questions asked by the doctor. The voice data collected in this way includes both doctor's voice data and patient's voice data. The voice information can be subjected to voiceprint recognition or semantic interpretation to obtain doctor's text data, and the title of the doctor's text data can be obtained based on the semantics of the doctor's text data; patient text data can also be obtained, and the title of the patient's text data can be obtained based on the semantics of the patient's text data.
[0090] The doctor's text data and the patient's text data are respectively input into the entity segmentation model, and the entity segmentation model can perform segmentation processing on the doctor's text data to obtain multiple candidate entities of titles associated with the doctor and multiple candidate entities of titles associated with the patient.
[0091] Figure 5 A flowchart of another method for generating medical text provided in an embodiment of the present application is shown as follows: Figure 5 As shown, optionally, before selecting at least one target entity from a plurality of candidate entities according to the weights of the candidate entities, the method further includes:
[0092] S501: Determine the subject associated with each entity.
[0093] S502: Determine the weight of each candidate entity according to the type of medical template, the time decay factor, the number of times the doctor uses each candidate entity, and the probability of each candidate entity appearing in the main word.
[0094] Among them, the subject words mentioned here are equivalent to the relevant description of a certain part of the patient's identity, such as the "right upper abdomen" mentioned above, and the symptoms of the "right upper abdomen" are almost certain, and it is impossible to have symptoms such as "dizziness", so the subject words included in the text data can be determined first.
[0095] According to the above description, when the doctor wakes up the voice assistant, the corresponding medical template can be retrieved based on the patient status information. The type of the medical template is related to the department in which the doctor is located, and each entity can have different weights according to the department; since it is usually the doctor who outputs the voice data, the number of times the doctor has used each candidate entity in the past will also affect the weight of each candidate entity, that is, each entity and the doctor have different behavior number weights; the probability of each candidate entity appearing in the subject word will also affect the weight of each candidate entity. If an entity associated with the subject word appears near the subject word, then the probability of representing the entity is greater. If an entity not associated with the subject word appears near the subject word, then the probability of representing the entity is smaller; time decay factor, some behaviors of doctors are continuously weakened by the influence of time. The farther the behavior time is from the present, the less significance the behavior has for medical staff at present, that is, the weight of the candidate entity will be smaller. Combine the weight corresponding to the type of medical template corresponding to each entity, the time decay factor, the weight of the number of times the doctor uses each candidate entity, and the probability of each candidate entity appearing in the main word, and then multiply them together, and use the multiplication result as the weight of each candidate entity. Among them, the multiplication result of the weight corresponding to the type of medical template and the time decay factor can be called the objective importance of each entity, and the multiplication result of the weight of the number of times the doctor uses each candidate entity and the probability of each candidate entity appearing in the main word can be called the importance of each entity to the doctor. The weight of each candidate entity can be obtained by combining the objective importance of each entity and its importance to the doctor.
[0096] It can be seen that the weights of each candidate entity are determined from multiple dimensions, and then the target entity that better matches the patient's actual physical condition is screened out, thereby improving the efficiency of generating structured medical texts.
[0097] Figure 6 A flowchart of another method for generating medical text provided in an embodiment of the present application is shown as follows: Figure 6 As shown, optionally, the above-mentioned embedding at least one target entity into the corresponding position of the title in the medical template retrieved based on the voice data according to the title included in the text data to obtain the medical text includes:
[0098] S601. Based on the title included in the text data, find the target position associated with the title word from the medical module.
[0099] S602: Embed the target entity into the target position associated with the title word in the medical template to obtain the medical text.
[0100] Among them, the title can be obtained from the text data, and the medical template also includes the title. It is necessary to embed the target entity in the text data into the corresponding position of the medical template according to the matching degree between the title obtained in the text data and the title in the medical template. Specifically, taking a title included in the text data as an example, the title is associated with multiple target entities. The position where the title appears in the medical template is found according to the title, and the position is used as the target position. After the target position is determined, the multiple target entities associated with the title can be directly embedded in the target position associated with the title word in the medical template in order, thereby obtaining the medical text.
[0101] Optionally, the method may further include: converting the voice query data input by the doctor into text query data; retrieving result data corresponding to the text query data from a database, and outputting the result data.
[0102] The doctor can also interact with the data processing device. Specifically, the voice query data input by the doctor can be converted into text query data according to the text conversion model. The text query data can be, for example, "Does the patient have a history of allergies?" Then, the patient can be queried from the database associated with the patient to see whether he has ever had allergies, and the patient's allergens can also be queried. The data processing device can broadcast the result of whether the patient has ever had allergies to the doctor by voice, and when the patient has a history of allergies, the allergens can also be broadcast to the doctor together, so that the doctor can understand the patient's information in a timely manner, and can quickly locate and intelligently retrieve the health information related to the patient, thereby improving the quality of medical text generation and making the generated medical text more in line with the patient's actual physical health status.
[0103] Optionally, after selecting at least one target entity from multiple candidate entities according to the weights of each candidate entity, the method may further include: determining the correlation between each target entity according to the entity type of each target entity and each element information in a predefined triple; and constructing a knowledge graph according to the correlation between each target entity.
[0104] Among them, the predefined triples may include (department, chief_compilint, chief complaint), (chief complaint, attribute), (disease, symptom), etc. It can be seen that each triple includes two element information, such as disease, symptom, etc. Each target entity has a corresponding entity type. For example, pain corresponds to symptoms. According to the correlation of each element in the triple, the target entities can also be associated with each other, and then a knowledge graph can be constructed according to the correlation between the target entities. The nodes in the knowledge graph are the target entities, and the lines in the knowledge graph are the corresponding associations between the target entities. It should be noted that the knowledge graph can be a newly built knowledge graph, and it is also a knowledge graph that updates the pre-built knowledge graph.
[0105] Figure 7 A schematic diagram of the structure of a medical text generation device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device comprises:
[0106] The conversion module 701 is used to convert the received voice data into text data;
[0107] A processing module 702 is used to parse the text data based on a pre-built medical word library to obtain a title and a plurality of entities to be selected included in the text data;
[0108] A screening module 703 is used to screen out at least one target entity from a plurality of candidate entities according to the weight of each candidate entity, where the weight of the candidate entity is used to represent the importance of the candidate entity;
[0109] The embedding module 704 is used to embed at least one target entity into a corresponding position of the title in the medical template retrieved based on the voice data according to the title included in the text, so as to obtain the medical text.
[0110] Optionally, the processing module 702 is specifically used to revise the text data based on a pre-built medical vocabulary to obtain revised text data; compare the revised text data with a pre-built title library to obtain the titles included in the text data; input the revised text data into a pre-trained entity segmentation model to obtain multiple candidate entities included in the text data.
[0111] Optionally, the voice data includes: doctor voice data and patient voice data;
[0112] Correspondingly, processing module 702 is also specifically used to perform semantic analysis on text data to obtain doctor text data, titles in doctor text data, patient text data, and titles in patient text data; the doctor text data and patient text data are respectively input into pre-trained entity segmentation models to obtain multiple candidate entities included in the text data.
[0113] Optionally, the device also includes: a determination module; the determination module is used to determine the main words associated with each entity; determine the weight of each candidate entity based on the type of medical template, the time decay factor, the number of times the doctor uses each candidate entity, and the probability of each candidate entity appearing in the main words.
[0114] Optionally, the embedding module 704 is specifically used to find the target position associated with the title word from the medical module based on the title included in the text data; embed the target entity into the target position associated with the title word in the medical template to obtain the medical text.
[0115] Optionally, the device further includes: an output module; the output module is used to convert the voice query data input by the doctor into text query data; retrieve result data corresponding to the text query data from the database, and output the result data.
[0116] Optionally, the device also includes: a construction module; the construction module is used to determine the correlation between each target entity based on the entity type of each target entity and the element information in the pre-defined triple; and construct a knowledge graph based on the correlation between each target entity.
[0117] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0118] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0119] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 801, a storage medium 802 and a bus 803, the storage medium 802 stores machine-readable instructions executable by the processor 801, when the electronic device is running, the processor 801 communicates with the storage medium 802 via the bus 803, and the processor 801 executes the machine-readable instructions to perform the steps of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0120] Optionally, the present application further provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above method embodiment are executed.
[0121] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0123] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0124] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0125] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0126] The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating medical text, characterized in that: The method comprises: Convert the received voice data into text data and medical formulas; and obtain the corresponding medical template according to the voice data; the voice data includes the wake-up word; the text data includes the values of the following parameters: body temperature, pulse, respiration, blood pressure, weight, height; The text data is parsed based on a pre-built medical word library to obtain a title and a plurality of entities to be selected included in the text data; the medical word library is constructed and generated based on medical standardized vocabulary and actual medical corpus; Determine the subject words associated with each of the entities; Determine the weight of each of the candidate entities according to the type of the medical template, the time decay factor, the number of times the doctor uses each of the candidate entities, and the probability of each of the candidate entities appearing in the subject word; select at least one target entity from the multiple candidate entities according to the weight of each of the candidate entities, and the weight of the candidate entity is used to represent the importance of the candidate entity; According to the title included in the text data, embedding the at least one target entity into a corresponding position of the title in a medical template retrieved based on the voice data to obtain a structured medical text; The text data is parsed based on the pre-built medical word library to obtain the title and multiple entities to be selected included in the text data, including: Revising the text data based on a pre-built medical word library to obtain revised text data; Comparing the revised text data with a pre-built title library to obtain the titles included in the text data; Inputting the revised text data into a pre-trained entity segmentation model to obtain a plurality of entities to be selected included in the text data; revising the text data based on a pre-built medical word library to obtain the revised text data, including: The text data is revised according to the medical words in the medical word library, and the incorrectly converted words in the text data are modified into correct medical words.
2. The method according to claim 1, characterized in that The voice data includes: doctor voice data and patient voice data; The text data is parsed based on the pre-built medical word library to obtain the title and multiple entities to be selected included in the text data, including: Performing semantic analysis on the text data to obtain doctor text data, titles in the doctor text data, patient text data, and titles in the patient text data; The doctor text data and the patient text data are respectively input into a pre-trained entity segmentation model to obtain a plurality of entities to be selected included in the text data.
3. The method according to claim 2, characterized in that The step of embedding the at least one target entity into a corresponding position of the title in a medical template retrieved based on the voice data according to the title included in the text data to obtain a medical text comprises: Based on the title included in the text data, searching for a target location associated with the title word from the medical module; The target entity is embedded into the target position associated with the title word in the medical template to obtain the medical text.
4. The method according to claim 1, characterized in that: The method further comprises: Converting the voice query data input by the doctor into text query data; Result data corresponding to the text query data is retrieved from the database and the result data is output.
5. The method according to claim 1, characterized in that After selecting at least one target entity from the plurality of entities to be selected according to the weights of the entities to be selected, the method further includes: Determining the association between the target entities according to the entity type of the target entities and the element information in the predefined triple; A knowledge graph is constructed based on the correlation between the target entities.
6. A medical text generation device, characterized in that: The device comprises: A conversion module, used to convert the received voice data into text data and medical formulas; and obtain a corresponding medical template according to the voice data; the voice data includes a wake-up word; the text data includes the values of the following parameters: body temperature, pulse, respiration, blood pressure, weight, height; A processing module, used for parsing the text data based on a pre-built medical word library to obtain a title and a plurality of entities to be selected included in the text data; the medical word library is constructed and generated based on medical standardized vocabulary and actual medical corpus; A determination module, used to determine the subject words associated with each of the entities; It is also used to determine the weight of each of the candidate entities according to the type of the medical template, the time decay factor, the number of times the doctor uses each of the candidate entities, and the probability of each of the candidate entities appearing in the subject word; A screening module, used for screening at least one target entity from the plurality of entities to be selected according to the weight of each entity to be selected, wherein the weight of the entity to be selected is used to represent the importance of the entity to be selected; An embedding module, configured to embed the at least one target entity into a corresponding position of the title in a medical template retrieved based on the voice data according to the title included in the text data, so as to obtain a structured medical text; The processing module is specifically used to revise the text data based on a pre-built medical vocabulary to obtain revised text data; compare the revised text data with a pre-built title library to obtain the titles included in the text data; input the revised text data into a pre-trained entity segmentation model to obtain multiple candidate entities included in the text data; the processing module is specifically used to revise the text data according to the medical words in the medical vocabulary, and modify the incorrectly converted words in the text data into correct medical words.
7. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the medical text generation method as described in any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the medical text generation method according to any one of claims 1 to 5 are executed.
