Text entity relationship analysis method and device, electronic equipment and readable storage medium
By acquiring and concatenating entity vectors, attribute vectors, and location vectors from electronic medical records, and performing pooling and classification, the problem of high entity density and complex logical relationships in electronic medical records is solved, enabling accurate analysis of entity logical relationships while saving computing resources.
Patent Information
- Application Number
- CN202111545588.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-16
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2041-12-16
AI Technical Summary
Electronic medical records have a high density of entities and complex logical relationships, requiring significant computing resources for analysis.
By obtaining the entity vector, attribute vector, and position vector corresponding to the characters in the text, vector concatenation and pooling calculations are performed. The concatenated and pooled vectors of any two entities are used as entity pair vectors, and the entity pair vectors are classified to determine the entity relationships.
While conserving computing resources, accurately extract entities from text and analyze their logical relationships.
Smart Images

Figure CN114706939B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and specifically to a text entity relationship analysis method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] In the process of analyzing text using text recognition methods, it is necessary to analyze the logical relationships between entities within the text. For example, electronic medical records (EMRs) are crucial documents for doctors to diagnose and treat patients. In typical AI (Artificial Intelligence) + healthcare tasks, EMRs are the most important information input. To effectively utilize EMR information, structured parsing of the EMR is required. EMRs have a high entity density and complex logical relationships. A typical EMR typically includes the following: symptoms, diagnosis, treatment medications, surgery, laboratory tests, physical examination, medical imaging examinations, as well as lesion size, morphology, onset time, triggering factors, and examination results. The analysis of these logical relationships is extremely complex and requires substantial computational resources. Summary of the Invention
[0003] To address the problems in related technologies, embodiments of this disclosure provide a text entity relationship analysis method, apparatus, electronic device, and readable storage medium.
[0004] Firstly, this disclosure provides a method for analyzing text entity relationships.
[0005] Specifically, the text entity relation analysis method includes: a vector acquisition step, which acquires a vector combination including entity vectors corresponding to characters in the text, wherein the entity represented by the entity vector includes at least one character;
[0006] The vector concatenation step involves concatenating the vectors in the vector combination with the characters in the text to obtain a character concatenation vector.
[0007] The pooling step involves performing pooling calculations on the character concatenation vector to obtain the entity-pooled vector.
[0008] The entity relationship determination step involves concatenating any two entity pooled vectors as entity pair vectors, and classifying the entity pair vectors to determine the entity relationship.
[0009] In conjunction with the first aspect, in the first implementation of the first aspect,
[0010] The vector combination includes entity vectors, attribute vectors, character vectors, and position vectors.
[0011] In conjunction with the first implementation of the first aspect, this disclosure provides a second implementation of the first aspect.
[0012] The vector acquisition steps include:
[0013] Obtain the character vectors corresponding to the characters in the text;
[0014] Obtain the position vector of the character in the text.
[0015] Based on the named entity recognition model, the entity vectors and attribute vectors of the characters in the text are obtained.
[0016] In conjunction with any of the first to second implementations of the first aspect, this disclosure, in the third implementation of the first aspect,
[0017] The pooling step includes: using the average pooling method to perform pooling calculations on the character concatenation vector of the characters in the entity, to obtain the entity pooled vector.
[0018] In combination with any of the first to second implementations of the first aspect, this disclosure, in the fourth implementation of the first aspect,
[0019] The steps for determining entity relationships include:
[0020] Concatenate any two entity pooling vectors that conform to the entity extraction rules to form an entity pair vector;
[0021] The entity pair vectors are classified to obtain the classification probability;
[0022] The entity relationships between the entities represented by the entity pair vectors are determined based on the classification probabilities.
[0023] In conjunction with the fourth implementation of the first aspect, this disclosure provides a fifth implementation of the first aspect.
[0024] The concatenation of any two entity pooled vectors that conform to the entity extraction rules as entity pair vectors includes:
[0025] Among all entity pooled vectors, any two entity pooled vectors with a preset logical relationship and a preset probability are selected and concatenated to construct entity pair vectors.
[0026] In conjunction with the fourth implementation of the first aspect, in the sixth implementation of the first aspect of this disclosure, determining the entity relationship between the entities represented by the entity pair vector based on the classification probability includes:
[0027] Based on the comparison result between the classification probability and a specific classification probability threshold, the logical relationship between the two entity pooled vectors in the entity pair vector is determined, and then the entity relationship between the entities represented by the two entity pooled vectors is determined.
[0028] In conjunction with the first implementation of the first aspect, this disclosure provides a seventh implementation of the first aspect.
[0029] The text includes medical record text; the entity vector includes at least one of the following: treatment method and disease; the attribute vector includes at least one of the following: location, type, time and place.
[0030] Secondly, this disclosure provides a text entity relationship analysis device.
[0031] Specifically, the text entity relationship analysis device includes:
[0032] The vector acquisition module is used to acquire vector combinations, including entity vectors, corresponding to characters in the text, wherein the entity vectors represent entities including at least one character.
[0033] The vector concatenation module is used to concatenate the vectors in the vector combination for the characters in the text to obtain the character concatenation vector;
[0034] The pooling module is used to perform pooling calculations on the character concatenation vector to obtain the entity-pooled vector.
[0035] The entity relationship determination module is used to concatenate any two entity pooled vectors as entity pair vectors, and classify the entity pair vectors to determine entity relationships.
[0036] In conjunction with the second aspect, in the first implementation of the second aspect,
[0037] The vector combination includes entity vectors, attribute vectors, character vectors, and position vectors.
[0038] In conjunction with the first implementation of the second aspect, this disclosure provides a second implementation of the second aspect.
[0039] The vector acquisition module is used for:
[0040] Obtain the character vectors corresponding to the characters in the text;
[0041] Obtain the position vector of the character in the text.
[0042] Based on the named entity recognition model, the entity vectors and attribute vectors of the characters in the text are obtained.
[0043] In conjunction with any of the second aspects to the second implementation of the second aspect, this disclosure, in the third implementation of the second aspect,
[0044] The pooling module is used to: perform pooling calculations on the character concatenation vector of characters in an entity using the average pooling method, to obtain the entity pooled vector.
[0045] In conjunction with any of the second aspects to the second implementation of the second aspect, this disclosure provides a fourth implementation of the second aspect.
[0046] The entity relationship determination module is used for:
[0047] Concatenate any two entity pooling vectors that conform to the entity extraction rules to form an entity pair vector;
[0048] The entity pair vectors are classified to obtain the classification probability;
[0049] The entity relationships between the entities represented by the entity pair vectors are determined based on the classification probabilities.
[0050] In conjunction with the fourth implementation of the second aspect, this disclosure provides a fifth implementation of the second aspect.
[0051] The concatenation of any two entity pooled vectors that conform to the entity extraction rules as entity pair vectors includes:
[0052] Among all entity pooled vectors, any two entity pooled vectors with a preset logical relationship and a preset probability are selected and concatenated to construct entity pair vectors.
[0053] In conjunction with the fourth implementation of the second aspect, in the sixth implementation of the second aspect of this disclosure, determining the entity relationship between the entities represented by the entity pair vector based on the classification probability includes:
[0054] Based on the comparison result between the classification probability and a specific classification probability threshold, the logical relationship between the two entity pooled vectors in the entity pair vector is determined, and then the entity relationship between the entities represented by the two entity pooled vectors is determined.
[0055] In conjunction with the first implementation of the second aspect, this disclosure provides a seventh implementation of the second aspect.
[0056] The text includes medical record text; the entity vector includes at least one of the following: treatment method and disease; the attribute vector includes at least one of the following: location, type, time and place.
[0057] Thirdly, embodiments of this disclosure provide an electronic device, including a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method as described in the first aspect, or any one of the first to seventh implementations of the first aspect.
[0058] Fourthly, this disclosure provides a computer-readable storage medium storing computer instructions thereon, which, when executed by a processor, implement the method described in the first aspect and the first to seventh implementations of the first aspect.
[0059] Fifthly, this disclosure provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method steps as described in the first aspect, the first implementation of the first aspect to the seventh implementation of the first aspect.
[0060] According to the technical solution provided in this disclosure, the method involves a vector acquisition step, which obtains a vector combination including entity vectors corresponding to characters in the text, wherein the entity vectors represent entities including at least one character; a vector concatenation step, which concatenates the vectors in the vector combination for the characters in the text to obtain a character concatenation vector; a pooling step, which performs pooling calculation on the character concatenation vector to obtain an entity pooling vector; and an entity relationship determination step, which concatenates any two entity pooling vectors as an entity pair vector and classifies the entity pair vectors to determine the entity relationship. This allows for accurate extraction of entities from the text while conserving computational resources, and accurate analysis of the logical relationships between entities.
[0061] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0062] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the drawings:
[0063] Figure 1 An exemplary schematic diagram illustrating an implementation scenario of the text entity relationship analysis method according to an embodiment of the present disclosure is shown.
[0064] Figure 2 A flowchart illustrating a text entity relationship analysis method according to an embodiment of the present disclosure is shown;
[0065] Figure 3 Showing according to Figure 2 A detailed flowchart of step S201 in the illustrated embodiment;
[0066] Figure 4 Showing according to Figure 2 The flowchart of step S204 in the embodiment shown is detailed.
[0067] Figure 5 This diagram shows a structural block diagram of a text entity relationship analysis apparatus according to an embodiment of the present disclosure;
[0068] Figure 6 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;
[0069] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing the method according to embodiments of the present disclosure is shown. Detailed Implementation
[0070] In the following, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily implement them. Furthermore, for clarity, portions unrelated to the description of exemplary embodiments have been omitted from the drawings.
[0071] In this disclosure, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility of the presence or addition of one or more other features, figures, steps, behaviors, components, parts or combinations thereof.
[0072] It should also be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0073] In this disclosure, the acquisition of user information or user data is done with the user's authorization and confirmation, or by the user's active choice. Users can be individuals, for-profit organizations, non-profit organizations, or other types of persons or organizations.
[0074] As mentioned above, text analysis requires analyzing the logical relationships between entities within the text. For example, electronic medical records (EMRs) are crucial documents for doctors to diagnose and treat patients. In typical AI+medical tasks, EMRs are the most important information input. To effectively utilize EMR information, structured parsing of EMRs is necessary. EMRs have a high entity density and complex logical relationships. A typical EMR usually includes the following: symptoms, diagnosis, treatment drugs, surgery, laboratory tests, physical examination, medical imaging examinations, as well as lesion size, morphology, onset time, triggering factors, and examination results. Analyzing these logical relationships is extremely complex and requires significant computational resources.
[0075] To solve the above problems, the present disclosure proposes a method, an apparatus, an electronic device, and a readable storage medium for text entity relationship analysis.
[0076] According to an embodiment of the present disclosure, by, thus.
[0077] Figure 1 An exemplary schematic diagram showing an implementation scenario of a text entity relationship analysis method according to an embodiment of the present disclosure.
[0078] Those of ordinary skill in the art can understand that Figure 1 Exemplarily showing an implementation scenario of a text entity relationship analysis method without constituting a limitation to the present disclosure.
[0079] Such as Figure 1 As shown, in the sentence "The patient underwent a 'hysterectomy' in our hospital on [date]", the character vectors 102 of each character are obtained, that is, '患', '者',......'术'' ', and the position vectors 103 of each character, that is, 0, 1,......, 14, 15.
[0080] Using a Named Entity Recognition (NER) model, the entity 'hysterectomy' is recognized, as well as the entity vectors 105 and attribute vectors 104 of each character in the entity. For example, the entity vectors of the characters '子', '宫', '切', '除', '术' are respectively '手术', '手术', '手术', '手术', '手术', and the attribute vectors are respectively '部位', '部位', '类型', '类型', '类型'. In an embodiment of the present disclosure, named entity recognition is also known as entity recognition, entity chunking, and entity extraction, which is a subtask of information extraction aiming to locate and classify named entities in text into predefined categories, such as persons, organizations, locations, time expressions, quantities, currency values, percentages, etc. The specific details can be obtained from related technologies and will not be elaborated in the present disclosure.
[0081] In an embodiment of the present disclosure, the entity vector 105 can take, for example, '治疗手段', '疾病', etc. of '手术', and the attribute vector 104 can take '部位', '类型', '时间', '地点', etc.
[0082] In an embodiment of the present disclosure, the entity vector 105, the attribute vector 104, the character vector 102, and the position vector 103 form a vector combination including the entity vector, and the core of which is the entity vector 105 obtained through the NER model. According to different application scenarios, for example, other scenarios such as experimental records and work logs outside medical records, other vectors can also be included in the vector combination including the entity vector as needed.
[0083] Those of ordinary skill in the art can understand that the entity vector 105 and the attribute vector 104 can also take other values, and the present disclosure does not limit this.
[0084] In the vector concatenation of step S101, the vectors in the vector combination are concatenated. For example, the character vector 102, the position vector 103, the entity vector 105, and the attribute vector 104 of each character are concatenated to obtain a character concatenated vector. For example, the character vector "子", the position vector "10", the entity vector "手术", and the attribute vector "部位" of the character "子" are concatenated to obtain the concatenated vector 106; the character vector "术", the position vector "14", the entity vector "术", and the attribute vector "类型" of the character "术" are concatenated to obtain the concatenated vector 107.
[0085] In the pooling of step S102, a pooling operation such as average pooling is performed on the concatenated vectors of multiple characters in the entity. For example, for the entity "子宫切除术", the sum of the 5 character concatenated vectors is divided by 5 to obtain the entity pooled vector 109. Other entities in the text can obtain other entity pooled vectors, such as the entity pooled vector 108. In an embodiment of the present disclosure, pooling refers to an important concept in a convolutional neural network and can be understood as a form of downsampling. The specific details can be obtained from related technologies, and the present disclosure will not elaborate on this.
[0086] In the generation of entity pair vectors in step S103, among the multiple entity pooled vectors, any two entity pooled vectors can be selected to form an entity pair vector, so as to cover all possible entity pair vectors and fully cover the subsequent logical relationship analysis. It is also possible to select any two entity pooled vectors that meet the entity extraction rules among the multiple entity pooled vectors, for example, two entity pooled vectors with a preset logical relationship probability reaching a preset probability are concatenated to form an entity pair vector, so as to avoid concatenating and subsequent calculations for two entity pooled vectors with a low logical relationship probability, saving computational effort. For example, the entity pooled vectors 108 and 109 are concatenated to obtain the entity pair vector 110. In an embodiment of the present disclosure, the entity pair vector can also be referred to as an entity pair vector. In an embodiment of the present disclosure, compared with selecting any two entity pooled vectors for concatenation, selecting any two entity pooled vectors that meet the entity extraction rules for concatenation can further accurately extract entities from the text under the condition of saving computational resources.
[0087] In step S104, the entity pair vectors are classified. Classification can be performed using a learning method, training a classifier 111 with pre-labeled medical record samples. The classifier 111's sample labels are "logically related" and "not logically related." After classifying the entity pair vectors, the classifier 111 calculates the classification probability, which is the probability that the two entity pair vectors 108 and 109 in entity pair vector 110, after pooling, have a logical relationship. When the classification probability is greater than a specific classification probability threshold, such as 0.5, it is determined that the two entity pair vectors 108 and 109 in entity pair vector 110 have a logical relationship; otherwise, there is no logical relationship.
[0088] In step S105, the calculation of the whole sentence prediction loss can be performed by summing the calculation results of classifier 111 on multiple entity pair vectors 110, for example, pred1+pred2+pred3+pred4, to obtain the whole sentence prediction loss. In one embodiment of this disclosure, the loss is used to evaluate the degree to which the model's predicted value differs from the true value. The better the loss function, the better the model's performance is generally. Specific details can be obtained from related technologies, and this disclosure will not elaborate on them.
[0089] Those skilled in the art will understand that the above analysis of entity relationships based on case text is merely an example. The above analysis method can also be used for other texts besides medical records to extract entities and analyze the logical relationships between entities. This disclosure does not limit this.
[0090] Figure 2 A flowchart illustrating a text entity relationship analysis method according to an embodiment of this disclosure is shown.
[0091] like Figure 2 As shown, the text entity relationship analysis method includes steps S201, S202, S203, and S204.
[0092] In step S201, a vector combination including entity vectors corresponding to characters in the text is obtained, wherein the entity includes at least one character.
[0093] In step S202, the character concatenation vector is obtained from the vectors in the character concatenation vector combination in the text.
[0094] In step S203, the character concatenation vector is pooled to obtain the entity pooled vector.
[0095] In step S204, any two entity pooled vectors are concatenated as entity pair vectors, and the entity pair vectors are classified to determine entity relationships.
[0096] Step S201 is a vector acquisition step, step S202 is a vector concatenation step, step S203 is a pooling step, and step S204 is an entity relationship determination step.
[0097] As Figure 1 shown and as described above, corresponding to step S201, in the sentence "The patient underwent a 'hysterectomy' in our hospital on [date]", the character vectors 102 of each character, that is, '患', '者',..., '术', '', and the position vectors 103 of each character, that is, 0, 1,..., 14, 15 are obtained. The entity 'hysterectomy' is recognized, as well as the entity vectors 105 and attribute vectors 104 of each character in the entity. For example, the entity vectors of the characters '子', '宫', '切', '除', '术' are respectively 'operation', 'operation', 'operation', 'operation', 'operation', and the attribute vectors are respectively 'part', 'part', 'type', 'type', 'type'.
[0098] [[ID=D8]]Corresponding to step S202, the character vectors 102, position vectors 103, entity vectors 105, and attribute vectors 104 of each character are concatenated to obtain a character concatenation vector. For example, the character vector, position vector, entity vector, and attribute vector of the character '子' are concatenated to obtain the concatenation vector 106; the character vector, position vector, entity vector, and attribute vector of the character '术' are concatenated to obtain the concatenation vector 107.
[0099] Corresponding to step S203, a pooling operation such as average pooling is performed on the concatenation vectors of multiple characters in the entity. For example, for the entity 'hysterectomy', the pooling operation is performed on the 5 character concatenation vectors therein to obtain the entity pooled vector 109. Other entities in the text can obtain other entity pooled vectors, such as the entity pooled vector 108.
[0100] Corresponding to step S204, any two entity pooled vectors are selected to form an entity pair vector. For example, the entity pooled vectors 108 and 109 form the entity pair vector 110, and a classifier is used to classify the entity pair vector. After the classifier calculates the entity pair vector, a classification probability is obtained, that is, the probability that the two entity pooled vectors in the entity pair vector have a logical relationship. When the classification probability is greater than a specific classification probability threshold, such as 0.5, it is determined that the two entity pooled vectors in the entity pair vector have a logical relationship, otherwise there is no logical relationship.
[0101] According to the embodiments of this disclosure, the method involves a vector acquisition step, which obtains a vector combination including entity vectors corresponding to characters in the text, wherein the entity vector represents an entity including at least one character; a vector concatenation step, which concatenates vectors from the vector combination for characters in the text to obtain a character concatenation vector; a pooling step, which performs pooling calculation on the character concatenation vector to obtain an entity pooling vector; and an entity relationship determination step, which concatenates two entity pooling vectors as an entity pair vector and classifies the entity pair vectors to determine entity relationships. This allows for accurate extraction of entities from the text while conserving computational resources, and accurate analysis of the logical relationships between entities.
[0102] In embodiments of this disclosure, the vector combination includes entity vectors, attribute vectors, character vectors, and position vectors.
[0103] In embodiments of this disclosure, such as Figure 1 As shown, entity vector 105, attribute vector 104, character vector 102, and position vector 103 constitute a vector combination that includes entity vectors.
[0104] Those skilled in the art will understand that, depending on the application scenario, such as experimental records other than medical records, work logs, and other scenarios, other vectors may also be included in the vector combination of entity vectors as needed.
[0105] According to the embodiments of this disclosure, vector combinations including entity vectors, attribute vectors, character vectors, and position vectors are used to adapt to medical record application scenarios, facilitating accurate logical relationship analysis of entities in medical records.
[0106] Figure 3 Showing according to Figure 2 The flowchart of step S201 of the embodiment shown is detailed.
[0107] like Figure 3 As shown, Figure 2 The specific process of step S201 includes steps S301, S302, and S303.
[0108] In step S301, the character vectors corresponding to the characters in the text are obtained.
[0109] In step S302, the position vector of the character in the text is obtained.
[0110] In step S303, based on the named entity recognition model, the entity vector and attribute vector of the characters in the text are obtained.
[0111] In an embodiment of the present disclosure, each character can be directly extracted from the text to obtain the character vector corresponding to the character; moreover, the position vector corresponding to the character can be obtained. For example, in the sentence "The patient underwent "hysterectomy" in our hospital on [date]", the character vector of the character "子" is "子", and the position vector is 10. The entity vector and attribute vector of the characters in the text are obtained using a Named Entity Recognition (NER) model. For example, the entity vector of the character "子" is "surgery", and the attribute vector is "body part".
[0112] According to an embodiment of the present disclosure, the vector obtaining step includes: obtaining the character vector corresponding to the character in the text; obtaining the position vector of the position of the character in the text; based on the named entity recognition model, obtaining the entity vector and attribute vector of the character in the text, so as to accurately identify the entity vector and attribute vector, which is beneficial to performing accurate inter-entity logical relationship analysis with fewer computing resources.
[0113] In an embodiment of the present disclosure, the pooling step includes: using the average pooling method to perform pooling calculation on the character concatenated vectors of the characters in the entity to obtain the pooled vector of the entity.
[0114] In an embodiment of the present disclosure, for example, for the entity "hysterectomy", the average pooling can be performed on the 5 character concatenated vectors corresponding to "子", "宫", "切", "除", "术". The specific method is to sum the 5 character concatenated vectors and then divide by 5 to obtain the pooled vector of the entity.
[0115] According to an embodiment of the present disclosure, the pooling step includes: using the average pooling method to perform pooling calculation on the character concatenated vectors of the characters in the entity to obtain the pooled vector of the entity, so as to obtain the average information representation of the entity, and thus more accurately analyze the logical relationship between entities.
[0116] Figure 4 Shows the specific flowchart of step S204 according to Figure 2 the embodiment shown.
[0117] As Figure 4 shown, Figure 2 the specific process of step S204 in
[0118] In step S401, any two pooled vectors of entities that conform to the entity extraction rule are concatenated as the entity pair vector.
[0119] In step S402, classification calculation is performed on the entity pair vector to obtain the classification probability.
[0120] In step S403, the entity relationships between entities represented by the entity pair vectors are determined based on the classification probability.
[0121] In the embodiments of this disclosure, corresponding Figure 1 From multiple entity pooled vectors, any two entity pooled vectors that conform to the entity extraction rules are selected. For example, two entity pooled vectors whose probability of a preset logical relationship reaches a preset probability are concatenated to form an entity pair vector. For example, entity pooled vectors 108 and 109 are concatenated to obtain entity pair vector 110. In one embodiment of this disclosure, the entity extraction rules can be based on business needs. For example, in case analysis, entities such as "treatment methods" and "diseases" need to be extracted.
[0122] In the embodiments of this disclosure, corresponding Figure 1 The entity pair vectors are classified. Classification can be performed using a learning method, training a classifier 111 with pre-labeled case samples. The classifier 111's sample labels are "logically related" and "not logically related." After classifying the entity pair 110, the classifier 111 calculates the classification probability, which is the probability that the two entity pairs in the entity pair 110, after pooling, have a logical relationship (vectors 108 and 109). When the classification probability is greater than a specific classification probability threshold, such as 0.5, it is determined that the two entity pairs in the entity pair 110, after pooling, have a logical relationship; otherwise, they do not.
[0123] According to the embodiments of this disclosure, the step of determining entity relationships includes: concatenating any two entity pooling vectors that conform to the entity extraction rules as entity pair vectors; performing classification calculations on the entity pair vectors to obtain classification probabilities; and determining the entity relationships between the entities represented by the entity pair vectors based on the classification probabilities, thereby more accurately analyzing the logical relationships between entities.
[0124] In the embodiments of this disclosure, concatenating any two entity pooled vectors that conform to the entity extraction rules as an entity pair vector includes: selecting any two entity pooled vectors from all entity pooled vectors whose probability of having a preset logical relationship reaches a preset probability and concatenating them to construct an entity pair vector.
[0125] In embodiments of this disclosure, multiple entities can be extracted from text, such as pathological text. Constructing entity pair vectors for every arbitrary pair of entities could lead to excessive computation. However, by selecting any two entity pooled vectors with a predetermined logical relationship and concatenating them, invalid vector pairs can be avoided, saving computational resources without sacrificing the accuracy of logical analysis.
[0126] According to the embodiments of this disclosure, concatenating any two entity pooled vectors that conform to the entity extraction rules as entity pair vectors includes: selecting any two entity pooled vectors from all entity pooled vectors whose probability of having a preset logical relationship reaches a preset probability and concatenating them to construct entity pair vectors, thereby avoiding the construction of invalid vector pairs and saving computational resources without sacrificing the accuracy of logical analysis as much as possible.
[0127] In embodiments of this disclosure, determining the entity relationship between entities represented by entity pair vectors based on classification probabilities includes: determining the logical relationship between two entity pooled vectors in an entity pair vector based on the comparison result of classification probabilities and a specific classification probability threshold, and then determining the entity relationship between the entities represented by the two entity pooled vectors.
[0128] In embodiments of this disclosure, when the classification probability is greater than a specific classification probability threshold, such as 0.5, it is determined that the two entity pooled vectors in the entity pair vector have a logical relationship; otherwise, they do not have a logical relationship.
[0129] According to the embodiments of this disclosure, the entity relationship between entities represented by entity pair vectors is determined based on classification probability, including: determining the logical relationship between two entity pooling vectors in entity pair vectors based on the comparison result of classification probability and a specific classification probability threshold, and then determining the entity relationship between the entities represented by the two entity pooling vectors, thereby accurately analyzing whether there is a logical relationship between the two entity pooling vectors.
[0130] In embodiments of this disclosure, the text includes medical record text; the entity includes at least one of the following: treatment method and disease; the attribute vector includes at least one of the following: location, type, time and place.
[0131] In embodiments of this disclosure, as shown in the figures, the text may include medical records, and the entity vector may include at least one of the following: for example, surgical treatment methods and diseases. The attribute vector may include at least one of the following: location, type, time, and place.
[0132] It will be understood by those skilled in the art that entity vectors and attribute vectors may also include other formats, and this disclosure does not limit them. Text may also include other text formats besides medical records, and this disclosure does not limit it.
[0133] According to the embodiments of this disclosure, the text includes medical record text; the entity includes at least one of the following: treatment method and disease; the attribute vector includes at least one of the following: location, type, time and place, thereby accurately describing the entity information in the text and facilitating accurate analysis of the logical relationships between entities.
[0134] Figure 5 A structural block diagram of a text entity relationship analysis apparatus according to an embodiment of the present disclosure is shown. This apparatus can be implemented as part or all of an electronic device through software, hardware, or a combination of both.
[0135] like Figure 5 As shown, the text entity relationship analysis device 500 includes: a vector acquisition module 501, a vector concatenation module 502, a pooling module 503, and an entity relationship determination module 504.
[0136] The vector acquisition module 501 is used to acquire vector combinations, including entity vectors, corresponding to characters in the text, wherein the entity represented by the entity vector includes at least one character.
[0137] The vector concatenation module 502 is used to combine vectors from the character concatenation vectors in the text to obtain a character concatenation vector.
[0138] Pooling module 503 is used to perform pooling calculations on the character concatenation vector to obtain the entity pooled vector.
[0139] The entity relationship determination module 504 is used to concatenate any two entity pooled vectors as entity pair vectors and classify the entity pair vectors to determine entity relationships.
[0140] According to the embodiments of this disclosure, a vector acquisition module is used to acquire vector combinations including entity vectors corresponding to characters in the text, wherein the entity includes at least one character; a vector concatenation module is used to concatenate vectors from the vector combinations of characters in the text to obtain character concatenation vectors; a pooling module is used to perform pooling calculations on the character concatenation vectors to obtain entity pooling vectors; and an entity relationship determination module is used to concatenate any two entity pooling vectors as entity pair vectors and classify the entity pair vectors to determine entity relationships, thereby accurately extracting entities from the text while saving computing resources and accurately analyzing the logical relationships between entities.
[0141] In embodiments of this disclosure, the vector combination includes entity vectors, attribute vectors, character vectors, and position vectors.
[0142] According to the embodiments of this disclosure, vector combinations including entity vectors, attribute vectors, character vectors, and position vectors are used to adapt to medical record application scenarios, facilitating accurate logical relationship analysis of entities in medical records.
[0143] In the embodiments of this disclosure, the vector acquisition module 501 is used to: acquire the character vector corresponding to the character in the text; acquire the position vector of the character in the text; and acquire the entity vector and attribute vector of the character in the text based on the named entity recognition model, thereby accurately identifying the entity vector and attribute vector.
[0144] According to the embodiments of this disclosure, the vector acquisition module is used to: acquire the character vector corresponding to the character in the text; acquire the position vector of the character in the text; and acquire the entity vector and attribute vector of the character in the text based on the named entity recognition model, thereby accurately identifying the entity vector and attribute vector, so as to facilitate accurate analysis of logical relationships between entities with less computing resources.
[0145] In embodiments of this disclosure, the pooling module 503 is used to: perform pooling calculations on the character concatenation vector of characters in an entity using the average pooling method to obtain the entity pooled vector.
[0146] According to the embodiments of this disclosure, the pooling module is used to: perform pooling calculation on the character concatenation vector of the characters in the entity using the average pooling method to obtain the entity pooled vector, thereby obtaining the average information representation of the entity, and thus more accurately analyzing the logical relationship between entities.
[0147] In embodiments of this disclosure, the entity relationship determination module 504 is used to: concatenate any two entity pooling vectors that conform to the entity extraction rules as entity pair vectors; perform classification calculations on the entity pair vectors to obtain classification probabilities; and determine the entity relationship between the entities represented by the entity pair vectors based on the classification probabilities.
[0148] According to the embodiments of this disclosure, the entity relationship determination module is used to: concatenate any two entity pooling vectors that conform to the entity extraction rules as entity pair vectors; perform classification calculations on the entity pair vectors to obtain classification probabilities; and determine the entity relationships between the entities represented by the entity pair vectors based on the classification probabilities, thereby more accurately analyzing the logical relationships between entities.
[0149] In the embodiments of this disclosure, concatenating any two entity pooled vectors that conform to the entity extraction rules as an entity pair vector includes: selecting any two entity pooled vectors from all entity pooled vectors whose probability of having a preset logical relationship reaches a preset probability and concatenating them to construct an entity pair vector.
[0150] According to the embodiments of this disclosure, concatenating any two entity pooled vectors that conform to the entity extraction rules as entity pair vectors includes: selecting any two entity pooled vectors from all entity pooled vectors whose probability of having a preset logical relationship reaches a preset probability and concatenating them to construct entity pair vectors, thereby avoiding the construction of invalid vector pairs and saving computational resources without sacrificing the accuracy of logical analysis.
[0151] In embodiments of this disclosure, determining the entity relationship between entities represented by entity pair vectors based on classification probabilities includes: determining the logical relationship between two entity pooled vectors in an entity pair vector based on the comparison result of classification probabilities and a specific classification probability threshold, and then determining the entity relationship between the entities represented by the two entity pooled vectors.
[0152] According to the embodiments of this disclosure, the entity relationship between entities represented by entity pair vectors is determined based on classification probability, including: determining the logical relationship between two entity pooling vectors in entity pair vectors based on the comparison result of classification probability and a specific classification probability threshold, and then determining the entity relationship between the entities represented by the two entity pooling vectors, thereby accurately analyzing whether there is a logical relationship between the two entity pooling vectors.
[0153] In embodiments of this disclosure, the text includes medical record text; the entity vector includes at least one of the following: treatment method and disease; and the attribute vector includes at least one of the following: location, type, time, and place.
[0154] According to embodiments of this disclosure, the text includes medical record text; the entity vector includes at least one of the following: treatment method and disease; and the attribute vector includes at least one of the following: location, type, time and place, thereby accurately describing the entity information in the text and facilitating accurate analysis of the logical relationships between entities.
[0155] This disclosure also discloses an electronic device. Figure 6 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0156] like Figure 6 As shown, the electronic device 600 includes a memory 601 and a processor 602, wherein the memory 601 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 602 to perform the following steps:
[0157] The vector acquisition step involves acquiring a vector combination that includes entity vectors corresponding to characters in the text, wherein the entity vectors represent entities that include at least one character.
[0158] The vector concatenation step involves concatenating the vectors in the vector combination with the characters in the text to obtain a character concatenation vector.
[0159] The pooling step involves performing pooling calculations on the character concatenation vector to obtain the entity-pooled vector.
[0160] The entity relationship determination step involves concatenating any two entity pooled vectors as entity pair vectors, and classifying the entity pair vectors to determine the entity relationship.
[0161] In embodiments of this disclosure, the vector combination includes entity vectors, attribute vectors, character vectors, and position vectors.
[0162] In embodiments of this disclosure, the vector acquisition step includes:
[0163] Obtain the character vectors corresponding to the characters in the text;
[0164] Obtain the position vector of the character in the text.
[0165] Based on the named entity recognition model, the entity vectors and attribute vectors of the characters in the text are obtained.
[0166] In embodiments of this disclosure, the pooling step includes: using an average pooling method to perform pooling calculations on the character concatenation vector of the characters in the entity, to obtain the entity pooled vector.
[0167] In embodiments of this disclosure, the entity relationship determination step includes:
[0168] Concatenate any two entity pooling vectors that conform to the entity extraction rules to form an entity pair vector;
[0169] The entity pair vectors are classified to obtain the classification probability;
[0170] The entity relationships between the entities represented by the entity pair vectors are determined based on the classification probabilities.
[0171] In embodiments of this disclosure, concatenating any two entity pooling vectors that conform to the entity extraction rules as an entity pair vector includes:
[0172] Among all entity pooled vectors, any two entity pooled vectors with a preset logical relationship and a preset probability are selected and concatenated to construct entity pair vectors.
[0173] In embodiments of this disclosure, determining the entity relationship between entities represented by the entity pair vector based on the classification probability includes:
[0174] Based on the comparison result between the classification probability and a specific classification probability threshold, the logical relationship between the two entity pooled vectors in the entity pair vector is determined, and then the entity relationship between the entities represented by the two entity pooled vectors is determined.
[0175] In embodiments of this disclosure, the text includes medical record text; the entity vector includes at least one of the following: treatment method and disease; the attribute vector includes at least one of the following: location, type, time and place.
[0176] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing the method according to embodiments of the present disclosure is shown.
[0177] like Figure 7 As shown, the computer system 700 includes a processing unit 701, which can execute various processes described in the above embodiments according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage section 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0178] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed. The processing unit 701 can be implemented as a CPU, GPU, TPU, FPGA, NPU, etc.
[0179] In particular, according to embodiments of this disclosure, the methods described above can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising computer instructions that, when executed by a processor, implement the steps of the methods described above. In such embodiments, the computer program product can be downloaded and installed from a network via communication section 709, and / or installed from removable media 711.
[0180] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0181] The units or modules described in the embodiments of this disclosure can be implemented in software or programmable hardware. The described units or modules can also be located in a processor, and the names of these units or modules do not necessarily constitute a limitation on the unit or module itself.
[0182] In another aspect, this disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system described above; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to perform the methods described in this disclosure.
[0183] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. A text entity relation analysis method, comprising: The vector acquisition step involves acquiring a vector combination that includes entity vectors corresponding to characters in the text, wherein the entity vectors represent entities that include at least one character. The vector concatenation step involves concatenating the vectors in the vector combination with the characters in the text to obtain a character concatenation vector. The pooling step involves performing pooling calculations on the character concatenation vector to obtain the entity-pooled vector. The entity relationship determination step involves selecting any two entity pooled vectors from all entity pooled vectors whose probability of having a preset logical relationship reaches a preset probability and concatenating them to construct entity pair vectors. The entity pair vectors are classified to obtain the classification probability; The entity relationships between the entities represented by the entity pair vectors are determined based on the classification probabilities.
2. The method according to claim 1, wherein, The vector combination includes entity vectors, attribute vectors, character vectors, and position vectors.
3. The method according to claim 2, wherein, The vector acquisition steps include: Obtain the character vectors corresponding to the characters in the text; Obtain the position vector of the character in the text. Based on the named entity recognition model, the entity vectors and attribute vectors of the characters in the text are obtained.
4. The method according to any one of claims 1 to 3, wherein, The pooling step includes: using the average pooling method to perform pooling calculations on the character concatenation vector of the characters in the entity, to obtain the entity pooled vector.
5. The method according to any one of claims 1 to 3, wherein, Determining the entity relationships between entities represented by the entity pair vectors based on the classification probabilities includes: Based on the comparison result between the classification probability and a specific classification probability threshold, the logical relationship between the two entity pooled vectors in the entity pair vector is determined, and then the entity relationship between the entities represented by the two entity pooled vectors is determined.
6. The method according to claim 2, wherein, The text includes medical record text; the entity vector includes at least one of the following: treatment method and disease; the attribute vector includes at least one of the following: location, type, time and place.
7. A text entity relation analysis device, comprising: The vector acquisition module is used to acquire vector combinations, including entity vectors, corresponding to characters in the text, wherein the entity vectors represent entities including at least one character. The vector concatenation module is used to concatenate the vectors in the vector combination for the characters in the text to obtain the character concatenation vector; The pooling module is used to perform pooling calculations on the character concatenation vector to obtain the entity-pooled vector. The entity relationship determination module is used to select any two entity pooled vectors with a preset logical relationship and a preset probability from all entity pooled vectors and concatenate them to construct entity pair vectors. The entity pair vectors are classified to obtain the classification probability; The entity relationships between the entities represented by the entity pair vectors are determined based on the classification probabilities.
8. An electronic device comprising a memory and a processor; wherein, The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the steps of the method according to any one of claims 1-6.
9. A readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1-6.
10. A computer program product comprising a computer program / instructions, wherein, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1-6.
Citation Information
Patent Citations
Entity relationship type determination method, apparatus and device, and storage medium
CN113761837A