A system for acquiring target entity relationship model based on medical record text
By using the neural network model in the medical record text processing system, the parameters are automatically adjusted to obtain the target entity relationship model, which solves the problems of complex rule formulation and low accuracy in the existing technology, and achieves efficient and accurate entity relationship extraction.
Patent Information
- Application Number
- CN202410488596.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2025-01-21
- 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.
A system based on the neural network model is used to obtain the candidate entity and label list from the candidate medical record text by presetting the entity relationship tags, processor and memory, and adjust the model parameters until the preset conditions are met to obtain the target entity relationship model .
It improves the accuracy of entities and entity relationships in medical record text, simplifies the rule formulation process, adapts to diverse medical record text types, and improves the efficiency of entity relationship matching.
Smart Images

Figure CN118197645B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text processing, and in particular to a system for acquiring a target entity relationship model 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 a target entity relationship model based on medical record text, the system comprising: β preset entity relationship tags, 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, 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.
[0005] S200, obtaining a candidate entity list set corresponding to the candidate medical record text set according 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.
[0006] S300, 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.
[0007] S400, obtaining a target parameter θ corresponding to the initial neural network model according to the first candidate label list set and the second candidate label list set.
[0008] S500, 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.
[0009] Compared with the prior art, the present invention has obvious beneficial effects. By means of the above technical solution, the system for obtaining a target entity relationship model 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:
[0010] The present invention is a system for acquiring a target entity relationship model based on medical record text. The system includes: β preset entity relationship tags, 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 candidate medical record text set, a first candidate tag list set corresponding to the candidate medical record text set is acquired; according to the candidate medical record text set, a candidate entity list set corresponding to the candidate medical record text set is acquired; the candidate entity list set is input into an initial neural network model to acquire a second candidate tag list set; according to the first candidate tag list set and the second candidate tag list set, target parameters corresponding to the initial neural network model are acquired; the target parameters are continuously adjusted until the preset target conditions are met to acquire the target entity relationship model. The present invention combines multiple models to acquire entities in the medical record text, continuously adjusts the parameters of each model based on sample data, improves the accuracy of acquiring entities in the medical record text, and thereby makes the accuracy of acquiring entity relationships higher; the model is used to match entity relationships, and the parameters of the model are continuously adjusted, so that the accuracy of the model in identifying entity relationships is higher.
[0011] 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
[0012] Figure 1 A flowchart implemented when a processor of a system for acquiring a target entity relationship model based on medical record text executes a computer program provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0013] 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.
[0014] 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.
[0015] Embodiment 1
[0016] This embodiment provides a system for acquiring a target entity relationship model based on medical record text, characterized in that the system includes: β preset entity relationship tags, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented: Figure 1 As shown:
[0017] S100, 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.
[0018] 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.
[0019] 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.
[0020] 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.
[0021] S200, obtaining a candidate entity list set corresponding to the candidate medical record text set according 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.
[0022] Specifically, in S200, the candidate entity is obtained through the following steps:
[0023] S201, obtain the initial feature vector list A corresponding to the candidate medical record text = {A 1 , ..., 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 candidate 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 text characters in the candidate medical record text.
[0024] 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 candidate 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 repeated here.
[0025] Furthermore, m=m 1 +m 2 , where m 1 is the dimension of the vector generated based on the content information corresponding to the text characters in the candidate medical record text, m 2 The dimension of the vector generated based on the position information corresponding to the text characters in the candidate medical record text.
[0026] Preferably, m 1 The value of is 128.
[0027] Preferably, m 2 The value of is 64.
[0028] Specifically, the candidate medical record text is the medical record text of the entity to be obtained and the label corresponding to the entity.
[0029] S202, input A into the preset CNN model, and obtain the intermediate feature vector list B corresponding to the candidate medical record text = {B 1 , ..., 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 candidate 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 by the following steps in S202:
[0030] S2021, obtaining the first candidate parameter η corresponding to the preset CNN model 1 , wherein the first candidate parameter η 1 The number of types corresponding to the convolution kernels in the preset CNN model.
[0031] Specifically, in S2021, η is obtained by the following steps: 1 :
[0032] S20211, 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.
[0033] S20212, 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.
[0034] S20213, 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={F 1 , ..., 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.
[0035] 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.
[0036] 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.
[0037] Specifically, the second sample quantity is the quantity of sample entities corresponding to each sample entity type in the sample entity set.
[0038] S20214, according to F, obtain a candidate entity type list E = {E 1 ,……,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 candidate entity type, E 0 v For E v The corresponding third sample quantity, v=1...b, b is the number of candidate entity types, where is the maximum integer not exceeding (α×f), where α is a preset percentage.
[0039] Specifically, the candidate 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.
[0040] Furthermore, the third sample quantity is the first sample quantity corresponding to the candidate entity type obtained from the first sample quantity list.
[0041] 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.
[0042] S20215, according to E 0 , get the fourth sample quantity list E 1 ={E 1 1 ,……,E 1 u ,……,E1 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.
[0043] S20216, when E 1 There is E 1 u -E 1 u-1 ≠1, then α=α-α 0 , S10214 to S10215 are repeatedly executed until a 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.
[0044] Specifically, α 0 The value range of α is 0.1 to 0.5, 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.
[0045] S20217, when E 1 u -E 1 u-1 =1, get η 1 =b.
[0046] 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 vectors of the corresponding dimensions of the candidate medical record texts, 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 texts 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 texts.
[0047] S2023, according to η 1 , obtain the second candidate parameter η corresponding to the preset CNN model 2 , where the second candidate parameter η 2 Meet the following conditions:
[0048] 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.
[0049] Specifically, the second candidate parameter n 2 The number of convolution kernels of each type in the preset CNN model.
[0050] 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.
[0051] As mentioned above, the second candidate parameters corresponding to the preset CNN model are set within the corresponding range to avoid the situation where the dimension of the feature vector corresponding to the candidate 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, avoid the situation where the dimension of the feature vector corresponding to the candidate 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.
[0052] S2025, according to η 1 and η 2 , get the dimension s of the intermediate feature vector, where the dimension s of the intermediate feature vector meets the following conditions:
[0053] s=2×η 1 ×η 2 .
[0054] S203, input B into the preset Transformer model, and obtain the target feature vector list C corresponding to the candidate medical record text = {C 1 , ..., 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 candidate 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:
[0055] g=(N+1)×4, where N is the number of preset entity tags.
[0056] 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.
[0057] S204, according to C, obtain a candidate entity list corresponding to the candidate medical record text, wherein the candidate entity list includes a plurality of candidate entities, and the candidate entities are entities in the candidate medical record text identified by combining a preset CNN model and a preset Transformer model.
[0058] 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.
[0059] S300, 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.
[0060] 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.
[0061] S400, obtaining a target parameter θ corresponding to the initial neural network model according to the first candidate label list set and the second candidate label list set.
[0062] Specifically, in S400, θ is obtained through the following steps:
[0063] S401, according to the first candidate label list set, obtain a first target quantity list Y corresponding to the preset entity relationship label list = {Y 1 , ..., 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.
[0064] S403, according to the second candidate label list set, obtain a second target quantity list R corresponding to the preset entity relationship label list = {R 1 , ..., 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.
[0065] S405: Obtain a third target quantity list P corresponding to the preset entity relationship label list according to the sample medical record text set. 1 , ..., 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.
[0066] S407, obtaining θ according to Y, R and P, where θ meets the following conditions:
[0067]
[0068] S500, 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.
[0069] 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.
[0070] 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 used to match entity relationships, and the parameters of the model are continuously adjusted, so that the model can identify entity relationships with higher accuracy.
[0071] Specifically, after step S500, the following steps are also included:
[0072] S600, obtaining a specified medical record text, wherein the specified medical record text is a medical record text of a relationship between entities to be obtained.
[0073] S700, according to the specified medical record text, obtain a specified entity list corresponding to the specified medical record text and a specified label list corresponding to the specified entity list, wherein the specified entity list includes a plurality of specified entities, and the method for obtaining the specified entities is consistent with the method for obtaining the candidate entities, and the specified label list includes a plurality of specified labels, and the method for obtaining the specified labels is consistent with the method for obtaining the candidate labels.
[0074] S800, input the specified entity list into the target entity relationship model, and obtain the target entity relationship list corresponding to the specified medical record text, wherein the target entity relationship list includes a plurality of target entity relationships, and the target entity relationship includes a preset entity relationship label matched based on the target entity relationship model and two specified entities corresponding to the preset entity label.
[0075] S900, obtaining a target entity relationship graph corresponding to the specified entity list according to the specified entity list and the specified tag list.
[0076] Specifically, in S900, the target entity relationship diagram is obtained through the following steps:
[0077] S901, input the specified entity list and the specified label list into the preset neural network model, and obtain the intermediate entity relationship diagram corresponding to the specified medical record text, wherein the intermediate entity relationship diagram is a tree structure diagram of the relationship between the specified entities and the specified entities constructed based on the specified entity list, and the intermediate entity relationship diagram includes a specified root node, a plurality of specified child nodes, and a plurality of specified edges, wherein the intermediate entity relationship diagram is obtained in S901 through the following steps:
[0078] S9011, when a specified entity in the specified entity list does not depend on any specified entity in the specified entity list except the specified entity, the specified child node corresponding to the specified entity is connected to the specified root node, and the connection direction between the specified child node corresponding to the specified entity and the specified root node is that the specified root node points to the specified child node corresponding to the specified entity.
[0079] Specifically, the designated root node is a node set by oneself, 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 designated root node.
[0080] Specifically, the designated sub-node includes a designated entity and a designated label corresponding to the designated entity.
[0081] Specifically, the designated edge represents a connection relationship between designated entities.
[0082] S9013: When a designated entity in the designated entity list depends on a designated entity other than the designated entity in the designated entity list, connect the designated child node corresponding to the designated entity with the designated child node corresponding to the dependent designated entity.
[0083] S9015, connecting the designated root node with the designated child node and connecting the designated child node with the designated child node to form a designated edge, so as to obtain an intermediate entity relationship graph.
[0084] Specifically, in S901, the preset neural network model is obtained through the following steps:
[0085] S910, according to the key medical record text set, obtain the key entity list set U corresponding to the key medical record text set = {U 1 , ..., 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.
[0086] 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.
[0087] Specifically, the key tag list set includes several key tag lists.
[0088] Furthermore, each key medical record text corresponds to a key entity list, and each key entity list corresponds to a key tag list.
[0089] Furthermore, the method for acquiring the key entity list is consistent with the method for acquiring the specified entity list, and the method for acquiring the key tag list is consistent with the method for acquiring the specified tag list.
[0090] S920, input U and the key tag list set into the first neural network model to obtain the key entity relationship graph corresponding to U.
[0091] Specifically, the key entity relationship diagram is a tree structure diagram of the relationship between key entities constructed based on the key entity list.
[0092] Furthermore, the method for acquiring the key entity relationship diagram is consistent with the method for acquiring the intermediate entity relationship diagram.
[0093] 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.
[0094] S930, according to the key relationship diagram, obtain a key parameter ζ corresponding to the first neural network model, where ζ meets the following conditions:
[0095] σ 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.
[0096] S940, continuously adjust the key parameter ζ until ζ≤ζ 0 To obtain the preset neural network model, where ζ 0 is the preset key parameter threshold.
[0097] 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.
[0098] S902, processing the intermediate entity relationship graph based on the preset rule list to obtain the target entity relationship graph, wherein the preset rule list includes a plurality of preset rules, the preset rules are rules set based on the semantic information of the specified entity and the information included in the specified tag corresponding to the specified entity, and the target entity relationship graph is the intermediate entity relationship graph after the connection direction between the candidate sub-node corresponding to the candidate entity in the intermediate entity relationship graph and the dependent candidate entity is determined based on the preset rule list on the basis of the intermediate entity relationship graph. .
[0099] Specifically, for example: classify the specified tags, different types of specified 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 specified tag is lower than the priority corresponding to another specified tag, then in the specified entity relationship diagram, the specified child node corresponding to this specified tag points to the specified child node corresponding to another specified tag.
[0100] 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.
[0101] S1000, obtaining a specified event list corresponding to a specified medical record text according to a target entity relationship list and a target entity relationship diagram.
[0102] Specifically, the system also includes a plurality of first medical record text labels and a plurality of second medical record text labels.
[0103] 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.
[0104] 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.
[0105] Specifically, S1000 also includes the following steps:
[0106] S1001, obtaining a designated medical record text label corresponding to a designated medical record text, wherein the designated medical record text label is a text type corresponding to the designated medical record text obtained based on the content and structure corresponding to a plurality of titles in the designated medical record text.
[0107] S1002, when the designated medical record text label is consistent with the first medical record text label, execute steps S100 to S900 to obtain a designated triple list corresponding to the medical record text to be selected, wherein the designated triple list includes a number of designated triples, and the designated 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.
[0108] S1003, based on the specified triple list, obtaining a specified event list corresponding to the medical record text to be selected, wherein the specified event list includes a plurality of specified events, and the specified event is a specified triple obtained from the specified triple list.
[0109] S1004, when obtaining a specified triple list corresponding to the medical record text to be selected, wherein the specified triple list includes several specified triples, and the specified 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] S1100, 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.
[0114] 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.
[0115] S1200, 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.
[0116] 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.
[0117] 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.
[0118] S1300, 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.
[0119] Specifically, the method for obtaining the intermediate triplet is consistent with the method for obtaining the specified triplet.
[0120] S1400, 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.
[0121] 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.
[0122] 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.
[0123] The present embodiment is a system for acquiring a target entity relationship model based on medical record text, the system comprising: β preset entity relationship tags, 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 candidate medical record text set, a first candidate tag list set corresponding to the candidate medical record text set is acquired; according to the candidate medical record text set, a candidate entity list set corresponding to the candidate medical record text set is acquired; the candidate entity list set is input into an initial neural network model to acquire a second candidate tag list set; according to the first candidate tag list set and the second candidate tag list set, target parameters corresponding to the initial neural network model are acquired; the target parameters are continuously adjusted until the preset target conditions are met to acquire the target entity relationship model. The present embodiment combines multiple models to acquire entities in the medical record text, continuously adjusts the parameters of each model based on sample data, improves the accuracy of acquiring entities in the medical record text, and thereby makes the accuracy of acquiring entity relationships higher; the model is used to match entity relationships, and the parameters of the model are continuously adjusted, so that the accuracy of the model in identifying entity relationships is higher.
[0124] Embodiment 2
[0125] This embodiment provides a system for acquiring a target entity relationship model based on medical record text, characterized in that the system includes: β preset entity relationship tags, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented:
[0126] S100, obtaining a candidate entity list set corresponding to the candidate medical record text set according 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.
[0127] Specifically, the method for acquiring the candidate entity is consistent with the method for acquiring the candidate entity in the above embodiment.
[0128] S200, 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={G 1 , ..., 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.
[0129] 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.
[0130] 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.
[0131] S300, 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.
[0132] 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.
[0133] Specifically, in S300, γ is obtained through the following steps:
[0134] S301, 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.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] S302, 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.
[0139] 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.
[0140] S303, according to the first candidate label list set, obtain a first target quantity list Y corresponding to the preset entity relationship label list = {Y 1 , ..., 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.
[0141] S304: Obtain a second target quantity list R corresponding to the preset entity relationship label list according to the second candidate label list set. 1 , ..., 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.
[0142] S305, obtaining γ according to Y and R, where γ meets the following conditions:
[0143]
[0144] S400, when ε / p<F 0 When , the second processing method is used to obtain the key parameter γ corresponding to the initial neural network model.
[0145] Specifically, the method for obtaining γ in step S400 is consistent with the method for obtaining θ in the above embodiment.
[0146] S500, 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.
[0147] 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.
[0148] The present embodiment provides a data processing system for obtaining entity relationships in medical record texts. The system includes: preset entity relationship labels, candidate medical record text sets, 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 candidate medical record text set, a candidate entity list set corresponding to the candidate medical record text set is obtained, the candidate entity list set is input into the initial neural network model, a second candidate label list set and a second candidate priority list are obtained, when the parameters corresponding to the second candidate priority meet the preset conditions, a first processing method is used to obtain the key parameters corresponding to the initial neural network model, when the parameters corresponding to the second candidate priority do not meet the preset conditions, a second processing method is used to obtain the key parameters corresponding to the initial neural network model, and the key parameters γ are continuously adjusted until the preset target conditions are met to obtain the target entity relationship model. The present embodiment combines multiple models to obtain entities in medical record texts, and continuously adjusts the parameters of each model based on sample data, thereby improving the accuracy of obtaining entities in medical record texts, thereby making the accuracy of obtaining entity relationships higher, using trained models to obtain entity relationships in medical record texts, and adjusting the parameters of the model in different ways based on the matching conditions in the model training process, thereby improving the accuracy of obtaining entity relationships in medical record texts.
[0149] 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 acquiring a target entity relationship model based on medical record text, characterized in that: The system includes: β preset entity relationship tags, a processor, and a memory storing a computer program. When the computer program is executed by the processor, the following steps are implemented: S100, 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; S200, 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. In S200, the candidate entities are obtained by the following steps: S201, obtain the initial feature vector list A corresponding to the candidate medical record text = {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 candidate 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 candidate medical record text; S202, input A into the preset CNN model, and obtain the intermediate feature vector list B corresponding to the candidate 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 candidate 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 by the following steps in S202: S2021, obtaining a first candidate parameter η1 corresponding to a preset CNN model, wherein the first candidate parameter η1 is the number of types corresponding to the convolution kernel in the preset CNN model; S2023, according to η1, obtain a second candidate parameter η2 corresponding to the preset CNN model, wherein the second candidate 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; S2025, 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: s = 2 × η1 × η2; S203, input B into the preset Transformer model, and obtain the target feature vector list C corresponding to the candidate 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 candidate 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, N is the number of preset entity tags; S204, according to C, obtaining a candidate entity list corresponding to the candidate medical record text, wherein the candidate entity list includes a plurality of candidate entities, and the candidate entities are entities in the candidate medical record text identified by combining a preset CNN model and a preset Transformer model; S300, 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; S400, obtaining a target parameter θ corresponding to an initial neural network model according to the first candidate label list set and the second candidate label list set; S500, 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.
2. The system for acquiring target entity relationship model based on medical record text according to claim 1, characterized in that: The preset entity relationship label is a label of a preset relationship between entities, wherein the label of the relationship between entities is a label of a corresponding relationship between words that represent a user's physical state.
3. The system for acquiring target entity relationship model based on medical record text according to claim 1, characterized in that: The value range of μ is 5 to 10.
4. The system for acquiring target entity relationship model based on medical record text according to claim 1, characterized in that: The second candidate parameter η2 is the number of convolution kernels of each type in the preset CNN model.
5. The system for acquiring target entity relationship model based on medical record text according to claim 1, characterized in that: The preset entity tag is an entity tag set based on the content included in the medical record text.
6. The system for acquiring target entity relationship model based on medical record text according to claim 1, characterized in that: In S400, θ is obtained by the following steps: S401, 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; S403, 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 label, where The second target quantity is the quantity of each preset entity relationship label included in the second candidate label list set; S405: 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, where The third target quantity is the quantity of each preset entity relationship label included in the sample medical record text, 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; S407, obtaining θ according to Y, R and P, where θ meets the following conditions:
Citation Information
Patent Citations
Medical entity relationship identification method and device and storage medium
CN114912456A