A Chinese medical named entity recognition method and device integrating the relationship between entities

By obtaining and fusing the relationship information in the text in the Chinese medical named entity recognition method, using BERT for feature representation and combining the adaptive weight allocation strategy, the problem that existing methods fail to effectively utilize the relationship between entities is solved, and the entity recognition effect in the medical field is significantly improved.

CN114817459BActive Publication Date: 2025-04-01BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210323152.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-03-10
Filing Date
2022-03-29
Publication Date
2025-04-01
Estimated Expiration
2042-03-29

AI Technical Summary

Technical Problem

The existing Chinese medical named entity recognition method fails to effectively utilize the relationship information between entities in text, resulting in poor entity recognition in the medical field.

Method used

By obtaining the relationship information in the data set text, using BERT for relationship feature representation, and analyzing it in combination with text information, an adaptive weight allocation strategy is used to incorporate the relationship information into the text representation to enhance the entity recognition ability in the medical field.

Benefits of technology

It effectively integrates relationship information between entities, improves the accuracy and effectiveness of naming entity recognition in the medical field, and enhances the understanding and information extraction ability of medical texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114817459B_ABST
    Figure CN114817459B_ABST
Patent Text Reader

Abstract

The present invention discloses a Chinese medical named entity recognition method and device integrating the relationship between entities, wherein the method comprises: encoding the medical text by a pre-trained encoding model, and obtaining a high-level feature vector by encoding the medical text by using an encoding network; using the pre-trained encoding model to perform relationship embedding representation, and using the attention mechanism to take the second text information as context information, and performing operations on the relationship embedding and text embedding in the medical text to obtain the relationship feature information of the medical text; calculating the probability weight by a weight distribution strategy and integrating the context information and the relationship feature information to balance the weight distribution of the relationship feature information and the medical text; and outputting the named entity category with the highest probability by decoding the entity recognition model to obtain the label results of the corresponding medical text. The present invention can effectively integrate the relationship information into the text representation to enhance the entity recognition capability in the medical field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of information technology and data business technology, and in particular to a Chinese medical named entity recognition method and device integrating inter-entity relationships. Background Art

[0002] Named entity recognition technology is to complete the recognition and extraction of the boundaries and categories of specific entities, recognize entities and their categories and save them in a structured form, obtain high-quality structural information from massive unstructured information, complete the effective extraction of massive unstructured data information, and construct a specific style data set. A large amount of medical knowledge information exists in various texts in a multidimensional, complex, and unstructured form. For the Chinese medical named entity recognition task, locating and identifying entities of specific categories from medical texts, such as extracting structured information such as diseases, symptoms, examination items, and drug names from electronic medical records / patient complaints / medical literature, is the main function of entity extraction. Medical named entity recognition, as the basis for the construction of medical data sets and knowledge graphs, is usually associated with relationship extraction tasks. At present, the methods for extracting information from entities and relationships are mainly divided into two categories according to the model structure. The first category is to use the pipeline method to complete entity recognition and relationship determination, which can be regarded as a series of two tasks. First, the text is completed with entity recognition tasks, and then the results of entity recognition are combined separately, and then the relationship labels of the corresponding entity combinations are added by classification methods. The second way to complete the entity recognition and relationship extraction tasks is to establish a joint model for entity and relationship recognition and extraction. The joint model achieves parameter sharing between entity recognition and relationship classification, allowing the intrinsic information of the two processes to interact, thereby improving the performance of entity recognition and relationship classification at the same time. However, most current methods for learning and using entity and relationship information consider named entity recognition as a basic upstream task or parameter learning process. Relationship information is only used in the relationship extraction task process, and there is less relationship information applied to entity recognition tasks. It does not consider that the relationship information between the previous and next entities in the text promotes entity extraction learning and the supplement of text content.

[0003] Especially for medical texts, such as medical knowledge, diagnostic reports, electronic medical records, etc., they contain rich knowledge, and the entities in the text before and after the sentence and the corresponding types and the relationship between entities are highly correlated. At present, the named entity recognition tasks in the general field and the medical field have hardly considered the relevance of the relational information in the text and the influence of their interaction. Therefore, Chinese medical named entity recognition still does not make good use of entity relationship information, and lacks methods to combine relationship information for medical entity recognition. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0005] To this end, the purpose of the present invention is to propose a Chinese medical named entity recognition method that integrates the relationship between entities. First, the relationship information in the data set text is obtained, and BERT is used to represent the relationship features. Then, the relationship information in the text is combined with the original text information to analyze the correlation between the text and the relationship. Through an adaptive weight allocation strategy, the relationship information is effectively integrated into the text representation to enhance the entity recognition capability in the medical field.

[0006] Another object of the present invention is to provide a Chinese medical named entity recognition device that integrates the relationships between entities.

[0007] To achieve the above-mentioned purpose, the present invention proposes a Chinese medical named entity recognition method integrating the relationship between entities, comprising:

[0008] The medical text is input into the entity recognition model for text embedding, the medical text is first encoded by a pre-trained encoding model to obtain first text information, and the first text information is second encoded by an encoding network to obtain a high-level feature vector to obtain second text information; the pre-trained encoding model is used for relational embedding representation, and the attention mechanism is used to take the second text information as context information, and the relational embedding and text embedding in the medical text are operated to obtain the relational feature information of the medical text; based on the relational feature information, the probability weight is calculated by a weight distribution strategy and the context information and the relational feature information are integrated to perform weight distribution balance on the relational feature information and the medical text; based on the weight distribution balance, the named entity category with the highest probability is output through decoding of the entity recognition model to obtain the label results corresponding to the medical text.

[0009] In addition, the Chinese medical named entity recognition method integrating the relationship between entities according to the above embodiment of the present invention may also have the following additional technical features:

[0010] Furthermore, in one embodiment of the present invention, the first encoding processing of the medical text by the pre-trained encoding model to obtain the first encoded text includes: encoding the medical text by the pre-trained BERT model, performing word representation according to the meaning of the text vector of the medical text, and using a specific identification symbol for each sentence in the medical text to obtain the first encoded text; wherein the text vector includes: a word vector, a segment vector and a position vector.

[0011] Further, in one embodiment of the present invention, e is calculated by using the common representation of the relation embedding and the second text information. i,k , the attention mechanism is assigned different probability weights a through normalized calculation i,k :

[0012] e i,k =v T tanh(W r r k +W h h i )

[0013]

[0014] Among them, W r , W h is a hyperparameter, h i is the second text information, r k is the embedding representation of the relation type.

[0015] Furthermore, in one embodiment of the present invention, a vector representation generated based on text and relationship is obtained by accumulating the products of different probability weights assigned by the attention mechanism and the second text information:

[0016]

[0017] Among them, c k Vector representations generated based on text and relations.

[0018] Furthermore, in one embodiment of the present invention, the calculation formula for calculating the probability weight by the weight allocation strategy is:

[0019]

[0020] Among them, W1, W2, b1, b2 are hyper parameters, P t is the probability weight.

[0021] Further, in one embodiment of the present invention, the text representation of the fusion relationship information is obtained by calculating the fusion calculation formula based on the probability weight, and the fusion calculation formula is:

[0022] s t =P t (W1c k +b1)+(1-P t )(W2h i +b2)

[0023] Among them, s t It is a text representation that integrates relational information.

[0024] Furthermore, in one embodiment of the present invention, the output value of the weight distribution strategy is transformed into a total value of a predefined specific type through dimension transformation, and the label results of the corresponding input medical text are obtained by decoding the CRF layer:

[0025]

[0026] y * =arg max(s(X,y))

[0027] Among them, s(X,y) is the score of the label sequence of the calculated input sequence X, T represents the transfer matrix, which represents the relationship between adjacent labels, and P represents that the i-th word is labeled y i The probability of ; the Viterbi algorithm is used to obtain the optimal label sequence with the highest score corresponding to the current input sequence, and the final output y * is the final label sequence result.

[0028] The Chinese medical named entity recognition method that integrates the relationship between entities in the embodiment of the present invention first obtains the relationship information in the data set text, uses BERT to represent the relationship features, and then combines the relationship information in the text with the original text information to analyze the correlation between the text and the relationship. Through an adaptive weight allocation strategy, the relationship information is effectively integrated into the text representation to enhance the entity recognition capability in the medical field.

[0029] To achieve the above object, the present invention proposes a Chinese medical named entity recognition device integrating the relationship between entities, comprising:

[0030] A text encoding module is used to input medical text into an entity recognition model for text embedding, perform a first encoding process on the medical text through a pre-trained encoding model to obtain first text information, and use an encoding network to perform a second encoding process on the first text information to obtain a high-level feature vector to obtain second text information; a relationship operation module is used to use the pre-trained encoding model for relationship embedding representation, and at the same time use an attention mechanism to take the second text information as context information, and perform operations on the relationship embedding and text embedding in the medical text to obtain the relationship feature information of the medical text; a weight distribution module is used to calculate probability weights based on the relationship feature information through a weight distribution strategy and fuse the context information and the relationship feature information to perform weight distribution balance on the relationship feature information and the medical text; a result output module is used to output the named entity category with the highest probability through decoding of the entity recognition model based on the weight distribution balance to obtain each label result corresponding to the medical text.

[0031] The Chinese medical named entity recognition device that integrates the relationship between entities in the embodiment of the present invention first obtains the relationship information in the data set text, uses BERT to represent the relationship features, and then combines the relationship information in the text with the original text information to analyze the correlation between the text and the relationship. Through an adaptive weight allocation strategy, the relationship information is effectively integrated into the text representation to enhance the entity recognition capability in the medical field.

[0032] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0034] Figure 1 A flowchart of a Chinese medical named entity recognition method integrating inter-entity relationships according to an embodiment of the present invention;

[0035] Figure 2 A framework diagram of a Chinese medical named entity recognition system integrating inter-entity relationships according to an embodiment of the present invention;

[0036] Figure 3 A structural diagram of a Chinese medical named entity recognition model integrating inter-entity relationships according to an embodiment of the present invention;

[0037] Figure 4 Schematic diagram of the structure of a Chinese medical named entity recognition device integrating inter-entity relationships according to an embodiment of the present invention. DETAILED DESCRIPTION

[0038] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0039] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0040] The following describes a Chinese medical named entity recognition method and apparatus integrating inter-entity relationships according to an embodiment of the present invention with reference to the accompanying drawings.

[0041] The present invention first obtains the relational information in the data set text, uses BERT to represent the relational features, then combines the relational information in the text with the original text information, analyzes the relevance between the text and the relation, and effectively integrates the relational information into the text representation through an adaptive weight allocation strategy to enhance the entity recognition capability in the medical field. The framework is as follows: Figure 2 shown.

[0042] Figure 1 It is a flowchart of a Chinese medical named entity recognition method integrating inter-entity relationships according to an embodiment of the present invention.

[0043] like Figure 1 As shown, the Chinese medical named entity recognition method integrating the relationship between entities includes the following steps:

[0044] S1, input the medical text into the entity recognition model for text embedding, perform a first encoding process on the medical text through a pre-trained encoding model to obtain first text information, and use the encoding network to perform a second encoding process on the first text information to obtain a high-level feature vector to obtain second text information.

[0045] It is understandable that in medical text, given a sentence X, X = {x1, x2, ..., x n}, where n represents the length of the sequence. For each input sequence, it contains an indefinite number of entities with category labels. There are multiple entities, such as x1x2, x5x6x7, whose entity types, i.e., labels, are y1 and y2, respectively. At the same time, the relationship between the two entities x1x2 and x5x6x7 is r1. For example, the text is "Rheumatoid arthritis @ ulnar deviation is caused by MCP joint inflammation.", where the entity type of "MCP joint inflammation" is "disease", the entity type of "ulnar deviation" is "symptoms", and the relationship between them is "clinical manifestations". The goal of the present invention is to find all entities of each category in the sequence X and mark them as corresponding entity categories y∈Y.

[0046] It can be understood that for text embedding of medical text, the present invention needs to select a word representation that can fully consider the sentence or the entire document and can fully and adequately express the information of the word.

[0047] In an embodiment of the present invention, a BERT pre-trained model is used to encode medical text. BERT adopts a deep network model that contains rich contextual information, combines the meanings of word vectors, segment vectors, and position vectors to represent a word, and uses specific identification symbols for each sentence, which can fully and adequately represent the information of characters and words in the medical text.

[0048] Furthermore, the Chinese medical named entity recognition model that integrates the relationship between entities, such as Figure 3 shown.

[0049] Furthermore, after using the pre-trained BERT model to encode the original medical text, the Bi-LSTM network is used to encode the input character-encoded text to obtain a higher-level feature vector to better represent the semantic information of the sentences in the original text.

[0050] S2 uses a pre-trained encoding model to perform relational embedding representation, and uses an attention mechanism to take the second text information as context information, and performs operations on the relational embedding and text embedding in the medical text to obtain the relational feature information of the medical text.

[0051] It is understandable that, for text and relations, there are also different interactions and different correlations between entities in the text and different relations.

[0052] In an embodiment of the present invention, an attention mechanism based on relationship information is proposed, which uses text information and relationship information to obtain different weight influences on texts under different relationships, thereby obtaining key related information related to the relationship and reducing some useless or less informative interference information.

[0053] Specifically, BERT is used for relation embedding representation, and then the attention mechanism is used to operate the relation embedding and text embedding for the relations in the text, so as to learn the various relations contained in the text.

[0054] Specifically, the entity recognition model will output the text information h after BERT and Bi-LSTM encoding. i As context information, r k is the embedding representation of the relation type. e is calculated by the joint representation of relation embedding and text feature encoding. i,k , after normalization calculation, the final relationship-based attention weight a is obtained i,k .

[0055] e i,k =v T tanh(W r r k +W h h i )

[0056]

[0057] Where W r , W h is a hyperparameter. The weight distribution under the joint action of text and relationship can be obtained by calculating the relationship-based attention distribution.

[0058]

[0059] Afterwards, the attention mechanism assigns different probability weights and accumulates the products with the text encoding output to obtain the vector representation c generated based on the text and relationship. k , and obtain the text representation that implies a specific relationship.

[0060] S3, based on the relationship feature information, calculates the probability weight through the weight distribution strategy and fuses the context information and the relationship feature information to balance the weight distribution of the relationship feature information and the medical text.

[0061] Specifically, through the above steps, the relational feature information based on the original text and the relation has been obtained. On the basis of obtaining the original text embedding representation and the relation representation vector, based on the existing method of fusion with text encoding.

[0062] The weight distribution strategy of this embodiment is used to integrate the context of Chinese medical text and the relational features contained in the text. The weight distribution strategy formed based on feature calculation can adaptively integrate the relational information provided by the attention mechanism layer based on the original text and the relation before weight distribution. The probability weight P is calculated by the following method t The two feature vectors involved in the probability weight calculation have different feature information of the original text information and the relationship information respectively, and the weight distribution method is used as a bridge for the fusion of the two features. The detailed calculation method is as follows:

[0063]

[0064] Among them, W1, W2, b1, and b2 are hyperparameters. First, dot product operations are performed on the relationship features and the original text features, and then they are concatenated to merge and retain all the information. Then, through the sigmoid activation function of the neural network, the above results are mapped to the interval between 0 and 1, and the weight of the information that needs to be retained for each feature can be obtained. The larger the value, the greater the proportion of the relationship feature. The relationship information and text information are combined through the following calculation to obtain the text representation s that integrates the relationship information t :

[0065] s t =P t (W1c k +b1)+(1-P t )(W2h i +b2)

[0066] Through the above probability weight distribution principle, weights are assigned to the feature information of the original text and the relationship, respectively representing the importance of the information they contain. Through the adaptive text information fusion method, the relationship information and the original text information are reasonably fused.

[0067] S4, based on the weight distribution balance, decodes the entity recognition model to output the named entity category with the highest probability, so as to obtain the label results of the corresponding medical text.

[0068] Specifically, the decoding part is implemented through the CRF conditional random field to complete the acquisition of the type of label corresponding to the identified entity. CRF is a conditional probability distribution of a set of output sequences based on the input sequence. It can use the association between adjacent tags to perform the optimal prediction sorting, thereby overcoming the shortcomings of other methods in considering the continuity state of tags. The results obtained by the CRF algorithm include various possible annotation orders, and then the output order with the highest score is obtained through decoding. The above output is transformed into a total value of a predefined specific type, and then calculated through the CRF layer to finally obtain the label results corresponding to the input text. As shown below:

[0069]

[0070] y * =arg max(s(X,y))

[0071] s(X,y) is the score of the label sequence of the input sequence X, where T represents the transfer matrix, indicating the relationship between adjacent labels, and P indicates that the i-th word is labeled y i Then the Viterbi algorithm is used to obtain the optimal label sequence with the highest score corresponding to the current input sequence, and the final output y * is the final label sequence result.

[0072] Furthermore, if Figure 3 As shown in the figure, the original text is first encoded using the pre-trained BERT model, and then the Bi-LSTM network is used to encode the text after the input character encoding to obtain a higher-level feature vector to better represent the semantic information of the sentences in the original text. At the same time, BERT is used for relationship embedding representation, and then the attention mechanism is used to operate the relationship embedding and text embedding for the relationship in the text, and the various types of relationships contained in the text are learned. After that, according to the feature encoding representation of the text and the relationship feature embedding, the probability weight distribution mechanism is introduced into the model, and the weight distribution strategy is used to calculate the self-adjusting and adaptive transmission of information, and the weight distribution balance of the relationship information and the text is performed to ensure that the transmitted information is more effective. Finally, the model is decoded by CRF, and the expected output is the named entity category with the highest probability.

[0073] According to the Chinese medical named entity recognition method that integrates the relationship between entities proposed in the embodiment of the present invention, the relationship information in the data set text is first obtained, and BERT is used to represent the relationship features. Then, the relationship information in the text and the original text information are combined to analyze the correlation between the text and the relationship. Through an adaptive weight allocation strategy, the relationship information is effectively integrated into the text representation to enhance the entity recognition capability in the medical field.

[0074] In order to implement the above embodiment, Figure 4 As shown, this embodiment also provides a Chinese medical named entity recognition device 10 that integrates the relationship between entities. The device 10 includes: a text encoding module 100, a relationship operation module 200, a weight allocation module 300 and a result output module 400.

[0075] The text encoding module 100 is used to input the medical text into the entity recognition model for text embedding, perform a first encoding process on the medical text through a pre-trained encoding model to obtain first text information, and perform a second encoding process on the first text information using an encoding network to obtain a high-level feature vector to obtain second text information;

[0076] The relation operation module 200 is used to use the pre-trained encoding model to perform relation embedding representation, and use the attention mechanism to take the second text information as context information, and to operate the relation embedding and text embedding in the medical text to obtain the relation feature information of the medical text;

[0077] A weight distribution module 300 is used to calculate the probability weight based on the relationship feature information through a weight distribution strategy and fuse the context information and the relationship feature information to balance the weight distribution of the relationship feature information and the medical text;

[0078] The result output module 400 is used to output the named entity category with the highest probability based on the weight distribution balance through decoding of the entity recognition model to obtain the label results of the corresponding medical text.

[0079] Furthermore, the text encoding module 100 is also used for:

[0080] The medical text is encoded by a pre-trained BERT model, words are represented according to the meaning of the text vector of the medical text, and a specific identification symbol is used for each sentence in the medical text to obtain a first encoded text; wherein the text vector includes: a word vector, a segment vector and a position vector.

[0081] Furthermore, it also includes: a weight calculation module, which is used to calculate e through the common representation of the relationship embedding and the second text information i,k , the attention mechanism is assigned different probability weights a through normalized calculation i,k:

[0082] e i,k =v T tanh(W r r k +W h h i )

[0083]

[0084] Among them, W r , W h is a hyperparameter, h i is the second text information, r k is the embedding representation of the relation type.

[0085] According to the Chinese medical named entity recognition device that integrates the relationship between entities proposed in the embodiment of the present invention, the relationship information in the data set text is first obtained, and the relationship features are represented by using BERT. Then, the relationship information in the text is combined with the original text information to analyze the correlation between the text and the relationship. Through an adaptive weight allocation strategy, the relationship information is effectively integrated into the text representation to enhance the entity recognition capability in the medical field.

[0086] It should be noted that the aforementioned explanation of the embodiment of the Chinese medical named entity recognition method integrating the relationship between entities is also applicable to the Chinese medical named entity recognition device integrating the relationship between entities of this embodiment, and will not be repeated here.

[0087] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0088] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0089] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A Chinese medical named entity recognition method integrating the relationship between entities, characterized in that: The following steps are involved: Inputting the medical text into the entity recognition model for text embedding, performing a first encoding process on the medical text using a pre-trained encoding model to obtain first text information, and performing a second encoding process on the first text information using an encoding network to obtain a high-level feature vector to obtain second text information; Using the pre-trained encoding model to perform relation embedding representation, using an attention mechanism to take the second text information as context information, and performing operations on the relation embedding and text embedding in the medical text to obtain relation feature information of the medical text; Based on the relationship feature information, a probability weight is calculated through a weight distribution strategy and the context information and the relationship feature information are integrated to balance the weight distribution of the relationship feature information and the medical text; Based on the weight distribution balance, the named entity category with the highest probability is output through decoding of the entity recognition model to obtain label results corresponding to the medical text; The calculation formula for calculating the probability weight through the weight allocation strategy is: in, , , , is a hyperparameter, is the probability weight; The text representation of the fusion relationship information is calculated by a fusion calculation formula based on the probability weight, and the fusion calculation formula is: in, It is a text representation that integrates relational information.

2. The method according to claim 1, characterized in that The step of performing a first encoding process on the medical text by using the pre-trained encoding model to obtain a first encoded text includes: The medical text is encoded by a pre-trained BERT model, words are represented according to the meaning of the text vector of the medical text, and specific identification symbols are used for each sentence in the medical text to obtain the first encoded text; wherein the text vector includes: a word vector, a segment vector and a position vector.

3. The method according to claim 2, characterized in that The relationship embedding and the second text information are used to jointly represent the relationship embedding and the second text information. , the attention mechanism is assigned different probability weights through normalized calculation : in, , is a hyperparameter, is the second text message, is the embedding representation of the relation type.

4. The method according to claim 3, characterized in that The vector representation generated based on text and relationship is obtained by accumulating the products of different probability weights assigned by the attention mechanism and the second text information: in, Vector representations generated based on text and relations.

5. The method according to claim 1, characterized in that: The output value of the weight distribution strategy is transformed into a total value of a predefined specific type through dimension transformation, and is decoded by the CRF layer to obtain the label results of the corresponding input medical text: in, To calculate the score of the label sequence of the input sequence X, T represents the transfer matrix, which represents the relationship between adjacent labels, and P represents the i-th word as the label probability; The Viterbi algorithm is used to obtain the optimal label sequence with the highest score corresponding to the current input sequence, and the final output is is the final label sequence result.

6. A Chinese medical named entity recognition device integrating the relationship between entities, characterized in that: include: A text encoding module, used for inputting medical text into an entity recognition model for text embedding, performing a first encoding process on the medical text through a pre-trained encoding model to obtain first text information, and performing a second encoding process on the first text information using an encoding network to obtain a high-level feature vector to obtain second text information; A relational operation module, used to use the pre-trained encoding model to perform relational embedding representation, and use an attention mechanism to take the second text information as context information, and to operate the relational embedding and text embedding in the medical text to obtain relational feature information of the medical text; A weight distribution module, used to calculate the probability weight based on the relationship feature information through a weight distribution strategy and fuse the context information and the relationship feature information to perform a weight distribution balance on the relationship feature information and the medical text; A result output module is used to output the named entity category with the highest probability through decoding of the entity recognition model based on the weight distribution balance, so as to obtain each label result corresponding to the medical text; The calculation formula for calculating the probability weight through the weight allocation strategy is: in, , , , is a hyperparameter, is the probability weight; The text representation of the fusion relationship information is calculated by a fusion calculation formula based on the probability weight, and the fusion calculation formula is: in, It is a text representation that integrates relational information.

7. The device according to claim 6, characterized in that The text encoding module is further used for: The medical text is encoded by a pre-trained BERT model, words are represented according to the meaning of the text vector of the medical text, and specific identification symbols are used for each sentence in the medical text to obtain the first encoded text; wherein the text vector includes: a word vector, a segment vector and a position vector.

8. The device according to claim 7, characterized in that Also includes: A weight calculation module is used to calculate the weight of the relation embedding and the second text information through the joint representation. , the attention mechanism is assigned different probability weights through normalized calculation : in, , is a hyperparameter, is the second text message, is the embedding representation of the relation type.

Citation Information

Patent Citations

  • Medical named entity recognition modeling method based on attention mechanism

    CN113361277A

  • Chinese medicine named entity and part-of-speech combined learning method fusing multi-source knowledge

    CN113723103A