Base named entity recognition system and method based on transfer learning
By using the transfer learning ALBERT model, BiGRU coding layer and CRF constraint layer in base named entity recognition, the problem of scarcity of base description text data is solved, the accuracy and generalization ability of named entity recognition are improved, and the problem of data scarcity is achieved. Efficient recognition effect under various circumstances.
Patent Information
- Application Number
- CN202111652819.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In the case of small base description text data, traditional deep learning models are difficult to effectively train, resulting in low accuracy and recall rates for named entity recognition, especially challenges that require fine-grained learning and generalization capabilities.
Adopt a method based on transfer learning, use the ALBERT model for pre-training, combine the BiGRU coding layer and the CRF constraint layer to generate fine-grained word vectors, perform forward and backward information learning on the base description text, and finally perform output constraints through the CRF model , to achieve named entity recognition.
When the amount of annotated data is small, the performance and accuracy of the model are improved, and base named entity recognition is performed quickly and accurately, breaking through the problem of low performance of traditional neural networks when annotated data is scarce.
Smart Images

Figure CN114356990B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing and transfer learning, and specifically refers to a base named entity recognition system and method based on transfer learning. Background Art
[0002] With the continuous rise of self-media, the amount of unstructured data described in natural language on the Internet is increasing, which contains a lot of information that can help machine decision-making. This information can be used for shopping recommendations, intelligent search, and decision-making assistance. In this era of user-driven content generation, most content is described in natural language. How to automatically organize and summarize the information in these contents and use them to assist machine decision-making requires targeted research and exploration.
[0003] Natural language processing is a technical means that uses computers to analyze and understand natural language, allowing machines to process unstructured data such as natural language. It is conducive to the extraction of actual semantic knowledge in unstructured data by machines and improves the ability of machines to acquire knowledge automatically and intelligently.
[0004] Knowledge graph is a powerful tool for organizing, managing and applying knowledge obtained from unstructured data. Named entity recognition is one of the key steps in building knowledge graph. In the process of building knowledge graphs for subdivided fields, the lack of labeled training data often occurs, and the same is true for base knowledge graphs.
[0005] Transfer learning is a technical means to solve the problem of poor performance of neural networks in the face of scarce training data. By using massive amounts of non-direct target data to conduct deep pre-training of neural networks, the neural network has massive amounts of data as background knowledge before using target data for training, ultimately improving the model's generalization ability under scarce data.
[0006] Typical named entity recognition methods include: methods that formulate production rules, methods based on machine classification algorithms, and methods based on deep learning. Studies have shown that compared with traditional named entity recognition methods, methods based on deep learning have better accuracy and recall, and are suitable for named entity recognition with large-scale training data. However, research on methods based on deep learning is mostly focused on named entity recognition in general fields, and there are still many challenges in base description recognition. On the one hand, base description data is relatively scarce compared to general fields, and the requirements for massive data required for deep learning to train neural networks are difficult to meet; on the other hand, base named entity recognition requires the subdivision of entity types, and there are many types of entities, which increases the complexity of named entity recognition. Therefore, base named entity recognition methods need to be improved and improved in reducing the required target training data, improving the model's fine-grained learning ability for description texts, and improving the model's generalization ability. Summary of the invention
[0007] The purpose of the present invention is to provide a base named entity recognition system and method based on transfer learning. The present invention is committed to solving the problem that there are few public base description text data, which is not convenient for traditional deep learning model training. By adding the ALBERT model pre-trained with massive additional data as the basic model, the fine-grained word vector of the description text is generated in the mode of transfer learning, and the BiGRU model is used as the encoding layer to learn the forward and backward information of the base description text. The CRF model is used to constrain the output to obtain the named entity recognition results that meet the requirements.
[0008] To achieve this purpose, the base named entity recognition method based on transfer learning designed by the present invention is characterized in that it includes the following steps:
[0009] Step 1: Obtain the natural language description corpus of the base from the Internet, and preprocess the natural language description corpus to remove the image description information and HTML tag information, and unify the units of the description attribute values;
[0010] Step 2: After preprocessing, the natural language description corpus is randomly divided into a test set, a validation set, and a training set. The natural language description corpus of the test set, the natural language description corpus of the validation set, and the natural language description corpus of the training set are annotated using the BIOES format to form a test set, a validation set, and a training set in the BIOES annotation format.
[0011] Step 3: Obtain the open-source transfer learning ALBERT model, and use the natural language description corpus of the base to update the open-source transfer learning ALBERT model using fine-tuning to obtain the updated transfer learning ALBERT layer;
[0012] Step 4: Use the updated transfer learning ALBERT layer, BiGRU encoding layer and CRF constraint layer to build a base named entity recognition model, and use the test set, validation set and training set in the BIOES annotation format as the training data set of the base named entity recognition model to train the base named entity recognition model. During the training process, use accuracy, recall rate and F1 value as training evaluation indicators, and obtain the trained base named entity recognition model through continuous iterative fitting;
[0013] Step 5: Use the trained base named entity recognition model to identify the sentence uploaded by the user and obtain the BIOES format annotation corresponding to the uploaded sentence.
[0014] Beneficial effects of the present invention:
[0015] The present invention makes full use of the ability of transfer learning to improve model performance when the amount of labeled data is small, and breaks through the problem of low performance of traditional neural network models when there is less labeled data. In the feature learning stage, the model's early demand for fine-grained characterization of word vectors is solved by using massive data to pre-train the model for self-supervision in advance. Then, the BiGRU model is used to encode the contextual features of the sentence, and the information of the sentence is learned from front to back and from back to front. Finally, constraints are added through the CRF layer, so that the overall model proposed by the present invention can quickly and accurately recognize the results of the base named entity. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Constructing a flow chart for the training data in the present invention;
[0017] Figure 2 This is a structural diagram of the base named entity recognition model in the present invention;
[0018] Figure 3 This is a structural diagram of the transfer learning (ALBERT) model in the present invention;
[0019] Figure 4 Schematic diagram of the ALBERT model SOP self-supervised pre-training process in the present invention;
[0020] Figure 5 It is a schematic diagram of the overall structure of the GRU model in the present invention;
[0021] Figure 6 It is the overall structure of the BiGRU model in the present invention;
[0022] Figure 7 This is a comparison chart of the model experiment results in the present invention;
[0023] Figure 8 It is a schematic diagram of the structure of the present invention.
[0024] Among them, 1—base corpus collection and preprocessing module, 2—machine learning dataset construction module, 3—transfer learning ALBERT layer update module, 4—base named entity recognition model training module, and 5—sentence recognition module. DETAILED DESCRIPTION
[0025] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0026] like Figures 1 to 7 The base named entity recognition method based on transfer learning is characterized in that it includes the following steps:
[0027] Step 1: Obtain the natural language description corpus of the base from the Internet, and preprocess the natural language description corpus to remove image description information and HTML (Hyper Text Markup Language) tag information, and unify the units of description attribute values;
[0028] Step 2: After preprocessing, the natural language description corpus is randomly divided into a test set, a validation set, and a training set. The natural language description corpus of the test set, the natural language description corpus of the validation set, and the natural language description corpus of the training set are annotated using the BIOES format annotation method and Doccano as the annotation tool to perform entity annotation on the natural language description corpus of the test set, the natural language description corpus of the validation set, and the natural language description corpus of the training set to form a test set, a validation set, and a training set in the BIOES annotation format. The test set, the validation set, and the training set are formed by a random division of 2:2:6.
[0029] Step 3: Obtain the open-source transfer learning ALBERT model, and use fine-tuning to update the open-source transfer learning ALBERT model using the natural language description corpus of the base to obtain the updated transfer learning ALBERT layer for obtaining fine-grained characterization word vectors;
[0030] Step 4: Use the updated transfer learning ALBERT layer (A Lite Bidirectional Encoder Representations from Transformers), BiGRU (Bidirectional Gated Recurrent Unit) encoding layer and CRF (Conditional Random Field) constraint layer to build a base named entity recognition model (programming language is Python, deep learning framework is PyTorch), use the test set, validation set and training set in BIOES annotation format as the training data set of the base named entity recognition model to train the base named entity recognition model. During the training process, use accuracy, recall rate and F1 value as training evaluation indicators, and obtain the trained base named entity recognition model through continuous iterative fitting;
[0031] Step 5: Use the trained base named entity recognition model to identify the sentence uploaded by the user and obtain the BIOES format annotation corresponding to the uploaded sentence.
[0032] In step 1 of the above technical solution, a Python-based crawler Selenium is used to crawl base press releases on public websites such as "Network A", "Network B", and "Network C" according to a list of base names to obtain an unprocessed collection of press releases; the contents of the unprocessed collection of press releases are manually screened, and the base name, base location, name of the area in charge of the base, name of the base's weapons and equipment, name of the base's stationed troops, name of the building facilities in the base, number of the building facilities in the base, location of each building facility in the base, and base evaluation are selected from the unprocessed collection of press releases, and press releases that are not related to the description of the studied base are eliminated;
[0033] Use Python-based crawler Selenium to crawl base description information from Wikipedia and / or Baidu Encyclopedia based on the base name list, so as to obtain the base name, base location, name of the base's responsible area, name of the base's weapons and equipment, name of the base's stationed troops, name of the building facilities in the base, number of the building facilities in the base, location of each building facility in the base, and base evaluation;
[0034] The natural language description corpus of the base is composed of information on the base's physical facilities, base location, base personnel, and base weapons and equipment obtained from press releases and Wikipedia and / or Baidu Encyclopedia.
[0035] In step 1 of the above technical solution, preprocessing the natural language description corpus includes data cleaning, data integration and annotated data format conversion;
[0036] The data cleaning method is to delete repeated text or large sections of empty text in the original data set, delete the information description content that originally belongs to the image, and remove HTML tag information that is not described in natural language, such as paragraph tags " ", hyperlink mark, etc.
[0037] The method of data integration is: first, entities with the same name but different meanings or entities with different names but the same meaning are marked as Alias synonyms for special treatment; second, unify units, such as the attribute values of military facilities; third, unify the data obtained from the two data sources, summarize and organize the labeled entity categories applicable to the two data sources, and reduce the possibility of sparse labeling over large areas.
[0038] The method of converting the annotation data format is as follows: the data corpus is annotated with the Doccano open source annotation tool, the data exported by the tool is in Json format, and the annotation data in Json format is converted into BIOES (Begin, Inside, Other, End, Single) tag format using Python programming language. After preprocessing, the natural language description corpus after preprocessing is obtained.
[0039] In step 2 of the above technical solution, the base description information of the natural language description corpus in the test set, validation set, and training set in the BIOES annotation format is annotated with base description categories according to preset base description categories that characterize the characteristics of the base, and the base description information is annotated by character sorting.
[0040] In step 3 of the above technical solution, the training set in the BIOES annotation format is used as a data sample for fitting the base named entity recognition model, the validation set in the BIOES annotation format is used to evaluate the current training status of the base named entity recognition model, and the test set in the BIOES annotation format is used to evaluate the generalization performance of the trained base named entity recognition model.
[0041] In step 5 of the above technical solution, the updated transfer learning ALBERT layer in the trained base named entity recognition model maps each character in the sentence uploaded by the user into a low-dimensional dense distributed character vector. A large amount of Chinese pre-trained corpus is used for transfer learning to make the distributed character vector more delicate.
[0042] The BiGRU encoding layer of the trained base named entity recognition model uses the BiGRU network to encode the distributed character vector output by the transfer learning ALBERT layer to form a multi-dimensional character vector;
[0043] The CRF decoding layer of the trained base named entity recognition model decodes the multi-dimensional character vector output by the BiGRU encoding layer, constrains it according to the implicit order relationship of the BIOES annotation format, calculates the label annotation order that meets the requirements, and obtains the BIOES format annotation corresponding to the uploaded sentence.
[0044] In step 4 of the above technical solution, the calculation formulas for precision P, recall R, and F1 value are:
[0045]
[0046]
[0047]
[0048] Among them, TP represents the number of correctly predicted entities, FN represents the number of entities predicted as negative examples, FP represents the number of entities predicted as positive examples, outPredictTrue represents the number of samples predicted as positive, outAllTrue represents the number of all positive samples in the sample, and the F1 value is the harmonic mean of the P value and the R value, which is used to balance the proportion of the two indicators.
[0049] Named entity recognition plays a fundamental role in the field of natural language processing. Its purpose is to identify predefined entity categories containing semantic information in natural language description texts. However, unlike traditional binary or multi-classification problems in similar image fields, named entity recognition in the field of natural language processing (NLP) requires not only constraints on the length of the sequence, but also constraints on the order of the sequence. For the problem of named entity recognition, the NLP field usually converts the problem into a sequence labeling classification problem for processing, that is, each element in the linear sequence is carefully classified according to the context content. In this way, the problem is converted into a classification problem, which can be evaluated using classification evaluation indicators in machine learning.
[0050] In step 5 of the above technical solution, the BIOES format corresponding to the uploaded statement is marked as Json format, and the Json file is parsed using the loads function of the Json module in the Python programming language, and the entity string and entity type predicted by the trained base named entity recognition model are displayed on the Web front end.
[0051] In the above technical solution, the BiGRU encoding layer is composed of the GRU models of the forward and backward directions of the entity (base description name). A GRU unit includes a reset gate and an update gate. The detailed calculation formula is as follows:
[0052] z (t) =σ(W (z) x (t) +U (z) h (t-1) ) (4)
[0053] r (t) =σ(W (r) x (t) +U (r) h (t-1) ) (5)
[0054]
[0055]
[0056] Among them, σ represents the activation function Sigmoid, which is used to compress the function value to the interval (0,1), z represents the update gate, r represents the reset gate, t represents the unit time, * represents the Hadamard product, that is, the corresponding elements in the matrix are multiplied, and tanh represents the tan activation function, which is used to compress the function value to the interval (-1,1);
[0057] z (t) represents the output of gate z updated at time t, W (z) Represents the weight matrix of the input vector x of update gate z at time t, U (z) represents the weight matrix of the hidden layer vector h of the update gate z at time t, h (t-1) represents the hidden layer vector at time t-1, r (t) represents the output of the reset gate r at time t, W (r) Represents the weight matrix of the input vector x of reset gate r at time t, U (r) Represents the weight matrix of the hidden layer vector h of reset gate r at time t, represents the candidate hidden state at time t, h (t) represents the hidden state at time t.
[0058] Distributed character vector x (t) Forward input into the above formula 4 to obtain the output of the entity forward GRU at time t That is, h in formula 7 (t) The forward GRU corresponding result of the distributed character vector x (t) Input the reverse input into Formula 4 to obtain the output of the entity backward GRU at time t That is, h in formula 7 (t) The corresponding result of the backward GRU;
[0059] Then the outputs of the forward and reverse hidden state layers at the same position are concatenated to obtain the BiGRU output h at time t t ,Right now:
[0060]
[0061] In the above technical solution, the decoding method of the CRF decoding layer is:
[0062] The BiGRU output h at time t t Substitute the following formula and calculate the score matrix of each input value at each position according to formula (9); then, use the maximum likelihood estimation in formula (10) to obtain the likelihood function, and use the Softmax function in formula (11) to calculate the likelihood of the standardized sequence y; finally, use the Viterbi algorithm to extract the label sequence with the highest score, which is the BIOES format label corresponding to the uploaded sentence;
[0063]
[0064]
[0065]
[0066]
[0067] in, Represents the transfer score matrix annotated in BIOES format. The transfer score represents the probability of the combination of the current position character and the character at its adjacent position. The transfer score matrix is randomly initialized at the beginning, and the final score is obtained according to the continuous back-propagation learning of the neural network. Represents the emission score matrix, which refers to the predicted output h obtained by the BiGRU layer t ; S(h,y) represents the score of the order of adjacent characters, N represents the total number of characters in the training sentence, and i represents the iterated letter; P(y|h) represents the probability of the actual character label sequence to the predicted character label sequence, P(y i |h i ) means to substitute yi into y, h in formula 11 i Substitute h and h into Formula 11 i represents the character at position i in vector h, h represents the output of BiGRU, λ represents the coefficient of the parameter in the likelihood function, L represents the likelihood function; θ represents the parameter distribution to be estimated, that is, the parameter value of the CRF model, and Y(h) represents the set of all possible BIOES format annotated sequences; y * represents the BIOES format annotation sequence with the highest probability, S(h,y') means that y' is used to replace y in Formula 9, y' represents a subset of Y(h), Y(h) represents the set of all possible BIOES annotation sequences, e represents a natural constant in mathematics, Indicates the CRF model parameter value with the highest probability among all possible BIOES annotated sequence sets.
[0068] A base named entity recognition system based on transfer learning, such as Figure 8 As shown, it includes a base corpus collection and preprocessing module 1, a machine learning data set construction module 2, a transfer learning ALBERT layer update module 3, a base named entity recognition model training module 4 and a sentence recognition module 5;
[0069] The base corpus collection and preprocessing module 1 is used to obtain the natural language description corpus of the base from the Internet, and preprocess the natural language description corpus to remove the image description information and HTML tag information, and unify the units of the description attribute values;
[0070] The machine learning data set construction module 2 is used to randomly divide the natural language description corpus after preprocessing into a test set, a validation set and a training set, and use the BIOES format annotation method to perform entity annotation on the natural language description corpus of the test set, the natural language description corpus of the validation set and the natural language description corpus of the training set to form a test set, a validation set and a training set in the BIOES annotation format;
[0071] The transfer learning ALBERT layer update module 3 is used to obtain the open source transfer learning ALBERT model, and update the open source transfer learning ALBERT model by fine-tuning the natural language description corpus of the base to obtain the updated transfer learning ALBERT layer;
[0072] The base named entity recognition model training module 4 is used to construct a base named entity recognition model using the updated transfer learning ALBERT layer, BiGRU encoding layer and CRF constraint layer, and use the test set, validation set and training set in the BIOES annotation format as the training data set of the base named entity recognition model to train the base named entity recognition model. During the training process, the accuracy, recall rate and F1 value are used as training evaluation indicators, and the trained base named entity recognition model is obtained through continuous iterative fitting;
[0073] The sentence recognition module 5 is used to use the trained base named entity recognition model to recognize the sentences uploaded by the user and obtain the BIOES format annotations corresponding to the uploaded sentences.
[0074] According to the predefined named entity types describing military bases, Doccano is used as an annotation tool to annotate the preprocessed data. After annotation, a Json file of the description is generated and then converted into the most common BIOES method (Begin-inside-other-end-single).
[0075] The annotation process of the base named entity training data combines the characteristics of the natural language description text of the base, removes some entity types with small numbers in the corpus, and focuses on identifying eleven types of military base description entities that characterize the characteristics of the base, including base name (BaseName), base location (BasePlace), time (Time), responsible area (ResponsibleArea), base weapons and equipment (Weaponry), garrison troops (GarrisonTroops), base facilities (BaseFacilities), facility number (BaseFacilitiesId), facility attributes (BaseFacilitiesPro), facility location (BaseFacilitiesPlace), and base evaluation (BaseEvaluate).
[0076] According to the predefined eleven types of named entities describing the base, Doccano (an open source visual named entity annotation tool) is used to annotate the preprocessed data. After annotation, a Json file of the description is generated, which is then converted into the most common BIOES method (Begin-inside-other-end-single), where B represents the first character of the entity describing the base, I represents the internal character of the entity describing the base, O represents other characters, E represents the last character of the entity describing the base, and S represents an entity composed of a single character. After manual fine-grained entity annotation, each independent character in the base corpus is marked with a corresponding classification label to obtain a training data set.
[0077] Figure 3 The structure diagram of the base named entity recognition model proposed in the present invention is described. The model mainly includes a transfer learning (ALBERT) layer, a BiGRU encoding layer, a CRF constraint layer, and finally outputs the recognition result.
[0078] Figure 4 The example illustrates the process of generating word vectors using the ALBERT model. First, a large amount of Chinese pre-trained corpus is used for self-supervised learning to obtain a trained ALBERT model. Then, the sentence is input into the model to obtain a word vector that describes the characteristics of the word in detail.
[0079] Figure 4 The example illustrates the process of generating word vectors using the ALBERT model. The ALBERT model is based on the BERT model proposed by Google. As a pre-training model, the BERT model has brought a milestone change to NLP. Compared with the BERT model, ALBERT uses a matrix decomposition method to reduce the number of parameters. The method is to introduce a low-dimensional vector space E, and change the original direct mapping of the vocabulary vector V and the hidden layer vector H to an indirect mapping. O represents the parameter magnitude.
[0080]
[0081] ALBERT innovatively proposed the SOP (Sentence Order Prediction) pre-training strategy to replace the NSP (Next Sentence Prediction) strategy. The original NSP strategy replaces the second sentence of the previous and next sentences in a corpus at a certain ratio as training data for self-supervised learning, but researchers from XLNET and RoBERTa found that the NSP training strategy constrained the performance of the pre-training model, so they adopted the SOP strategy as the pre-training strategy for ALBERT, using two consecutive fragments in a document as positive samples and swapping the order of the two fragments as negative samples.
[0082] Figure 5 The process of the SOP pre-training strategy of the ALBERT model is shown in the figure. The NSP pre-training strategy may cause the final model to judge whether the two sentences are from the same topic. The SOP strategy avoids this problem and allows the model to judge the order of two sentences with the same topic. The original order of the two sentences in the pre-training corpus is a positive example, and the reversed order is a negative example.
[0083] Figure 6 The structure diagram of the GRU model is shown in Figure 1, where σ represents the activation function Sigmoid, which is used to compress the function value to the interval (0,1), z represents the update gate, r represents the reset gate, the subscript t represents the unit time, and tanh represents the tan activation function, which is used to compress the function value to the interval (-1,1). represents the candidate hidden state at time t, h (t) represents the hidden state at time t.
[0084] Figure 7 The structure diagram of the BiGRU model is shown in the figure. The BiGRU model consists of two parts: one is a GRU model that encodes from front to back; the other is a GRU model that encodes from back to front. The two GRU models are combined to encode the distributed character vector output by the transfer learning ALBERT layer to form a multi-dimensional character vector.
[0085] Figure 8 The experimental results of comparative experiments using 7 models (HMM (Hidden Markov Model), CRF (Conditional Random Field), BiLSTM (Bi-directional Long Short Term Memory), BiLSTM-CRF (Long Short Term Memory-Conditional Random Field), BiGRU-CRF (Bi-directional Gated Recurrent Unit), ALBERT-BiLSTM-CRF (A Lite Bidirectional Encoder Representations from Transformers-Bi-directional Long Short Term Memory-Conditional Random Field)) are shown. The experimental results show that the base named entity recognition model proposed in the present invention is better than the comparative model, and achieves better performance of named entity recognition under the conditions of less human intervention and scarce training data. The model described in the present invention achieves good results in the base named entity recognition task and provides technical support for the subsequent automatic construction of knowledge graphs.
[0086] Based on the base named entity recognition model in the present invention, a prototype system for function display is constructed. The text to be recognized is input into the system interaction box, and the pre-trained base named entity recognition model is called. After being processed by the model, the prediction result of named entity recognition can be obtained.
[0087] Using the model described in the present invention, a named entity recognition module is implemented. The Web interactive interface is developed using Python language combined with the Django framework. The specific operation is divided into two stages: one is the input of text sentences and the submission of Request to the background processing, and the other is the visualization of the prediction results. The obtained entity prediction results can be used as the input of the subsequent relationship extraction module.
[0088] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.
Claims
1. A base named entity recognition method based on transfer learning, Features: It includes the following steps: Step 1: Obtain the natural language description corpus of the base from the Internet, and preprocess the natural language description corpus to remove the image description information and HTML tag information, and unify the units of the description attribute values; Step 2: After preprocessing, the natural language description corpus is randomly divided into a test set, a validation set, and a training set. The natural language description corpus of the test set, the natural language description corpus of the validation set, and the natural language description corpus of the training set are annotated using the BIOES format to form a test set, a validation set, and a training set in the BIOES annotation format. Step 3: Obtain the open-source transfer learning ALBERT model, and use the natural language description corpus of the base to update the open-source transfer learning ALBERT model using fine-tuning to obtain the updated transfer learning ALBERT layer; Step 4: Use the updated transfer learning ALBERT layer, BiGRU encoding layer and CRF constraint layer to build a base named entity recognition model, and use the test set, validation set and training set in the BIOES annotation format as the training data set of the base named entity recognition model to train the base named entity recognition model. During the training process, use accuracy, recall rate and F1 value as training evaluation indicators, and obtain the trained base named entity recognition model through continuous iterative fitting; Step 5: Use the trained base named entity recognition model to identify the sentence uploaded by the user and obtain the BIOES format annotation corresponding to the uploaded sentence; In step 5, the updated transfer learning ALBERT layer in the trained base named entity recognition model maps each character in the sentence uploaded by the user into a distributed character vector; The BiGRU encoding layer of the trained base named entity recognition model uses the BiGRU network to encode the distributed character vector output by the transfer learning ALBERT layer to form a multi-dimensional character vector; The CRF decoding layer of the trained base named entity recognition model decodes the multi-dimensional character vector output by the BiGRU encoding layer, constrains it according to the implicit order relationship of the BIOES annotation format, calculates the label annotation order that meets the requirements, and obtains the BIOES format annotation corresponding to the uploaded sentence.
2. According to the base named entity recognition system based on transfer learning in claim 1, Features: In the step 1, a Python-based crawler Selenium is used to crawl press releases according to the base name list to obtain an unprocessed collection of press releases; the content of the unprocessed collection of press releases is screened, and the base name, base location, name of the area in charge of the base, name of the base's weapons and equipment, name of the base's stationed troops, name of the building facilities in the base, number of the building facilities in the base, location of each building facility in the base, and base evaluation are selected from the unprocessed collection of press releases; Use Python-based crawler Selenium to crawl base description information from Wikipedia and / or Baidu Encyclopedia based on the base name list, so as to obtain the base name, base location, name of the base's responsible area, name of the base's weapons and equipment, name of the base's stationed troops, name of the building facilities in the base, number of the building facilities in the base, location of each building facility in the base, and base evaluation; The natural language description corpus of the base is composed of information on the base's physical facilities, base location, base personnel, and base weapons and equipment obtained from press releases and Wikipedia and / or Baidu Encyclopedia.
3. The base named entity recognition system based on transfer learning according to claim 1, Features: In the step 2, the base description information of the natural language description corpus in the test set, validation set, and training set in the BIOES annotation format is annotated with base description categories according to preset base description categories that characterize the characteristics of the base, and the base description information is annotated by character sorting.
4. The base named entity recognition system based on transfer learning according to claim 1, Features: In step 3, the training set in the BIOES annotation format is used as a data sample for fitting the base named entity recognition model, the validation set in the BIOES annotation format is used to evaluate the current training status of the base named entity recognition model, and the test set in the BIOES annotation format is used to evaluate the generalization performance of the trained base named entity recognition model.
5. The base named entity recognition system based on transfer learning according to claim 1, Features: In step 4, the calculation formulas for precision P, recall R, and F1 value are: Among them, TP represents the number of correctly predicted entities, FN represents the number of entities predicted as negative examples, FP represents the number of entities predicted as positive examples, outPredictTrue represents the number of samples predicted as positive, outAllTrue represents the number of all positive samples in the sample, and the F1 value is the harmonic mean of the P value and the R value, which is used to balance the proportion of the two indicators.
6. The base named entity recognition system based on transfer learning according to claim 1, Features: In step 5, the BIOES format corresponding to the uploaded statement is marked as Json format, and the Json file is parsed using the loads function of the Json module in the Python programming language, and the entity string and entity type predicted by the trained base named entity recognition model are displayed on the Web front end.
7. The base named entity recognition system based on transfer learning according to claim 1, Features: The BiGRU encoding layer is composed of GRU models in both the forward and backward directions. A GRU unit includes a reset gate and an update gate. The detailed calculation formula is as follows: z (t) =σ(W (z) x (t) +U (z) h (t-1) ) (4) r (t) =σ(W (r) x (t) +U (r) h (t-1) ) (5) Among them, σ represents the activation function Sigmoid, which is used to compress the function value to the interval (0,1), z represents the update gate, r represents the reset gate, t represents the unit time, * represents the Hadamard product, that is, the corresponding elements in the matrix are multiplied, and tanh represents the tan activation function, which is used to compress the function value to the interval (-1,1); z (t) represents the output of gate z updated at time t, W (z) Represents the weight matrix of the input vector x of update gate z at time t, U (z) represents the weight matrix of the hidden layer vector h of the update gate z at time t, h (t-1) represents the hidden layer vector at time t-1, r (t) represents the output of the reset gate r at time t, W (r) Represents the weight matrix of the input vector x of reset gate r at time t, U (r) Represents the weight matrix of the hidden layer vector h of reset gate r at time t, represents the candidate hidden state at time t, h (t) represents the hidden state at time t; Distributed character vector x (t) Forward input into the above formula 4 to obtain the output of the entity forward GRU at time t Then the distributed character vector x (t) Input the reverse input into Formula 4 to obtain the output of the entity backward GRU at time t Then the outputs of the forward and reverse hidden state layers at the same position are concatenated to obtain the BiGRU output h at time t t ,Right now:
8. The base named entity recognition system based on transfer learning according to claim 1, Features: The decoding method of the CRF decoding layer is: The BiGRU output h at time t t Substitute the following formula and calculate the score matrix of each input value at each position according to formula (9); then, use the maximum likelihood estimation to obtain the likelihood function in formula (10), and use the Softmax function in formula (11) to calculate the likelihood of the standardized sequence y; finally, use the Viterbi algorithm to extract the label sequence with the highest score, which is the BIOES format label corresponding to the uploaded sentence; in, Represents the transfer score matrix annotated in BIOES format. The transfer score represents the probability of the combination of the current position character and the character at its adjacent position. The transfer score matrix is randomly initialized at the beginning, and the final score is obtained according to the continuous back-propagation learning of the neural network. Represents the emission score matrix, which refers to the predicted output h obtained by the BiGRU layer t ; S(h,y) represents the score of the order of adjacent characters, N represents the total number of characters in the training sentence, and i represents the iterated letter; P(y|h) represents the probability of the actual character label sequence to the predicted character label sequence, P(y i |h i ) means to substitute yi into y in formula 11, hi into h, h i represents the character at position i in vector h, h represents the output of BiGRU, λ represents the coefficient of the parameter in the likelihood function, L represents the likelihood function; θ represents the parameter distribution to be estimated, that is, the parameter value of the CRF model, and Y(h) represents the set of all possible BIOES format annotated sequences; y * represents the BIOES format annotation sequence with the highest probability, S(h,y') means that y' is used to replace y in Formula 9, y' represents a subset of Y(h), Y(h) represents the set of all possible BIOES annotation sequences, e represents a natural constant in mathematics, Indicates the CRF model parameter value with the highest probability among all possible BIOES annotated sequence sets.
9. A base named entity recognition system based on transfer learning, Features: It includes a base corpus collection and preprocessing module (1), a machine learning data set construction module (2), a transfer learning ALBERT layer update module (3), a base named entity recognition model training module (4) and a sentence recognition module (5); The base corpus collection and preprocessing module (1) is used to obtain the natural language description corpus of the base from the Internet, and preprocess the natural language description corpus to remove the image description information and HTML tag information, and unify the units of the description attribute values; The machine learning data set construction module (2) is used to randomly divide the natural language description corpus after preprocessing into a test set, a validation set and a training set, and use the BIOES format annotation method to perform entity annotation on the natural language description corpus of the test set, the natural language description corpus of the validation set and the natural language description corpus of the training set to form a test set, a validation set and a training set in the BIOES annotation format; The transfer learning ALBERT layer update module (3) is used to obtain the open source transfer learning ALBERT model, and update the open source transfer learning ALBERT model by fine-tuning the natural language description corpus of the base to obtain the updated transfer learning ALBERT layer; The base named entity recognition model training module (4) is used to construct a base named entity recognition model using the updated transfer learning ALBERT layer, BiGRU encoding layer and CRF constraint layer, and use the test set, validation set and training set in the BIOES annotation format as the training data set of the base named entity recognition model to train the base named entity recognition model. During the training process, the accuracy, recall rate and F1 value are used as training evaluation indicators, and the trained base named entity recognition model is obtained through continuous iterative fitting; The sentence recognition module (5) is used to use the trained base named entity recognition model to recognize the sentence uploaded by the user and obtain the BIOES format annotation corresponding to the uploaded sentence; The updated transfer learning ALBERT layer in the trained base named entity recognition model maps each character in the sentence uploaded by the user into a distributed character vector; The BiGRU encoding layer of the trained base named entity recognition model uses the BiGRU network to encode the distributed character vector output by the transfer learning ALBERT layer to form a multi-dimensional character vector; The CRF decoding layer of the trained base named entity recognition model decodes the multi-dimensional character vector output by the BiGRU encoding layer, constrains it according to the implicit order relationship of the BIOES annotation format, calculates the label annotation order that meets the requirements, and obtains the BIOES format annotation corresponding to the uploaded sentence.
