A method, device and storage medium for identifying named entities in traditional Chinese medicine
Through the combination of embedded layer, model layer and enhancement layer, combined with multiple named entity recognition models and joint models, the problem of poor recognition of named entity in traditional Chinese medicine is solved, and more accurate and robust recognition results are achieved.
Patent Information
- Application Number
- CN202410570454.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-05-09
AI Technical Summary
The existing traditional Chinese medicine naming entity recognition methods have relatively few professional corpuses in the traditional Chinese medicine corpus, complex entity classification, unstructured data and ambiguity of entity boundaries, resulting in poor recognition results.
Using the combination method of embedding layer, model layer and enhancement layer, by presetting multiple named entity recognition models and joint models, character vectors are generated and the optimal joint model is determined, and named entity recognition in traditional Chinese medicine is carried out, combining the Hidden Markov model, Conditional random field model, long short-term memory artificial neural network model, and bidirectional long short-term memory network combined with conditional random field model are used to optimize the optimal joint model using a continuous learning framework.
It improves the accuracy and robustness of the recognition of named entities in traditional Chinese medicine, can more accurately identify named entities in traditional Chinese medicine, adapt to the characteristics of the traditional Chinese medicine corpus, and enhances the comprehensiveness and accuracy of the recognition results.
Smart Images

Figure CN118378627B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of named entity recognition, and in particular to a method, device and storage medium for recognizing named entities in traditional Chinese medicine. Background Art
[0002] Knowledge graph technology, when applied to both common sense and domain-specific knowledge, can address the challenges of multi-source heterogeneity, data acquisition, and sharing in the field of Traditional Chinese Medicine (TCM). Knowledge graphs can represent multidimensional information in TCM using concepts, entities, and corresponding relationships, expressing it in a form closer to the human cognitive world. Furthermore, this information can be well stored, managed, and utilized by computers. In a knowledge graph, nodes represent specific objects, concepts, information resources, or data about them, while edges represent semantic relationships between nodes. Nodes extracted from the knowledge graph are used for named entity recognition (NER) to accomplish specific goals.
[0003] Identifying named entities from unstructured knowledge corpora is one of the core tasks in building knowledge graphs. Named entity recognition is an effective sequence annotation technology that originated from a dictionary-based and planning-based approach.
[0004] Existing methods primarily focus on general corpora with abundant training data. In the field of Traditional Chinese Medicine (TCM), however, there are challenges such as the relatively limited availability of specialized TCM corpora, the complexity of entity classification, the unstructured nature of the data, and the ambiguity of entity boundaries. Consequently, existing TCM named entity recognition methods perform poorly. Summary of the Invention
[0005] The embodiments of the present invention provide a method, device and storage medium for identifying named entities in traditional Chinese medicine (TCM), which can more accurately identify named entities in TCM.
[0006] In a first aspect, an embodiment of the present invention provides a method for identifying named entities in traditional Chinese medicine, the method comprising:
[0007] An embedding layer, a model layer, and an enhancement layer are pre-set, wherein the model layer includes: a plurality of preset named entity recognition models;
[0008] Obtain the traditional Chinese medicine corpus to be identified;
[0009] In the embedding layer, the traditional Chinese medicine corpus is converted into a plurality of character vectors, and the plurality of character vectors are input into the model layer;
[0010] At the model layer, the multiple character vectors are respectively input into the multiple named entity recognition models and the multiple joint models of the multiple named entity recognition models for processing, to generate processing results of the model layer, wherein the processing results of the model layer include: processing results of each named entity recognition model and processing results of each joint model;
[0011] At the enhancement layer, determining an optimal joint model according to the processing results of the model layer;
[0012] The final TCM named entity recognition result is determined based on the processing results of the model layer and the optimal joint model.
[0013] In one embodiment, converting the TCM corpus into a plurality of character vectors in the embedding layer includes:
[0014] Creating a character embedding dictionary matrix based on the traditional Chinese medicine corpus;
[0015] A character vector is generated for each character of the traditional Chinese medicine corpus according to the character embedding dictionary matrix.
[0016] In one embodiment, the multiple named entity recognition models include: a hidden Markov model, a conditional random field model, a long short-term memory artificial neural network model, and a bidirectional long short-term memory network and conditional random field combined model.
[0017] In one embodiment, at the model layer, inputting the multiple character vectors into the multiple named entity recognition models and the multiple joint models of the multiple named entity recognition models for processing, and generating the processing results of the model layer includes:
[0018] At the model layer, the plurality of character vectors are respectively input into each of the named entity recognition models, each of the named entity recognition models is used to perform named entity recognition processing, and a processing result of each of the named entity recognition models is obtained;
[0019] Combining the multiple named entity recognition models according to preset rules to generate multiple joint models;
[0020] The multiple character vectors are respectively input into each of the joint models, each of the joint models is used to perform named entity recognition processing, and a processing result of each of the joint models is obtained.
[0021] In one embodiment, determining the optimal joint model at the enhancement layer according to the processing result of the model layer includes:
[0022] Generating an F1 value of each named entity recognition model and an F1 value of each joint model according to the processing result of the model layer;
[0023] The optimal joint model is determined according to the F1 value.
[0024] In one embodiment, the method further comprises:
[0025] The optimal joint model is continuously optimized based on a continuous learning framework.
[0026] In one embodiment, determining the final TCM named entity recognition result based on the processing result of the model layer and the optimal joint model includes:
[0027] Determine whether the proportion of the number of models with the same processing results in the processing results of the model layer to the total number of models exceeds a preset value. If so, use the same processing result as the final TCM named entity recognition result. Otherwise, use the processing result of the optimal joint model as the final TCM named entity recognition result, wherein the total number of models is the sum of the number of preset multiple named entity recognition models and the number of all joint models.
[0028] In a second aspect, an embodiment of the present invention provides a device for identifying named entities in traditional Chinese medicine, the device comprising:
[0029] The acquisition module is used to obtain the traditional Chinese medicine corpus to be identified;
[0030] An embedding layer module, configured to convert the TCM corpus into a plurality of character vectors at a preset embedding layer, and input the plurality of character vectors into a preset model layer;
[0031] A model layer module, configured to input the plurality of character vectors into a plurality of named entity recognition models and a plurality of joint models of the plurality of named entity recognition models for processing at the model layer, and generate processing results of the model layer, wherein the model layer includes: a plurality of preset named entity recognition models, and the processing results of the model layer include: a processing result of each named entity recognition model and a processing result of each joint model;
[0032] An enhancement layer module, configured to determine, at the enhancement layer, an optimal joint model based on the processing results of the model layer;
[0033] The recognition module is used to determine the final TCM named entity recognition result based on the processing result of the model layer and the optimal joint model.
[0034] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for recognizing named entities in traditional Chinese medicine described in any one of the first aspects is implemented.
[0035] In a fourth aspect, an embodiment of the present invention provides a computer device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the method for recognizing named entities in traditional Chinese medicine as described in any one of the first aspects is implemented.
[0036] In an embodiment of the present invention, the TCM corpus is converted into character vectors in the embedding layer to facilitate processing by the model in the subsequent model layer. In the model layer, the character vectors are input into multiple named entity recognition models and multiple joint models for processing. In the enhancement layer, based on the processing results of the model layer, the optimal joint model is determined, and the final TCM named entity recognition results are determined based on the processing results of the model layer and the optimal joint model. In an embodiment of the present invention, multiple different named entity recognition models are combined into multiple joint models, and the joint model with the best recognition effect is found. According to the processing results of the model layer and the optimal joint model, TCM named entities can be more accurately identified. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 This is a flowchart of a method for identifying named entities in traditional Chinese medicine provided by one embodiment of the present invention;
[0039] Figure 2 1 is a schematic diagram of a device for recognizing named entities in traditional Chinese medicine provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions 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 part of the embodiments of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0041] like Figure 1 As shown, an embodiment of the present invention provides a method for identifying named entities in traditional Chinese medicine, which may include the following steps:
[0042] Step 101: pre-setting an embedding layer, a model layer, and an enhancement layer, wherein the model layer includes: a plurality of preset named entity recognition models;
[0043] Step 102: Obtaining the traditional Chinese medicine corpus to be identified;
[0044] Step 103: In the embedding layer, convert the TCM corpus into a plurality of character vectors, and input the plurality of character vectors into the model layer;
[0045] Step 104: at the model layer, inputting the plurality of character vectors into the plurality of named entity recognition models and the plurality of joint models of the plurality of named entity recognition models for processing, thereby generating a processing result of the model layer, wherein the processing result of the model layer includes a processing result of each named entity recognition model and a processing result of each joint model;
[0046] Step 105: At the enhancement layer, determine the optimal joint model according to the processing result of the model layer;
[0047] Step 106: Determine the final TCM named entity recognition result based on the processing result of the model layer and the optimal joint model.
[0048] In an embodiment of the present invention, the TCM corpus is converted into character vectors in the embedding layer to facilitate processing by the model in the subsequent model layer. In the model layer, the character vectors are input into multiple named entity recognition models and multiple joint models for processing. In the enhancement layer, based on the processing results of the model layer, the optimal joint model is determined, and the final TCM named entity recognition results are determined based on the processing results of the model layer and the optimal joint model. In an embodiment of the present invention, multiple different named entity recognition models are combined into multiple joint models, and the joint model with the best recognition effect is found. According to the processing results of the model layer and the optimal joint model, TCM named entities can be more accurately identified.
[0049] In one embodiment of the present invention, converting the TCM corpus into a plurality of character vectors in the embedding layer includes:
[0050] Creating a character embedding dictionary matrix based on the traditional Chinese medicine corpus;
[0051] A character vector is generated for each character of the traditional Chinese medicine corpus according to the character embedding dictionary matrix.
[0052] In an embodiment of the present invention, corpus vectorization is achieved by using character vectors. A character embedding dictionary matrix is created by analyzing the Traditional Chinese Medicine corpus. Each character corresponds to a character vector. Specifically, the character vector corresponding to each character is a column of the character embedding dictionary matrix. For example, the character vector for the i-th character is the i-th column of the character embedding dictionary matrix.
[0053] The character embedding dictionary matrix can be obtained by pre-training a mature character embedding model. The TCM corpus is input into the character embedding model, and the character embedding model outputs the character embedding dictionary matrix.
[0054] In one embodiment of the present invention, the multiple named entity recognition models include: hidden Markov model, conditional random field model, long short-term memory artificial neural network model, and bidirectional long short-term memory network and conditional random field combined model.
[0055] In this embodiment of the present invention, the model layer is a set of sequential labeling models. The hidden Markov model (HMM) can be used to solve complex problems. It converts the NER task into searching and comparing multiple parameters, and determines the best solution by searching and comparing each parameter. This method can be implemented by solving the value of the character vector, as shown in the following formula:
[0056]
[0057] Alternatively, we can simplify the above formula and use Veterbi's algorithm to find the optimal solution.
[0058] The conditional random field model (CRF) is characterized by simple operation and high efficiency. CRF is an undirected graph model that can be used to represent complex linear relationships, such as CRFs and HMM. This model can be used to represent complex matrices and can be used to represent the changes in complex matrices. Compared with HMM, CRFs emphasizes the change rules of matrices and can be used to describe the change trends of complex matrices. According to the rules of CRFs, it can be expressed as the following equation:
[0059]
[0060] in,
[0061]
[0062] Where, t k and s l is the characteristic function, λ k and μ lis the corresponding weight. Z(x) is the normalization factor, and the summation is performed over all possible output sequences. The NER algorithm transforms the original computational process into a more complex one, calculating the characteristic functions of each participant and their weights to determine the optimal result. This process is similar to the HMM algorithm, but the optimal result can be obtained by simplifying the method, namely, using the Veterbi algorithm.
[0063] LSTM is a unique RNN (Recurrent Neural Network) that effectively captures long-term sequence information and automatically forgets irrelevant information, providing effective support for NER tasks. Typically, an LSTM unit consists of a forget gate, an input gate, and an output gate, which respectively control the forgetting rate and the proportion of information passed to the next step.
[0064] The LSTM function is as follows:
[0065]
[0066]
[0067]
[0068] in, and Represents a set of input gates, forget gates, and output gates respectively. cΤ and b c are model parameters, and these values are the basis for building the sigmoid function.
[0069] Bidirectional LSTM input character vector Get a left-to-right hidden vector and a hidden vector from right to left The hidden vector representation of each character is as follows Finally, we get the The corresponding label sequence y.
[0070] The BiLSTM+CRF model combines a bidirectional long short-term memory network with a conditional random field (CRF) layer to improve prediction accuracy. This method effectively detects different labels and, through a structured approach, comprehensively analyzes the characteristics and behavioral features of these labels to obtain more accurate predictions. The presence of M in the BMEO tagging system means that it is not only a prerequisite for B but also affects other similar elements, such as E. Therefore, the CRF layer can transform this situation into a conditional probability, significantly improving computational efficiency. However, it also requires significant computing resources.
[0071] In the embodiment of the present invention, the models applied to the general corpus are not effective in applying to the traditional Chinese medicine corpus. The present invention continuously improves these models to obtain more accurate recognition results.
[0072] In one embodiment of the present invention, the step of inputting the plurality of character vectors into the plurality of named entity recognition models and the plurality of joint models of the plurality of named entity recognition models for processing, and generating a processing result of the model layer, at the model layer, includes:
[0073] At the model layer, the plurality of character vectors are respectively input into each of the named entity recognition models, each of the named entity recognition models is used to perform named entity recognition processing, and a processing result of each of the named entity recognition models is obtained;
[0074] Combining the multiple named entity recognition models according to preset rules to generate multiple joint models;
[0075] The multiple character vectors are respectively input into each of the joint models, each of the joint models is used to perform named entity recognition processing, and a processing result of each of the joint models is obtained.
[0076] In the embodiment of the present invention, the processing result may be a label of each character, that is, the result of recognizing the named entities of the traditional Chinese medicine corpus.
[0077] The preset rules can be combined in a random manner to achieve various possible combinations and obtain various possible joint models. In addition to selecting the named entity recognition model in the joint model, the preset rules can also specify the processing order of each named entity recognition model, the combined structure of the joint model, etc. For example, the hidden Markov model, conditional random field model, and long short-term memory artificial neural network model are processed in this order to obtain the first joint model. Alternatively, the hidden Markov model and conditional random field model can be processed in parallel, and the processing results of both are input into the long short-term memory artificial neural network model for processing to obtain the second joint model.
[0078] In one embodiment of the present invention, determining the optimal joint model at the enhancement layer according to the processing result of the model layer includes:
[0079] Generating an F1 value of each named entity recognition model and an F1 value of each joint model according to the processing result of the model layer;
[0080] The optimal joint model is determined according to the F1 value.
[0081] In the embodiment of the present invention, the joint model with the highest F1 value can be selected as the optimal joint model. The calculation formula of the F1 value is as follows:
[0082]
[0083] Among them, P is the precision of the model and R is the recall of the model.
[0084] In one embodiment of the present invention, the method further includes:
[0085] The optimal joint model is continuously optimized based on a continuous learning framework.
[0086] Determining the final TCM named entity recognition result based on the processing result of the model layer and the optimal joint model includes:
[0087] Determine whether the proportion of the number of models with the same processing results in the processing results of the model layer to the total number of models exceeds a preset value. If so, use the same processing result as the final TCM named entity recognition result. Otherwise, use the processing result of the optimal joint model as the final TCM named entity recognition result, wherein the total number of models is the sum of the number of preset multiple named entity recognition models and the number of all joint models.
[0088] In an embodiment of the present invention, the preset value is preferably greater than or equal to 50%, and can be 50%, 60%, 70%, 80%, 90%, etc. That is to say, if the same processing result is the majority, then the same processing result is selected as the final TCM named entity recognition result. The processing result contains more comprehensive features of the TCM corpus, and the recognition result is more accurate. Because the optimal joint model has the most accurate processing result among all models, when there is no such majority processing result, the processing result of the optimal joint model is used as the final TCM named entity recognition result. In this way, the accuracy of the recognition result can be guaranteed.
[0089] In this embodiment of the present invention, various models can be integrated into the enhancement layer to achieve continuous collection of language resources, deep learning, and more accurate prediction. Specifically, the present invention adopts multiple models to achieve better robustness of the NER model. In addition, a series of iterative strategies are adopted to ensure the accuracy of each step to achieve better prediction results.
[0090] In the enhancement layer, by organically integrating several models and achieving a consistent F1 score, the errors of individual models are effectively reduced while also significantly increasing their prediction efficiency. Therefore, the method provided by the present invention is highly flexible, requiring no external input and effectively integrating various models based on current language data.
[0091] In an embodiment of the present invention, the continuous learning framework is applied in NER, and a basic method is used to evaluate its effect in order to better observe the learning effect. Specifically, the data in the traditional Chinese medicine corpus is used to train the character vector in the embedding layer; in the model layer, multiple named entity recognition models are used, which take into account both probability and deep learning. Finally, the model is reinforced on the validation set to improve its performance. Through reinforcement learning, the greed index and the tolerance index are combined, and the optimal joint model is screened out by the F1 value. In order to improve the extrapolation performance of the model, the largest joint model is tried to be combined, but in this case, it is ensured that the F1 value does not exceed the preset tolerance index.
[0092] In an embodiment of the present invention, the processing effects of the optimal joint model continuously optimized in the continuous learning framework and multiple named entity recognition models are compared. The comparison results are shown in the following table.
[0093]
[0094] By combining statistical learning and deep learning techniques, we have developed a named entity recognition framework based on continuous learning. This framework effectively improves the accuracy of named entity recognition as the corpus gradually accumulates. This framework features a progressive and layered approach, providing more accurate recognition results based on the size of the corpus. Experiments with large-scale corpora have shown that the method's performance remains stable as the corpus expands, with good accuracy, regression rate, and F1 score.
[0095] like Figure 2 As shown, an embodiment of the present invention provides a device for recognizing named entities in traditional Chinese medicine, the device comprising:
[0096] An acquisition module 201 is used to acquire the TCM corpus to be identified;
[0097] Embedding layer module 202 is used to convert the TCM corpus into multiple character vectors at a preset embedding layer and input the multiple character vectors into a preset model layer. The conversion process is a one-to-one process, i.e., one character in the TCM corpus corresponds to one vector. This process essentially reduces the discrete semantic space in the corpus to a continuous high-dimensional vector space.
[0098] A model layer module 203 is configured to input the plurality of character vectors into a plurality of named entity recognition models and a plurality of joint models of the plurality of named entity recognition models for processing at the model layer, thereby generating a processing result of the model layer, wherein the model layer includes: a plurality of preset named entity recognition models, and the processing result of the model layer includes: a processing result of each named entity recognition model and a processing result of each joint model;
[0099] The enhancement layer module 204 is configured to determine the optimal joint model at the enhancement layer based on the processing results of the model layer through reinforcement learning, so as to always maintain a high-confidence recognition effect in a TCM corpus environment from zero corpus to a large-scale corpus;
[0100] The recognition module 205 is used to automatically extract corresponding named entities from the traditional Chinese medicine corpus end-to-end based on the processing results of the model layer and the optimal joint model, and determine the final traditional Chinese medicine named entity recognition results.
[0101] In one embodiment of the present invention, the embedded layer module is specifically used to:
[0102] Creating a character embedding dictionary matrix based on the traditional Chinese medicine corpus;
[0103] A character vector is generated for each character of the traditional Chinese medicine corpus according to the character embedding dictionary matrix.
[0104] In one embodiment of the present invention, the multiple named entity recognition models include: hidden Markov model, conditional random field model, long short-term memory artificial neural network model, and bidirectional long short-term memory network and conditional random field combined model.
[0105] In one embodiment of the present invention, the model layer module is specifically used to:
[0106] At the model layer, the plurality of character vectors are respectively input into each of the named entity recognition models, each of the named entity recognition models is used to perform named entity recognition processing, and a processing result of each of the named entity recognition models is obtained;
[0107] Combining the multiple named entity recognition models according to preset rules to generate multiple joint models;
[0108] The multiple character vectors are respectively input into each of the joint models, each of the joint models is used to perform named entity recognition processing, and a processing result of each of the joint models is obtained.
[0109] In one embodiment of the present invention, the enhancement layer module is specifically configured to:
[0110] Generating an F1 value of each named entity recognition model and an F1 value of each joint model according to the processing result of the model layer;
[0111] The optimal joint model is determined according to the F1 value.
[0112] In one embodiment of the present invention, the enhancement layer module is further configured to continuously optimize the optimal joint model based on a continuous learning framework.
[0113] In one embodiment of the present invention, the identification module is specifically configured to:
[0114] Determine whether the proportion of the number of models with the same processing results in the processing results of the model layer to the total number of models exceeds a preset value. If so, use the same processing result as the final TCM named entity recognition result. Otherwise, use the processing result of the optimal joint model as the final TCM named entity recognition result, wherein the total number of models is the sum of the number of preset multiple named entity recognition models and the number of all joint models.
[0115] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for recognizing named entities in traditional Chinese medicine described in any one of the embodiments of the present invention is implemented.
[0116] An embodiment of the present invention provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a method for recognizing named entities in traditional Chinese medicine as described in any one of the embodiments of the present invention is implemented.
[0117] The information interaction, execution process, etc. between the units in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For specific contents, please refer to the description in the embodiment of the method of the present invention and will not be repeated here.
[0118] Each embodiment of the present invention has at least the following beneficial effects:
[0119] 1. In an embodiment of the present invention, the TCM corpus is converted into character vectors in the embedding layer to facilitate processing by the model in the subsequent model layer. In the model layer, the character vectors are input into multiple named entity recognition models and multiple joint models for processing. In the enhancement layer, based on the processing results of the model layer, the optimal joint model is determined, and the final TCM named entity recognition results are determined based on the processing results of the model layer and the optimal joint model. In an embodiment of the present invention, multiple different named entity recognition models are combined into multiple joint models, and the joint model with the best recognition effect is found. According to the processing results of the model layer and the optimal joint model, TCM named entities can be more accurately identified.
[0120] 2. In an embodiment of the present invention, the preset value is preferably greater than or equal to 50%. If the same processing result is the majority, then the same processing result is selected as the final TCM named entity recognition result. This processing result contains more comprehensive features of the TCM corpus and the recognition result is more accurate. Because the optimal joint model has the most accurate processing result among all models, when there is no such majority processing result, the processing result of the optimal joint model is used as the final TCM named entity recognition result. In this way, the accuracy of the recognition result can be guaranteed.
[0121] It should be noted that, in this article, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a..." do not exclude the presence of other identical factors in the process, method, article or device comprising the elements.
[0122] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk, etc. Various media that can store program codes.
[0123] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is intended only to illustrate the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for identifying named entities in traditional Chinese medicine, characterized in that: The method includes: An embedding layer, a model layer and an enhancement layer are pre-set, wherein the model layer includes: a plurality of preset named entity recognition models; Obtain the traditional Chinese medicine corpus to be identified; In the embedding layer, the traditional Chinese medicine corpus is converted into a plurality of character vectors, and the plurality of character vectors are input into the model layer; At the model layer, the multiple character vectors are respectively input into the multiple named entity recognition models and the multiple joint models of the multiple named entity recognition models for processing, so as to generate a processing result of the model layer, wherein the processing result of the model layer includes: a processing result of each named entity recognition model and a processing result of each joint model; At the enhancement layer, determining an optimal joint model according to the processing result of the model layer; Determine the final TCM named entity recognition result according to the processing result of the model layer and the optimal joint model; In the embedding layer, the traditional Chinese medicine corpus is converted into a plurality of character vectors, including: Creating a character embedding dictionary matrix based on the traditional Chinese medicine corpus; Generating a character vector for each character of the traditional Chinese medicine corpus according to the character embedding dictionary matrix; The multiple named entity recognition models include: hidden Markov model, conditional random field model, long short-term memory artificial neural network model, bidirectional long short-term memory network and conditional random field combination model; The step of inputting the plurality of character vectors into the plurality of named entity recognition models and the plurality of joint models of the plurality of named entity recognition models for processing at the model layer to generate a processing result of the model layer includes: At the model layer, the plurality of character vectors are respectively input into each of the named entity recognition models, each of the named entity recognition models is used to perform named entity recognition processing, and a processing result of each of the named entity recognition models is obtained; Combining the multiple named entity recognition models according to preset rules to generate multiple joint models; Inputting the multiple character vectors into each of the joint models respectively, performing named entity recognition processing using each of the joint models, and obtaining processing results of each of the joint models; The step of determining, at the enhancement layer, an optimal joint model according to the processing result of the model layer includes: Generate an F1 value of each of the named entity recognition models and an F1 value of each of the joint models according to the processing result of the model layer; Determining an optimal joint model according to the F1 value; The method further includes: Continuously optimizing the optimal joint model based on a continuous learning framework; Determining the final TCM named entity recognition result according to the processing result of the model layer and the optimal joint model includes: Determine whether the proportion of the number of models with the same processing results in the processing results of the model layer to the total number of models exceeds a preset value. If so, use the same processing result as the final TCM named entity recognition result. Otherwise, use the processing result of the optimal joint model as the final TCM named entity recognition result, wherein the total number of models is the sum of the number of preset multiple named entity recognition models and the number of all joint models.
2. A device for identifying named entities in traditional Chinese medicine, characterized in that: The device includes: An acquisition module is used to acquire the traditional Chinese medicine corpus to be identified; An embedding layer module, used for converting the traditional Chinese medicine corpus into a plurality of character vectors at a preset embedding layer, and inputting the plurality of character vectors into a preset model layer; A model layer module, used for inputting the multiple character vectors into multiple named entity recognition models and multiple joint models of the multiple named entity recognition models for processing at the model layer, and generating a processing result of the model layer, wherein the model layer includes: multiple preset named entity recognition models, and the processing result of the model layer includes: a processing result of each named entity recognition model and a processing result of each joint model; An enhancement layer module, used to determine the optimal joint model at the enhancement layer according to the processing result of the model layer; A recognition module, used to determine the final TCM named entity recognition result according to the processing result of the model layer and the optimal joint model; The embedded layer module is specifically used for: Creating a character embedding dictionary matrix based on the traditional Chinese medicine corpus; Generating a character vector for each character of the traditional Chinese medicine corpus according to the character embedding dictionary matrix; The multiple named entity recognition models include: hidden Markov model, conditional random field model, long short-term memory artificial neural network model, bidirectional long short-term memory network and conditional random field combination model; The model layer module is specifically used for: At the model layer, the plurality of character vectors are respectively input into each of the named entity recognition models, each of the named entity recognition models is used to perform named entity recognition processing, and a processing result of each of the named entity recognition models is obtained; Combining the multiple named entity recognition models according to preset rules to generate multiple joint models; Inputting the multiple character vectors into each of the joint models respectively, performing named entity recognition processing using each of the joint models, and obtaining processing results of each of the joint models; The enhancement layer module is specifically used for: Generate an F1 value of each of the named entity recognition models and an F1 value of each of the joint models according to the processing result of the model layer; Determining an optimal joint model according to the F1 value; The enhancement layer module is also used to continuously optimize the optimal joint model based on a continuous learning framework; The identification module is specifically used for: Determine whether the proportion of the number of models with the same processing results in the processing results of the model layer to the total number of models exceeds a preset value. If so, use the same processing result as the final TCM named entity recognition result. Otherwise, use the processing result of the optimal joint model as the final TCM named entity recognition result, wherein the total number of models is the sum of the number of preset multiple named entity recognition models and the number of all joint models.
3. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for identifying named entities in traditional Chinese medicine according to claim 1 is implemented.
4. A computer device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for identifying named entities in traditional Chinese medicine as claimed in claim 1 when executing the computer program.
