A system for obtaining entity relationship diagrams based on medical record text
By combining neural network models and preset rules in the medical record text processing system, the entity relationship diagram is constructed and processed, and the problems of complex rules and low accuracy in the existing technology are solved, and efficient and accurate entity relationship extraction is achieved.
Patent Information
- Application Number
- CN202410488597.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-04-23
AI Technical Summary
When extracting entity relationships from medical record texts, the rules are complex and difficult to adapt to the diverse types of medical record texts, resulting in low accuracy of entity relationships.
Using a system based on neural network model and preset rules, the computer program is executed through processor and memory, the entity list and label list in the medical record text is obtained, the intermediate entity relationship diagram is constructed, and the graph is processed based on the preset rules. Get the target entity relationship diagram.
It improves the accuracy of entities and entity relationships in medical record text, enhances the efficiency of obtaining entity relationships, and can more accurately identify and present entity relationships in medical record text.
Smart Images

Figure CN118315077B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text processing, and in particular to a system for obtaining an entity relationship diagram based on medical record text. Background Art
[0002] With the continuous development of Internet technology, medical record texts are becoming electronic. As important documents for judging diseases, treatment processes and detecting disease development status, medical record texts contain a large number of entities. There are related relationships between entities. These entity relationships are of great significance for understanding medical record content, assisting doctors in making decisions, and conducting disease-related data mining. How to clearly obtain the relationship between entities in medical record texts has become a hot research direction. In the prior art, entities are extracted from medical record texts based on rules. In the process of entity relationship extraction, rules are used to match preprocessed unstructured texts to extract entity relationship triplets. The above method for obtaining entity relationships has the following problems: the rule formulation is complex, which reduces the efficiency of obtaining medical record entity relationships. When the types of medical record texts are diversified, the entity relationships between entities in the medical record texts cannot be accurately identified, resulting in low accuracy of entity relationships in the obtained medical record texts. Summary of the invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is: a system for obtaining an entity relationship diagram based on medical record text, the system comprising: a processor and a memory storing a computer program, when the computer program is executed by the processor, the following steps are implemented:
[0004] S100, according to the target medical record text, obtaining a target entity list corresponding to the target medical record text and a target tag list corresponding to the target entity list.
[0005] S200, input the target entity list and the target label list into the preset neural network model, and obtain the intermediate entity relationship diagram corresponding to the target medical record text, wherein the intermediate entity relationship diagram is a tree structure diagram of the relationship between target entities and target entities constructed based on the target entity list, and the intermediate entity relationship diagram includes a target root node, a plurality of target child nodes, and a plurality of target edges, wherein the intermediate entity relationship diagram is obtained in S200 through the following steps:
[0006] S201, when a target entity in the target entity list does not depend on any target entity other than the target entity in the target entity list, the target child node corresponding to the target entity is connected to the target root node, and the connection direction between the target child node corresponding to the target entity and the target root node is that the target root node points to the target child node corresponding to the target entity.
[0007] S203: When a target entity in the target entity list depends on a target entity other than the target entity in the target entity list, a target sub-node corresponding to the target entity is connected with a target sub-node corresponding to the dependent target entity.
[0008] S205 , forming a target edge based on the connection between the target root node and the target child node and the connection between the target child node and the target child node, so as to obtain an intermediate entity relationship graph.
[0009] S300, processing the intermediate entity relationship graph based on a preset rule list to obtain a target entity relationship graph, wherein the preset rule list includes a plurality of preset rules, and the preset rules are rules set based on semantic information of the target entity and information included in a target tag corresponding to the target entity, and the target entity relationship graph is an intermediate entity relationship graph after determining the connection direction between the to-be-selected sub-node corresponding to the to-be-selected entity and the dependent to-be-selected entity in the intermediate entity relationship graph based on the preset rule list on the basis of the intermediate entity relationship graph.
[0010] Compared with the prior art, the present invention has obvious beneficial effects. By means of the above technical solution, the system for obtaining entity relationship diagram based on medical record text provided by the present invention can achieve considerable technical advancement and practicality, and has wide industrial utilization value, and has at least the following beneficial effects:
[0011] The present invention is a system for obtaining an entity relationship diagram based on a medical record text. The system includes: a processor and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented: according to a target medical record text, a target entity list corresponding to the target medical record text and a target label list corresponding to the target entity list are obtained, the target entity list and the target label list are input into a preset neural network model, an intermediate entity relationship diagram corresponding to the target medical record text is obtained, and the intermediate entity relationship diagram is processed based on a preset rule list to obtain the target entity relationship diagram. The present invention combines multiple models to obtain entities in the medical record text, continuously adjusts the parameters of each model based on sample data, improves the accuracy of obtaining entities in the medical record text, and thus makes the accuracy of obtaining entity relationships higher, combines the model with the rule, presents it in the form of a graph, improves the efficiency of obtaining entity relationships in the medical record text, first uses the model and then uses the rule set based on the semantic information of the entity in the medical record text to process the entity in the medical record text, so that the accuracy of the obtained medical record text entity relationship diagram is higher.
[0012] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following specifically cites a preferred embodiment and describes it in detail with the accompanying drawings as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 A flowchart implemented when a processor of a system for obtaining an entity relationship diagram based on medical record text executes a computer program provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0015] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0016] Example
[0017] This embodiment provides a system for obtaining an entity relationship diagram based on medical record text, the system comprising: a processor and a memory storing a computer program, when the computer program is executed by the processor, the following steps are implemented, such as: Figure 1 As shown:
[0018] S100, according to the target medical record text, obtaining a target entity list corresponding to the target medical record text and a target tag list corresponding to the target entity list.
[0019] Specifically, S100 also includes the following steps:
[0020] S101, obtain the initial feature vector list A corresponding to the target medical record text = {A1, ..., A i , ..., An}, A i =(A i1 , ..., A ij , ..., A im ), A i is the initial feature vector corresponding to the i-th character in the target medical record text, A ij A i The bit value of the jth bit in , j = 1...m, m is the dimension of the initial feature vector, i = 1...n, n is the number of characters in the target medical record text.
[0021] Specifically, the preset entity tag is a tag corresponding to a pre-set entity, wherein the tag corresponding to the entity is a tag corresponding to a word that characterizes the user's physical state. Those skilled in the art know that the preset entity tags can be set according to actual needs, which all fall within the protection scope of the present invention and will not be repeated here, for example: preset entity tags such as inspection methods and observation results.
[0022] Specifically, the initial feature vector is a feature vector generated by concatenating vectors generated based on content information and position information corresponding to text characters in the target medical record text. Those skilled in the art know that any method in the prior art for converting text into a vector based on content information and position information of the text falls within the scope of protection of the present invention and will not be described in detail herein.
[0023] Furthermore, m=m1+m2, wherein m1 is the dimension of a vector generated based on content information corresponding to text characters in the target medical record text, and m2 is the dimension of a vector generated based on position information corresponding to text characters in the target medical record text.
[0024] Preferably, the value of m1 is 128.
[0025] Preferably, the value of m2 is 64.
[0026] Specifically, the target medical record text is the medical record text of the entity to be obtained and the label corresponding to the entity.
[0027] S102, input A into the preset CNN model, and obtain the intermediate feature vector list B corresponding to the target medical record text = {B1, ..., B i , ..., B n}, B i =(B i1 , ..., B ir , ..., B is ), B i is the intermediate feature vector corresponding to the i-th character in the target medical record text, B ir For B iThe bit value of the rth bit in , r = 1 ... s, s is the dimension of the intermediate feature vector, wherein s is obtained in S102 by the following steps:
[0028] S1021, obtaining a first target parameter η1 corresponding to a preset CNN model, wherein the first target parameter η1 is the number of types corresponding to convolution kernels in the preset CNN model.
[0029] Specifically, in S1021, η1 is obtained by the following steps:
[0030] S10211, obtaining a sample medical record text set, wherein the sample medical record text set includes a plurality of sample medical record texts, and the sample medical record texts are medical record texts used to mark entities.
[0031] S10212, obtaining a sample entity set according to the sample medical record text set, wherein the sample entity set includes a plurality of sample entities, and the sample entities are entities marked in the sample medical record text.
[0032] S10213, according to the sample entity set, obtain a first sample quantity list and a second sample quantity list corresponding to the sample entity type list F = {F1, ..., F t , ..., F f}, where F t is the second sample quantity corresponding to the t-th sample entity type, t=1…f, and f is the number of second sample quantities in the second sample quantity list.
[0033] Specifically, the sample entity type list includes several sample entity types, wherein the sample entity type is an entity type classified based on the number of text characters corresponding to the sample entity, which can be understood as: sample entities with 2 text characters are classified into one category, such as skin, chest tube, number, etc.
[0034] Specifically, the first sample quantity list includes a plurality of first sample quantities, wherein the first sample quantity is the number of text characters corresponding to the sample entity.
[0035] Specifically, the second sample quantity is the quantity of sample entities corresponding to each sample entity type in the sample entity set.
[0036] S10214, according to F, obtain the target entity type list E = {E1, ..., E v ,……,E b} and E corresponding to the third sample quantity list E 0 ={E 0 1, ..., E 0 v ,……,E 0b}, E v is the vth target entity type, E 0 v For E v The corresponding third sample quantity, v=1...b, b is the number of target entity types, where is the maximum integer not exceeding (α×f), where α is a preset percentage.
[0037] Specifically, the target entity type is the sample entity type obtained from the sample entity type list and corresponding to the first α second sample quantities after sorting the second sample quantities in F in descending order.
[0038] Furthermore, the third sample quantity is the first sample quantity corresponding to the target entity type obtained from the first sample quantity list.
[0039] Specifically, the value range of α is 80% to 90%. Those skilled in the art know that α can be selected according to actual needs, which falls within the protection scope of the present invention and will not be described in detail here.
[0040] S10215, according to E 0 , get the fourth sample quantity list E 1 ={E 1 1, ..., E 1 u ,……,E 1 w}, E 1 u is the uth fourth sample quantity, u=1...w, w=b, wherein the fourth sample quantity is the 0 The third sample number in is the third sample number after re-sorting in ascending order.
[0041] S10216, when E 1 There is E 1 u -E 1 u-1 ≠1, then α=α-α0, and S10214 to S10215 are repeatedly executed until the preset loop termination condition is met, wherein the preset loop termination condition is: E 1 u -E 1 u-1 =1, α0 is the preset parameter threshold, E 1 u-1 is the (u-1)th fourth sample quantity.
[0042] Specifically, the value range of α0 is 0.1 to 0.5, wherein those skilled in the art know that α0 can be selected according to actual needs, all of which fall within the protection scope of the present invention and will not be described in detail here.
[0043] S10217, when E 1 u -E 1 u-1 When η1=1, η1=b is obtained.
[0044] As described above, based on the relevant sample data involved in the sample entities in the sample medical record text set, the parameters of the preset CNN model are continuously adjusted to obtain the feature vector of the corresponding dimension of the target medical record text, and the type of convolution kernel in the preset CNN model is determined based on the number of text characters corresponding to the entities in the sample medical record text to ensure that the size corresponding to the convolution kernel is consistent, thereby improving the accuracy of obtaining entities and entity labels in the medical record text.
[0045] S1023, according to η1, obtain a second target parameter η2 corresponding to the preset CNN model, wherein the second target parameter η2 meets the following conditions:
[0046] m / η1<η2≤(m×μ) / η1 and η2=a×M, where μ is a preset parameter, a is the number of attention heads in the preset Transformer, and M is any positive integer.
[0047] Specifically, the second target parameter η2 is the number of convolution kernels of each type in the preset CNN model.
[0048] Specifically, the value range of μ is 5 to 10, wherein those skilled in the art know that μ can be selected according to actual needs, all of which fall within the protection scope of the present invention and will not be described in detail here.
[0049] As mentioned above, the second target parameter corresponding to the preset CNN model is set within the corresponding range to avoid the situation where the dimension of the feature vector corresponding to the target medical record text output by the model is small due to the parameter being too small, resulting in the inability to obtain comprehensive information, making it difficult to find a good solution during the training process, and making it difficult for the model to converge. At the same time, it is avoided that the dimension of the feature vector corresponding to the target medical record text output by the model is large due to the model parameters being too large, resulting in reduced model operation efficiency, so that the accuracy of the entities and entity labels in the medical record text is higher.
[0050] S1025, obtaining the dimension s of the intermediate feature vector according to η1 and η2, wherein the dimension s of the intermediate feature vector meets the following conditions:
[0051] s=2×η1×η2.
[0052] S103, input B into the preset Transformer model, and obtain the target feature vector list C corresponding to the target medical record text = {C1, ..., C i , ..., C n}, C i =(C i1 , ..., C ih , ..., C ig ), C i is the target feature vector corresponding to the i-th character in the target medical record text, C ih C i The bit value of the hth bit in , h = 1...g, g is the dimension of the target feature vector, where g meets the following conditions:
[0053] g=(N+1)×4, where N is the number of preset entity tags.
[0054] S104, according to C, obtain a target entity list corresponding to the target medical record text and a target label list corresponding to the target entity list, wherein the target entity list includes a plurality of target entities, the target entities are entities in the target medical record text identified by combining a preset CNN model and a preset Transformer model, and the target label list includes a plurality of target labels, the target labels are preset entity labels to which the target entities are classified.
[0055] Specifically, those skilled in the art know that any method in the prior art that combines the CNN model and the Transformer model to obtain entities in the text and the corresponding labels of the entities falls within the protection scope of the present invention and will not be described in detail here.
[0056] S200, input the target entity list and the target label list into the preset neural network model, and obtain the intermediate entity relationship diagram corresponding to the target medical record text, wherein the intermediate entity relationship diagram is a tree structure diagram of the relationship between target entities and target entities constructed based on the target entity list, and the intermediate entity relationship diagram includes a target root node, a plurality of target child nodes, and a plurality of target edges, wherein the intermediate entity relationship diagram is obtained in S200 through the following steps:
[0057] S201, when a target entity in the target entity list does not depend on any target entity other than the target entity in the target entity list, the target child node corresponding to the target entity is connected to the target root node, and the connection direction between the target child node corresponding to the target entity and the target root node is that the target root node points to the target child node corresponding to the target entity.
[0058] Specifically, the target root node is a node set by itself, wherein those skilled in the art know that any method of setting a symbol to represent a node in the prior art falls within the protection scope of the present invention and will not be described in detail herein. For example, -1 is used to represent the target root node.
[0059] Specifically, the target subnode includes a target entity and a target label corresponding to the target entity.
[0060] Specifically, the target edge represents a connection relationship between target entities.
[0061] S203: When a target entity in the target entity list depends on a target entity other than the target entity in the target entity list, a target sub-node corresponding to the target entity is connected with a target sub-node corresponding to the dependent target entity.
[0062] S205 , forming a target edge based on the connection between the target root node and the target child node and the connection between the target child node and the target child node, so as to obtain an intermediate entity relationship graph.
[0063] Specifically, in S200, the preset neural network model is obtained through the following steps:
[0064] S210, according to the key medical record text set, obtain the key entity list set U corresponding to the key medical record text set = {U1, ..., U d , ..., U z} and the key tag list set corresponding to the key entity list set, U d is the dth key entity list, d=1...z, and z is the number of key entity lists.
[0065] Specifically, the key medical record text set includes several key medical record texts, and the key medical record texts are medical record texts used to train the initial neural network model.
[0066] Specifically, the key tag list set includes several key tag lists.
[0067] Furthermore, each key medical record text corresponds to a key entity list, and each key entity list corresponds to a key tag list.
[0068] Further, the key entity list is obtained in the same manner as the target entity list, and the key tag list is obtained in the same manner as the target tag list.
[0069] S220, input U and the key tag list set into the first neural network model to obtain the key entity relationship graph corresponding to U.
[0070] Specifically, the key entity relationship diagram is a tree structure diagram of the relationship between key entities constructed based on the key entity list.
[0071] Furthermore, the method for acquiring the key entity relationship diagram is consistent with the method for acquiring the intermediate entity relationship diagram.
[0072] Specifically, those skilled in the art know that the neural network can be selected according to actual needs, which falls within the protection scope of the present invention and will not be described in detail here.
[0073] S230, according to the key relationship diagram, obtain a key parameter ζ corresponding to the first neural network model, where ζ meets the following conditions:
[0074] σ 0 d It is the number of two key entities in the key entity relationship graph corresponding to the d-th key medical record text and the number of two key entities in the real entity relationship graph corresponding to the d-th key medical record text that are consistent and the number of relationships between the two key entities in the real entity relationship graph corresponding to the d-th key medical record text.
[0075] S240, continuously adjust the key parameter ζ until ζ≤ζ 0 To obtain the preset neural network model, where ζ 0 is the preset key parameter threshold.
[0076] Specifically, 0 The value range of is 0.1 to 0.3, and those skilled in the art know that it can be adjusted according to actual needs. 0 The selection of all falls within the protection scope of the present invention and will not be repeated here.
[0077] S300, processing the intermediate entity relationship graph based on a preset rule list to obtain a target entity relationship graph, wherein the preset rule list includes a plurality of preset rules, and the preset rules are rules set based on semantic information of the target entity and information included in a target tag corresponding to the target entity, and the target entity relationship graph is an intermediate entity relationship graph after determining the connection direction between the to-be-selected sub-node corresponding to the to-be-selected entity and the dependent to-be-selected entity in the intermediate entity relationship graph based on the preset rule list on the basis of the intermediate entity relationship graph.
[0078] Specifically, for example: classify the target tags, different types of target tags have different priority orders, and the priority order is: attribute < auxiliary class < location class < detection content class < pathological manifestation class < treatment class < diagnosis class < examination method class. The lower priority depends on the higher priority, that is, when the priority corresponding to a target tag is lower than the priority corresponding to another target tag, then in the target entity relationship diagram, the target child node corresponding to this target tag points to the target child node corresponding to another target tag.
[0079] As described above, multiple models are combined to obtain entities in medical record texts, and the parameters of each model are continuously adjusted based on sample data, which improves the accuracy of obtaining entities in medical record texts, thereby making the accuracy of obtaining entity relationships higher. The model is combined with rules and presented in the form of a graph, which improves the efficiency of obtaining entity relationships in medical record texts. The entities in the medical record texts are processed by first using the model and then using rules set based on feature information such as semantic information of the entities in the medical record text, so that the accuracy of the obtained medical record text entity relationship graph is higher.
[0080] Specifically, after step S300, the following steps are also included:
[0081] S400: According to the target entity list, a target entity relationship list corresponding to the target entity list is obtained.
[0082] Specifically, the system also includes β preset entity relationship tags, wherein the preset entity relationship tags are pre-set tags for the relationship between entities, wherein the tags for the relationship between entities are tags for the correspondence between words that characterize the user's physical state. Those skilled in the art know that the preset entity tags can be set according to actual needs, which all fall within the protection scope of the present invention and will not be repeated here, for example: entity relationship tags such as occurrence location and confirmed relationship.
[0083] In a specific embodiment, in S400, the second intermediate entity relationship list is obtained through the following steps:
[0084] S401, obtaining a first candidate label list set corresponding to the candidate medical record text set according to the candidate medical record text set, wherein the candidate medical record text set includes a plurality of candidate medical record texts.
[0085] Specifically, the candidate medical record text set includes a plurality of candidate medical record texts, wherein the candidate medical record texts are medical record texts including preset entity relationship labels between entities.
[0086] Specifically, the first candidate label list set includes several first candidate label lists, wherein each candidate medical record text corresponds to a first candidate label list, and the first candidate label list includes several first candidate labels, and the first candidate label is a preset entity relationship label corresponding to two entities that actually exist in each candidate medical record text.
[0087] S402, according to the candidate medical record text set, obtaining a candidate entity list set corresponding to the candidate medical record text set, wherein the candidate entity list set includes a plurality of candidate entity lists, and the candidate entity list includes a plurality of candidate entities.
[0088] Specifically, the method for obtaining the candidate entity is consistent with the method for obtaining the target entity.
[0089] S403, inputting the candidate entity list set into the initial neural network model to obtain a second candidate label list set, wherein the second candidate label list set includes a plurality of second candidate label lists, the second candidate label list includes a plurality of second candidate labels, and the second candidate labels are preset entity relationship labels corresponding to two candidate entities in each candidate entity list obtained based on the initial neural network model.
[0090] S404: Obtain target parameters θ corresponding to the initial neural network model according to the first candidate label list set and the second candidate label list set.
[0091] Specifically, in S404, θ is obtained by the following steps:
[0092] S4041, according to the first candidate label list set, obtain a first target quantity list Y corresponding to the preset entity relationship label list = {Y1, ..., Y α , ..., Y β},Y α is the first target number corresponding to the αth preset entity relationship tag, α=1...β, wherein the first target number is the number of each preset entity relationship tag included in the first candidate tag list set.
[0093] S4043, according to the second candidate label list set, obtain a second target quantity list R corresponding to the preset entity relationship label list = {R1, ..., R α , ..., R β},R α is the second target number corresponding to the αth preset entity relationship tag, wherein the second target number is the number of each preset entity relationship tag included in the second candidate tag list set.
[0094] S4045, according to the sample medical record text set, obtain a third target quantity list P corresponding to the preset entity relationship label list = {P1, ..., P α , ..., P β},P α is the third target number corresponding to the αth preset entity relationship label, wherein the third target number is the number of each preset entity relationship label included in the sample medical record text, the sample medical record text set includes several sample medical record texts, and the sample medical record text is the medical record text used to label entities.
[0095] S4047, obtain θ according to Y, R and P, where θ meets the following conditions:
[0096]
[0097] S405, continuously adjusting the target parameter θ until a preset target condition is met to obtain a target entity relationship model, wherein the preset target condition is: θ≤θ 0 ,θ 0 is the preset target parameter threshold.
[0098] Specifically, θ 0 The value range of θ is 0.1 to 0.3, wherein those skilled in the art know that θ can be adjusted according to actual needs. 0 The selection of all falls within the protection scope of the present invention and will not be repeated here.
[0099] Specifically, the window corresponding to the target entity relationship model is obtained based on the number of text characters corresponding to the intermediate entities in the obtained intermediate entity list.
[0100] S406, input the intermediate entity list into the target entity relationship model, and obtain a second intermediate entity relationship list corresponding to the intermediate medical record text, wherein the second intermediate entity relationship list includes a plurality of second intermediate entity relationships, and the second intermediate entity relationship includes a preset entity relationship label matched based on the target entity relationship model and two intermediate entities corresponding to the preset entity label matched.
[0101] In another specific embodiment, in S400, the second intermediate entity relationship list is obtained through the following steps:
[0102] S411, according to the candidate medical record text set, obtaining a candidate entity list set corresponding to the candidate medical record text set, wherein the candidate entity list set includes a plurality of candidate entity lists, and the candidate entity list includes a plurality of candidate entities.
[0103] Specifically, the method for acquiring the candidate entity is consistent with the method for acquiring the candidate entity in the above embodiment.
[0104] S412, input the candidate entity list set into the initial neural network model, obtain a second candidate label list set and a second candidate priority list G={G1, ..., G x , ..., G p}, G x is the second candidate priority corresponding to the x-th second candidate tag, x=1...p, and p is the number of second candidate priorities.
[0105] Specifically, the second candidate tag list set includes several second candidate tag lists, the second candidate tag list includes several second candidate tags, and the second candidate tags are preset entity relationship tags corresponding to two candidate entities in each candidate entity list obtained based on the initial neural network model.
[0106] Furthermore, the second candidate priority is a degree of matching between the relationship between the candidate entities and the candidate entities obtained based on the initial neural network model and a preset entity relationship label.
[0107] S413, when ε / p ≥ F 0 When , the first processing method is used to obtain the key parameter γ corresponding to the initial neural network model, where ε is the number of second candidate priorities in G that are not 1, and F 0 is the preset priority threshold.
[0108] Specifically, F 0 The value range of F is 0.5 to 0.7, wherein those skilled in the art know that F can be adjusted according to actual needs. 0 The selection of all falls within the protection scope of the present invention and will not be repeated here.
[0109] Specifically, in S413, γ is obtained by the following steps:
[0110] S4131, according to the candidate medical record text set, obtaining a first candidate label list set corresponding to the candidate medical record text set, wherein the candidate medical record text set includes a plurality of candidate medical record texts.
[0111] Specifically, the candidate medical record text set includes a plurality of candidate medical record texts, wherein the candidate medical record texts are medical record texts including preset entity relationship labels between entities.
[0112] Specifically, the first candidate label list set includes several first candidate label lists, wherein each candidate medical record text corresponds to a first candidate label list, and the first candidate label list includes several first candidate labels, and the first candidate label is a preset entity relationship label corresponding to two entities that actually exist in each candidate medical record text.
[0113] Specifically, the preset entity relationship label is a pre-set label for the relationship between entities, wherein the label for the relationship between entities is a label for the correspondence between words that characterize the user's physical state. Those skilled in the art know that the preset entity labels can be set according to actual needs, which all fall within the protection scope of the present invention and will not be repeated here, for example: entity relationship labels such as occurrence location and confirmed relationship.
[0114] S4132, input the candidate entity list set into the initial neural network model to obtain a second candidate label list set, wherein the second candidate label list set includes several second candidate label lists, the second candidate label list includes several second candidate labels, and the second candidate labels are preset entity relationship labels corresponding to two candidate entities in each candidate entity list obtained based on the initial neural network model.
[0115] Specifically, those skilled in the art know that any method in the prior art for obtaining labels by performing model training based on a neural network model falls within the protection scope of the present invention and will not be described in detail here, such as neural network models such as the PCNN model.
[0116] S4133: According to the first candidate label list set, obtain a first target quantity list Y corresponding to the preset entity relationship label list = {Y1, ..., Y α , ..., Y β},Y α is the first target number corresponding to the αth preset entity relationship tag, α=1...β, wherein the first target number is the number of each preset entity relationship tag included in the first candidate tag list set.
[0117] S4134: Obtain, according to the second candidate label list set, a second target quantity list R corresponding to the preset entity relationship label list = {R1, ..., R α , ..., R β},R α is the second target number corresponding to the αth preset entity relationship tag, wherein the second target number is the number of each preset entity relationship tag included in the second candidate tag list set.
[0118] S4135, obtain γ according to Y and R, where γ meets the following conditions:
[0119]
[0120] S414, when ε / p<F 0 When , the second processing method is used to obtain the key parameter γ corresponding to the initial neural network model.
[0121] Specifically, the method for obtaining γ in step S414 is consistent with the method for obtaining θ in the above embodiment.
[0122] S415, continuously adjusting the key parameter γ until a preset target condition is met to obtain a target entity relationship model, wherein the preset target condition is: γ≤γ 0 , γ 0 is the preset key parameter threshold.
[0123] S416, input the intermediate entity list into the target entity relationship model, and obtain the second intermediate entity relationship list corresponding to the intermediate medical record text, wherein the second intermediate entity relationship list includes a plurality of second intermediate entity relationships, and the second intermediate entity relationship includes a preset entity relationship label matched based on the target entity relationship model and two intermediate entities corresponding to the preset entity label matched.
[0124] As mentioned above, multiple models are combined to obtain entities in medical record texts, and the parameters of each model are continuously adjusted based on sample data, which improves the accuracy of obtaining entities in medical record texts, thereby making the accuracy of obtaining entity relationships higher. Based on the matching situation during model training, different methods are used to adjust the parameters of the model to improve the accuracy of obtaining entity relationships in medical record texts.
[0125] S500: Obtain a target event list corresponding to a target medical record text according to the first target entity relationship diagram and the target entity relationship list.
[0126] Specifically, the system also includes a plurality of first medical record text labels and a plurality of second medical record text labels.
[0127] Furthermore, the first medical record text label is the type of medical record text involved in the process node of treating the user when the user's body has abnormalities, for example: first medical record text labels such as physical signs, examinations, and medication.
[0128] Furthermore, the second medical record text label is a type of medical record text corresponding to a feature of the user that is different from the user and is unrelated to a process node involved in treating the user when the user has a physical abnormality, such as a second medical record text label such as smoking history, menstrual history, and allergy history.
[0129] Specifically, S500 also includes the following steps:
[0130] S501, obtaining a target medical record text label corresponding to the target medical record text, wherein the target medical record text label is a text type corresponding to the target medical record text obtained based on the content and structure corresponding to several titles in the target medical record text.
[0131] S502, when the target medical record text label is consistent with the first medical record text label, execute steps S100 to S400 to obtain a target triple list corresponding to the medical record text to be selected, wherein the target triple list includes several target triples, and the target triples include two connected candidate entities obtained from the first candidate entity relationship graph and the connection relationship corresponding to the two candidate entities and two candidate entities obtained from the second candidate entity relationship list and the entity relationship labels corresponding to the two candidate entities.
[0132] S503, based on the target triple list, obtaining a target event list corresponding to the medical record text to be selected, wherein the target event list includes a plurality of target events, and the target event is a target triple obtained from the target triple list.
[0133] S504, when obtaining a target triple list corresponding to the medical record text to be selected, wherein the target triple list includes several target triples, and the target triples include a trigger word corresponding to an event obtained from the medical record text to be selected based on an event extraction model and two arguments corresponding to the trigger word.
[0134] Specifically, those skilled in the art know that any method of extracting events from text using any event extraction model in the prior art falls within the protection scope of the present invention and will not be described in detail herein.
[0135] Specifically, the arguments are elements involved in the occurrence of an event, and are composed of entities in the medical record text to be selected.
[0136] As described above, based on the text type corresponding to the medical record text, different methods are used to obtain events in the medical record text, so that the accuracy of the events in the obtained medical record text is higher. At the same time, multiple models are combined to obtain entities in the medical record text, and the parameters of each model are continuously adjusted based on sample data, which improves the accuracy of obtaining entities in the medical record text, thereby making the accuracy of obtaining entity relationships higher. The trained model is used to obtain entity relationships in the medical record text. Based on the matching situation during the model training process, the parameters of the model are adjusted in different ways, which improves the accuracy of obtaining entity relationships in the medical record text, thereby improving the accuracy of obtaining events in the medical record text.
[0137] S600, obtaining an initial medical record text set, wherein the initial medical record text set includes a plurality of initial medical record texts, and the initial medical record texts are medical record texts obtained from a preset database.
[0138] Specifically, those skilled in the art know that the database for obtaining medical record texts can be selected according to actual needs, all of which fall within the protection scope of the present invention and will not be described in detail here.
[0139] S700, obtaining an intermediate medical record text set based on an initial medical record text set, wherein the intermediate medical record text set includes a plurality of intermediate medical record texts, and the intermediate medical record texts are initial medical record texts corresponding to each user obtained from the initial medical record text set.
[0140] Specifically, it can be understood that: the intermediate medical record text set is obtained by splitting the initial medical record text set into a multi-dimensional data set corresponding to a number of patients according to the user, ie, patient dimension.
[0141] Specifically, the data format corresponding to the intermediate medical record text is the JSON format. Those skilled in the art know that any method of converting text into the JSON data format in the prior art falls within the protection scope of the present invention and will not be described in detail here.
[0142] S800, obtaining an intermediate event knowledge graph corresponding to the intermediate medical record text set according to the intermediate medical record text set, wherein the intermediate event knowledge graph includes a plurality of intermediate triples.
[0143] Specifically, the method for acquiring the intermediate triplet is consistent with the method for acquiring the target triplet.
[0144] S900, obtaining a disease database according to a preset intermediate rule list and an intermediate event knowledge graph, wherein the disease database includes content data included in processing nodes involved in the disease.
[0145] Specifically, the preset intermediate rule list includes several preset intermediate rules, wherein the preset intermediate rules are rules for judging entities in the intermediate event knowledge graph based on the characteristics of the disease type.
[0146] As mentioned above, combining the NLP system with rules can more accurately understand and parse the data in the medical record text, improve the accuracy and efficiency of obtaining the disease database. The NLP system can provide understanding and analysis of medical record text data, and provide the rule engine with richer and more accurate information, so that the accuracy of obtaining the disease database is higher.
[0147] The present embodiment provides a system for obtaining an entity relationship diagram based on a medical record text, the system comprising: a processor and a memory storing a computer program, when the computer program is executed by the processor, the following steps are implemented: according to the target medical record text, a target entity list corresponding to the target medical record text and a target label list corresponding to the target entity list are obtained, the target entity list and the target label list are input into a preset neural network model, an intermediate entity relationship diagram corresponding to the target medical record text is obtained, the intermediate entity relationship diagram is processed based on a preset rule list, and the target entity relationship diagram is obtained. The present embodiment combines multiple models to obtain entities in the medical record text, continuously adjusts the parameters of each model based on sample data, improves the accuracy of obtaining entities in the medical record text, and thus makes the accuracy of obtaining entity relationships higher, combines the model with the rule, presents it in the form of a graph, improves the efficiency of obtaining entity relationships in the medical record text, first uses the model and then uses the rules set based on the semantic information of the entity in the medical record text to process the entities in the medical record text, so that the accuracy of the obtained medical record text entity relationship diagram is higher.
[0148] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A system for obtaining entity relationship diagrams based on medical record text, characterized in that: The system includes: a processor and a memory storing a computer program, which when executed by the processor, implements the following steps: S100, according to the target medical record text, obtain the target entity list corresponding to the target medical record text and the target label list corresponding to the target entity list. Among them, the following steps are also included in S100: S101, obtain the initial feature vector list A={A1, ..., A i , ..., A n }, A i =(A i1 , ..., A ij , ..., A im ), A i is the initial feature vector corresponding to the i-th character in the target medical record text, A ij A i The j-th bit value in , j = 1 ... m, m is the dimension of the initial feature vector, i = 1 ... n, n is the number of characters in the target medical record text; S102, input A into the preset CNN model, and obtain the intermediate feature vector list B={B1, ..., B i , ..., B n }, B i =(B i1 , ..., B ir , ..., B is ), B i is the intermediate feature vector corresponding to the i-th character in the target medical record text, B ir For B i The bit value of the rth bit in , r=1...s, s is the dimension of the intermediate feature vector, wherein s is obtained in S102 by the following steps: S1021, obtain the first target parameter η1 corresponding to the preset CNN model, where the first target parameter η1 is the type number of the convolutional kernels in the preset CNN model. η1 is obtained through the following steps in S1021: S10211, obtain the sample medical record text set, where the sample medical record text set includes a number of sample medical record texts, and the sample medical record text is a medical record text for entity annotation; S10212, according to the sample medical record text set, obtain the sample entity set, where the sample entity set includes a number of sample entities, and the sample entity is an entity annotated in the sample medical record text; S10213, according to the sample entity set, obtain a first sample quantity list and a second sample quantity list F={F1, ..., F t , ..., F f }, where F t is the second sample quantity corresponding to the t-th sample entity type, t=1…f, f is the number of second sample quantities in the second sample quantity list; S10214, according to F, obtain the target entity type list E = {E1, ..., E v ,……,E b } and E corresponding to the third sample quantity list E 0 ={E 0 1, ..., E 0 v ,……,E 0 b }, E v is the vth target entity type, E 0 v For E v The corresponding third sample quantity, v=1…b, b is the quantity of target entity types, wherein b=⌊α×f⌋, ⌊α×f⌋ is the maximum integer not exceeding (α×f), and α is a preset percentage; S10215, according to E 0 , get the fourth sample quantity list E 1 ={E 1 1, ..., E 1 u ,……,E 1 w }, E 1 u is the uth fourth sample quantity, u=1...w, w=b, wherein the fourth sample quantity is for E 0 The third sample number in is the third sample number after re-arranging in ascending order; S10216, when E 1 There is E 1 u -E 1 u-1 ≠1, then α=α-α0, and S10214 to S10215 are repeatedly executed until the preset loop termination condition is met, wherein the preset loop termination condition is: E 1 u -E 1 u-1 =1, α0 is the preset parameter threshold, E 1 u-1 is the number of the (u-1)th fourth sample; S10217, when E 1 u -E 1 u-1 =1, obtain η1=b; S1023, according to η1, obtain the second target parameter η2 corresponding to the preset CNN model, where the second target parameter η2 meets the following conditions: m / η1<η2≤(m×μ) / η1 and η2=a×M, where μ is a preset parameter, a is the number of attention heads in the preset Transformer, and M is any positive integer; S1025, according to η1 and η2, obtain the dimension s of the intermediate feature vector, where the dimension s of the intermediate feature vector meets the following conditions: s=2×η1×η2; S103, input B into the preset Transformer model, and obtain the target feature vector list C={C1, ..., C i , ..., C n }, C i =(C i1 , ..., C ih , ..., C ig ), C i is the target feature vector corresponding to the i-th character in the target medical record text, C ih C i The bit value of the hth bit in , h = 1...g, g is the dimension of the target feature vector, where g meets the following conditions: g=(N + 1)×4; S104, according to C, obtain the target entity list corresponding to the target medical record text and the target label list corresponding to the target entity list. Among them, the target entity list includes a number of target entities, and the target entity is an entity in the target medical record text identified by combining the preset CNN model and the preset Transformer model. The target label list includes a number of target labels, and the target label is a preset entity label classified by the target entity; S200, input the target entity list and the target label list into the preset neural network model to obtain the intermediate entity relationship graph corresponding to the target medical record text. The intermediate entity relationship graph is a tree structure graph of the relationship between target entities based on the target entity list. The intermediate entity relationship graph includes a target root node, a number of target child nodes, and a number of target edges. Among them, the intermediate entity relationship graph is obtained through the following steps in S200: S201, when the target entity in the target entity list does not depend on any target entity other than this target entity in the target entity list, connect the target child node corresponding to this target entity to the target root node, and the connection direction between the target child node corresponding to this target entity and the target root node is from the target root node to the target child node corresponding to this target entity; S203, when a target entity in the target entity list depends on a target entity other than the target entity in the target entity list, connecting a target sub-node corresponding to the target entity with a target sub-node corresponding to the dependent target entity; S205, forming a target edge based on the connection between the target root node and the target child node and the connection between the target child node and the target child node, so as to obtain an intermediate entity relationship graph; S300, processing the intermediate entity relationship graph based on a preset rule list to obtain a target entity relationship graph, wherein the preset rule list includes a plurality of preset rules, and the preset rules are rules set based on semantic information of the target entity and information included in a target tag corresponding to the target entity, and the target entity relationship graph is an intermediate entity relationship graph after determining the connection direction between the to-be-selected sub-node corresponding to the to-be-selected entity and the dependent to-be-selected entity in the intermediate entity relationship graph based on the preset rule list on the basis of the intermediate entity relationship graph.
2. The system for obtaining entity relationship diagram based on medical record text according to claim 1, characterized in that: The target sub-node includes a target entity and a target tag corresponding to the target entity.
3. The system for obtaining entity relationship diagram based on medical record text according to claim 1, characterized in that: The target edge represents the connection relationship between target entities.
4. The system for obtaining entity relationship diagram based on medical record text according to claim 1, characterized in that: In S200, the preset neural network model is obtained through the following steps: S210, according to the key medical record text set, obtain the key entity list set U={U1, ..., U d , ..., U z } and the key tag list set corresponding to the key entity list set, U d is the dth key entity list, d=1…z, z is the number of key entity lists; S220, inputting U and the key tag list set into the first neural network model to obtain a key entity relationship graph corresponding to U; S230, according to the key relationship diagram, obtain a key parameter ζ corresponding to the first neural network model, where ζ meets the following conditions: , σ 0 d is the number of two key entities that are consistent with the real entity relationship graph corresponding to the d-th key medical record text and the number of relationships between the two key entities in the real entity relationship graph corresponding to the d-th key medical record text, and the number of relationships between the two key entities in the real entity relationship graph corresponding to the d-th key medical record text; S240, continuously adjust the key parameter ζ until ζ≤ζ 0 To obtain the preset neural network model, where ζ 0 is the preset key parameter threshold.
Citation Information
Patent Citations
Medical entity relationship identification method and device and storage medium
CN114912456A
System for acquiring entity and entity label corresponding to medical record text
CN118093736A
Method and apparatus for processing electronic medical record data, device and medium
US20210375479A1