A model training method and device for named entity recognition

By adopting federated learning of PySyft architecture in named entity recognition in the medical field, the problem of traditional model recognition errors and data islands is solved, high-quality model training and fair cooperation are achieved, and data security and privacy protection are ensured.

CN114548094BActive Publication Date: 2024-09-10ENNEW DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011360724.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-27
Publication Date
2024-09-10
Estimated Expiration
2040-11-27

AI Technical Summary

Technical Problem

In named entity recognition in the medical field, traditional models are prone to recognition errors due to the influence of limited historical assumptions or normalization functions, and the data island problem makes data sharing difficult, affecting model quality and cooperation fairness.

Method used

Federated learning is introduced using the PySyft architecture, and the classic named entity recognition deep model is used to exchange information and model parameters through encryption to ensure model quality and independence and achieve fair cooperation.

Benefits of technology

Ensure model quality is intact, avoid negative migration, improve federated model independence and cooperation fairness, and meet data privacy protection and security requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114548094B
    Figure CN114548094B
Patent Text Reader

Abstract

The present invention discloses a model training method, device, readable storage medium and computing device for named entity recognition, the method comprising: sending selected hyperparameters to each client so that each client updates the hyperparameters; initializing the recognition model to obtain the current recognition model; sending the current recognition model to each client; receiving the trained recognition model sent by each client, the trained recognition model is obtained by the current recognition model after training according to local data; aggregating each of the trained recognition models based on a joint learning algorithm to obtain a recognition joint model; and training the recognition joint model again after taking the recognition joint model as the current recognition model until the recognition joint model meets the preset requirements. The present invention introduces federated learning and adopts a classic named entity recognition deep model to perform keyword entity recognition for electronic medical examinations, thereby providing a basis for more medical projects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things, and in particular to a model training method, device, readable storage medium and computing equipment for named entity recognition. Background Art

[0002] In the medical field, the structuring of Chinese medical examination reports is the basis for computers to understand and apply medical records. Based on the structuring of medical examination reports, the relationship and probability between multiple knowledge points such as symptoms, diseases, drugs, examinations and tests can be calculated to build a knowledge graph in the medical field and further optimize the work of doctors. As we all know, medical examination cases are private data, and various medical examination institutions are not willing to share medical examination data with other institutions, so there is also the problem of data islands.

[0003] For named entity recognition tasks, traditional or evolved models such as HMM and CRF can be used for recognition. However, when using such models for recognition, they are very likely to make mistakes due to the limited history assumption or normalization function. The traditional approach is to segment the text, annotate the words with roles, select the largest possible annotation sequence, and then combine the annotated roles according to a certain pattern library to identify the final entity. Summary of the invention

[0004] The present invention aims to solve at least one of the above technical problems to at least some extent.

[0005] To this end, the first purpose of the present invention is to propose a model training method for named entity recognition, introduce federated learning based on the PySyft architecture, and use the classic named entity recognition deep model to identify keyword entities for electronic medical examinations, thereby providing a basis for more medical projects. It can ensure that the model quality is lossless, there will be no negative transfer, and the federated model is better than the fragmented independent model; in federated learning, the participants have equal status and can achieve fair cooperation; in addition, it can ensure that all parties involved can exchange information and model parameters in an encrypted manner while maintaining independence, and grow at the same time.

[0006] The second purpose of the present invention is to propose a model training device for named entity recognition, which introduces federated learning based on the PySyft architecture, adopts a classic named entity recognition deep model, and recognizes keyword entities for electronic medical examinations, thereby providing a basis for more medical projects. It can ensure that the model quality is intact, there will be no negative transfer, and the federated model is better than the fragmented independent model; in federated learning, the participants have equal status and can achieve fair cooperation; in addition, it can ensure that all parties involved can exchange information and model parameters in an encrypted manner while maintaining independence, and grow at the same time.

[0007] A third object of the present invention is to provide a readable storage medium.

[0008] A fourth object of the present invention is to provide a computing device.

[0009] In a first aspect, an embodiment of the present invention provides a model training method for named entity recognition, the method comprising:

[0010] S1: Sending the selected hyperparameters to each client so that each client updates the hyperparameters; the hyperparameters at least include a sample dictionary and a label dictionary;

[0011] S2: Initialize the recognition model and obtain the current recognition model;

[0012] S3: sending the current recognition model to each of the clients, so that each of the clients trains the current recognition model according to local data;

[0013] S4: receiving a trained recognition model sent by each client, where the trained recognition model is obtained by training the current recognition model according to local data;

[0014] S5: Aggregating the trained recognition models based on a joint learning algorithm to obtain a joint recognition model;

[0015] S6: Execute S3 after taking the recognition joint model as the current recognition model until the recognition joint model meets preset requirements, wherein the preset requirements include preset accuracy and / or the number of training times of each client.

[0016] Optionally, step S2 includes:

[0017] Define recognition model and loss function;

[0018] Various training parameters of the recognition model are set; the training parameters include at least: batch size, learning rate and optimizer.

[0019] Optionally, the recognition model is a bidirectional recurrent neural network model, which includes a Bi-LSTM layer, in which each training sequence in the Bi-LSTM layer is respectively two recurrent neural networks in forward pass and backward pass, and the two recurrent neural networks are connected to an output layer; the forward pass layer obtains the context information of each point in the input sequence, and the backward pass layer obtains the context information of each point in the input sequence; the hidden layer states of the forward pass layer and the backward pass layer are merged and used as the input of the CRF layer.

[0020] Optionally, the hidden layer neurons of the Bi-LSTM layer are protected and cell states are controlled by input gates, forget gates and output gates; the input gates, forget gates and output gates have the ability to delete or add information to the cell states.

[0021] Optionally, the neuron at time step t is a d-dimensional space vector set R d , the input gate, the forget gate and the output gate are i at time t respectively t 、f t , o t ,i t、 f t , o t The value range is [0, 1], so the output value calculation formula of the neuron is:

[0022] i t =δ(W (i) x t +U (i) h t-1 +b (i) )

[0023] f t =δ(W (f) x t +U (f) h t-1 +b (f) )

[0024] o t =δ(W (o) x t +U (o) h t-1 +b (o) )

[0025] u t =tanh(W (u) x t +U (u) h t-1 +b (u) )

[0026]

[0027]

[0028] Among them, x t represents the input value at time step t, δ represents the logistic sigmoid activation function, represents element-wise multiplication, h t Represents the output value of the neuron at time step t.

[0029] Optionally, a CRF layer is used to model the label sequence; the CRF layer is used for a given sequence X (x1, x2, x3, ..., x n ) and the corresponding label sequence Y(y1, y2, y3, ..., y n ), the evaluation score is:

[0030]

[0031] Where W is the transformation matrix, The yth character of character i i The score of the labels, Indicates the yth i The label transfer score;

[0032] The training of the CRF layer uses the maximum conditional likelihood estimation, and the training set {(X i , Y i )}, the estimated likelihood function of the maximum conditional likelihood is:

[0033]

[0034] The calculation formula of P is:

[0035]

[0036] Optionally, step S5 aggregates the trained recognition models based on a joint learning algorithm to obtain a joint recognition model, including:

[0037] Performing weighted averaging on the training parameters of each of the trained recognition models to obtain a joint parameter;

[0038] The training parameters of the recognition model are updated with the joint parameters to obtain the recognition joint model.

[0039] In a second aspect, an embodiment of the present invention provides a model training device for named entity recognition, the device comprising: a hyperparameter sending module, a model initialization module, a model sending module, a model receiving module, a model joint module and a training termination module, wherein:

[0040] The hyperparameter sending module is used to send the selected hyperparameters to each client so that each client updates the hyperparameters; the hyperparameters include at least a sample dictionary and a label dictionary;

[0041] The model initialization module is used to initialize the recognition model and obtain the current recognition model;

[0042] The model sending module is used to send the current recognition model to each client, so that each client can train the current recognition model according to local data;

[0043] The model receiving module is used to receive the trained recognition model sent by each client, where the trained recognition model is obtained by training the current recognition model according to local data;

[0044] The model combination module is used to aggregate the trained recognition models based on a joint learning algorithm to obtain a recognition joint model;

[0045] The training termination module is used to trigger the model sending module after taking the recognition joint model as the current recognition model until the recognition joint model meets preset requirements, and the preset requirements include preset accuracy and / or the number of training times of each client.

[0046] Optionally, the model initialization module includes a model definition unit and a parameter setting module, wherein:

[0047] The model definition unit is used to define the recognition model and the loss function;

[0048] The parameter setting module is used to set various training parameters of the recognition model; the training parameters include at least: batch size, learning rate and optimizer.

[0049] Optionally, the recognition model is a bidirectional recurrent neural network model, which includes a Bi-LSTM layer, in which each training sequence in the Bi-LSTM layer is respectively two recurrent neural networks in forward pass and backward pass, and the two recurrent neural networks are connected to an output layer; the forward pass layer obtains the context information of each point in the input sequence, and the backward pass layer obtains the context information of each point in the input sequence; the hidden layer states of the forward pass layer and the backward pass layer are merged and used as the input of the CRF layer.

[0050] Optionally, the hidden layer neurons of the Bi-LSTM layer are protected and cell states are controlled by input gates, forget gates and output gates; the input gates, forget gates and output gates have the ability to delete or add information to the cell states.

[0051] Optionally, the neuron at time step t is a d-dimensional space vector set R d , the input gate, the forget gate and the output gate are i at time t respectively t 、f t , o t ,i t、 f t , ot The value range is [0, 1], so the output value calculation formula of the neuron is:

[0052] i t =δ(W (i) x t +U (i) h t-1 +b (i) )

[0053] f t =δ(W (f) x t +U (f) h t-1 +b (f) )

[0054] o t =δ(W (o) x t +U (o) h t-1 +b (o) )

[0055] u t =tanh(W (u) x t +U (u) h t-1 +b (u) )

[0056]

[0057]

[0058] Among them, x t represents the input value at time step t, δ represents the logistic sigmoid activation function, represents element-wise multiplication, h t Represents the output value of the neuron at time step t.

[0059] Optionally, a CRF layer is used to model the label sequence; the CRF layer is used for a given sequence X (x1, x2, x3, ..., x n ) and the corresponding label sequence Y(y1, y2, y3, ..., y n ), the evaluation score is:

[0060]

[0061] Where W is the transformation matrix, The yth character of character i i The score of the labels, Indicates the yth i The label transfer score;

[0062] The training of the CRF layer uses the maximum conditional likelihood estimation, and the training set {(X i , Y i )}, the estimated likelihood function of the maximum conditional likelihood is:

[0063]

[0064] The calculation formula of P is:

[0065]

[0066] Optionally, the model combination module includes: a parameter combination unit and a parameter updating unit, wherein:

[0067] The parameter combining unit is used to perform weighted averaging on the training parameters of each of the trained recognition models to obtain a combined parameter;

[0068] The parameter updating unit is used to update the training parameters of the recognition model with the joint parameters to obtain the recognition joint model.

[0069] In a third aspect, an embodiment of the present invention provides a readable storage medium having executable instructions thereon, which, when executed, enables a computer to execute any method included in the first aspect.

[0070] In a fourth aspect, an embodiment of the present invention provides a computing device, comprising: a memory, one or more processors, and a program, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors to perform any method included in the first aspect.

[0071] Compared with the prior art, the present invention has at least the following beneficial effects:

[0072] The present invention introduces federated learning and adopts a classic named entity recognition deep model to identify keyword entities for electronic medical examinations, thereby providing a basis for more medical projects. It can ensure that the model quality is intact, negative transfer will not occur, and the federated model is better than the fragmented independent model; in federated learning, the participants have equal status and can achieve fair cooperation; in addition, it can ensure that the participating parties can perform encrypted exchange of information and model parameters while maintaining independence and gain growth at the same time. And additional advantages will be given in the following specific embodiments, will become apparent in the following description, or will be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative work.

[0074] Figure 1 It is a flowchart of a model training method for named entity recognition provided by an embodiment of the present invention;

[0075] Figure 2 It is a process framework diagram of a model training method for named entity recognition provided by an embodiment of the present invention;

[0076] Figure 3 It is a schematic diagram of a Bi-LSTM_CRF network structure provided by an embodiment of the present invention;

[0077] Figure 4 is a schematic diagram of a hidden layer neuron structure provided by an embodiment of the present invention;

[0078] Figure 5 It is a structural block diagram of a model training device for named entity recognition provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0079] 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, rather than all the embodiments. Based on the embodiments in 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.

[0080] like Figure 1 As shown, an embodiment of the present invention provides a model training method for named entity recognition, which is applied to a server, and the method includes:

[0081] S1: Sending the selected hyperparameters to each client so that each client updates the hyperparameters; the hyperparameters at least include a sample dictionary and a label dictionary;

[0082] S2: Initialize the recognition model and obtain the current recognition model;

[0083] S3: sending the current recognition model to each of the clients, so that each of the clients trains the current recognition model according to local data;

[0084] S4: receiving a trained recognition model sent by each client, where the trained recognition model is obtained by training the current recognition model according to local data;

[0085] S5: Aggregating the trained recognition models based on a joint learning algorithm to obtain a joint recognition model;

[0086] S6: Execute S3 after taking the recognition joint model as the current recognition model until the recognition joint model meets preset requirements, wherein the preset requirements include preset accuracy and / or the number of training times of each client.

[0087] In one embodiment of the present invention, initializing the recognition model and obtaining the current recognition model may include:

[0088] N1: Define recognition model and loss function;

[0089] N2: Set various training parameters of the recognition model; the training parameters include at least: batch size, learning rate and optimizer.

[0090] like Figure 2 As shown, an embodiment of the present invention provides a model training method for named entity recognition based on the PySyft framework (i.e., PySyft is a framework that supports secure and private computing in deep learning models). The right side represents the central logic, i.e., the central end can be the function to be implemented by the server, and the left side represents the client logic, i.e., the function to be implemented by the client. Among them, the central end is the main logic, and the client is equivalent to the service responding to the request of the central end. The method includes: the central end sets hyperparameters such as a dictionary and a label dictionary, and defines the set data dataset_key and then sends them to each client. The central end requests each client to update the hyperparameters, and each client node will execute the initial hyperparameter function and create batch data according to the dataset_key; before training, the central end defines the network model and loss function, sets various training parameters, and then instantiates the model and loss function through the torch script; during the training process, the central end configures the tranconfig required for training, such as evaluate or predict parameters, including the instantiated model, loss, batch_size, etc., to each client, and requests each client to perform training. After receiving the request, the client will perform the training process according to the local data, and the client will upload the model to the central end after training; the central end performs aggregation, and distributes the aggregated model to each client for a new round of joint training, and iterates the training until the termination condition rounds is met.

[0091] In natural language tasks, if only the previous information is considered without using the following information, some semantic information will be lost. Because the standard recurrent neural network series (RNN, LSTM) often ignores the following information when processing sequences in time. Figure 3 As shown, the bidirectional recurrent neural network series (BRNN, Bi-LSTM) of the present invention is that each training sequence is forward passed and backward passed respectively, and the two recurrent neural networks are connected to an output layer. The forward pass layer can obtain the context information of each point in the input sequence, and the backward pass layer can obtain the context information of each point in the input sequence. The hidden layer states of the forward pass layer and the backward pass layer are merged as the input of the CRF layer.

[0092] like Figure 4 As shown, in this embodiment, the hidden layer neurons of the Bi-LSTM layer are protected and the cell state is controlled by the input gate, the forget gate and the output gate; the input gate, the forget gate and the output gate have the ability to delete or add information to the cell state.

[0093] In this embodiment, the neuron is defined as a d-dimensional space vector set R at time step t. d , the input gate, forget gate and output gate are i at time t respectively t 、f t , o t ,i t 、f t , o t The value range is [0, 1], so the output value calculation formula of the neuron is:

[0094] i t =δ(W (i) x t +U (i) h t-1 +b (i) )

[0095] f t =δ(W (f) x t +U (f) h t-1 +b (f) )

[0096] o t =δ(W (o) x t +U (o) h t-1 +b (o) )

[0097] u t =tanh(W (u) x t+U (u) h t-1 +b (u) )

[0098]

[0099]

[0100] Among them, x t represents the input value at time step t, δ represents the logistic sigmoid activation function, represents element-wise multiplication, h t Represents the output value of the neuron at time step t.

[0101] In this embodiment, the CRF layer can obtain the global optimal label sequence by considering the adjacent relationship between labels, so the CRF layer is used to model the label sequence. n ) and the corresponding label sequence Y(y1, y2, y3, ..., y n ), the evaluation score is:

[0102]

[0103] Where W is the transformation matrix, The yth character of character i i The score of the labels, Indicates the yth i The label transfer score;

[0104] The training of the CRF layer uses the maximum conditional likelihood estimation, and the training set {(X i , Y i )}, the estimated likelihood function of its maximum conditional likelihood is:

[0105]

[0106] The calculation formula of P is:

[0107]

[0108] In this embodiment, the training parameters are trained by the Stochastic Weight Averaging (SWA) method. The whole process is that after the model parameters are initialized, SGD (Saccharomyces Genome Database, stochastic gradient descent) is used to perform gradient descent. After iterating n epochs (where n is set according to the actual situation), the parameters of the model are weighted averaged to obtain w SWA, then the parameter of the current model is w SWA Then use SGD to gradient descent, iterate n epochs, and then weighted average to get a new w SWA There are two important factors that make SWA work. The first factor is that SWA uses a modifiable learning rate strategy. The second factor is to take the average of the weights of the network traversed by SGD. SWA solves the weight oscillation problem of traditional SGD in the reverse process and can accelerate the convergence speed of the model.

[0109] In this embodiment, 600 annotated electronic medical record texts provided in the electronic medical record named entity recognition of CCKS2018 are used, and the label categories are body parts, symptoms, symptom descriptions, surgeries, and drugs, etc. Based on the asynchronous method in the PySyft framework, the central end saves the model module as torch.jit.scriptModule and distributes it to each client for training. At the same time, the model module can also be easily modified to non-torch.jit.scriptModule for normal model construction. Introducing federated learning into model training can meet data isolation without loss of model quality or even improvement of independent models, and data will not be leaked to the outside, meeting the needs of user privacy protection and data security.

[0110] It is worth noting that in addition to the models mentioned in this article, the Bi-LSTM layer can be changed and replaced with some improved variants of Bi-LSTM, such as BiGRU layer, or adding a preprocessing layer for text representation, such as transformer. Similarly, the CRF layer can also be replaced with some improved CRF.

[0111] like Figure 5 As shown, an embodiment of the present invention provides a model training device for named entity recognition, the device comprising: a hyperparameter sending module, a model initialization module, a model sending module, a model receiving module, a model joint module and a training termination module, wherein:

[0112] The hyperparameter sending module is used to send the selected hyperparameters to each client so that each client updates the hyperparameters; the hyperparameters include at least a sample dictionary and a label dictionary;

[0113] The model initialization module is used to initialize the recognition model and obtain the current recognition model;

[0114] The model sending module is used to send the current recognition model to each client, so that each client can train the current recognition model according to local data;

[0115] The model receiving module is used to receive the trained recognition model sent by each client, where the trained recognition model is obtained by training the current recognition model according to local data;

[0116] The model combination module is used to aggregate the trained recognition models based on a joint learning algorithm to obtain a recognition joint model;

[0117] The training termination module is used to trigger the model sending module after taking the recognition joint model as the current recognition model until the recognition joint model meets preset requirements, and the preset requirements include preset accuracy and / or the number of training times of each client.

[0118] In one embodiment of the present invention, the model initialization module includes a model definition unit and a parameter setting module, wherein:

[0119] The model definition unit is used to define the recognition model and the loss function;

[0120] The parameter setting module is used to set various training parameters of the recognition model; the training parameters include at least: batch size, learning rate and optimizer.

[0121] In one embodiment of the present invention, the recognition model is a bidirectional recurrent neural network model, which includes a Bi-LSTM layer, in which each training sequence in the Bi-LSTM layer is respectively two recurrent neural networks in forward pass and backward pass, and the two recurrent neural networks are connected to an output layer; the forward pass layer obtains the context information of each point in the input sequence, and the backward pass layer obtains the context information of each point in the input sequence; the hidden layer states of the forward pass layer and the backward pass layer are merged and used as the input of the CRF layer.

[0122] In one embodiment of the present invention, the hidden layer neurons of the Bi-LSTM layer are protected and the cell state is controlled by an input gate, a forget gate and an output gate; the input gate, the forget gate and the output gate have the ability to delete or add information to the cell state.

[0123] In one embodiment of the present invention, the neuron is a d-dimensional space vector set R at time step t d , the input gate, the forget gate and the output gate are i at time t respectively t、 f t , o t ,i t、 f t , o t The value range is [0, 1], so the output value calculation formula of the neuron is:

[0124] it =δ(W (i) x t +U (i) h t-1 +b (i) )

[0125] f t =δ(W (f) x t +U (f) h t-1 +b (f) )

[0126] o t =δ(W (o) x t +U (o) h t-1 +b (o) )

[0127] u t =tanh(W (u) x t +U (u) h t-1 +b (u) )

[0128]

[0129]

[0130] Among them, x t represents the input value at time step t, δ represents the logistic sigmoid activation function, represents element-wise multiplication, h t Represents the output value of the neuron at time step t.

[0131] In one embodiment of the present invention, a CRF layer is used to model the label sequence; the CRF layer is used for a given sequence X (x1, x2, x3, ..., x n ) and the corresponding label sequence Y(y1, y2, y3, ..., y n ), the evaluation score is:

[0132]

[0133] Where W is the transformation matrix, The yth character of character i i The score of the labels, Indicates the yth i The label transfer score;

[0134] The training of the CRF layer uses the maximum conditional likelihood estimation, and the training set {(Xi , Y i )}, the estimated likelihood function of the maximum conditional likelihood is:

[0135]

[0136] The calculation formula of P is:

[0137]

[0138] In one embodiment of the present invention, the model combination module includes: a parameter combination unit and a parameter update unit, wherein:

[0139] The parameter combining unit is used to perform weighted averaging on the training parameters of each of the trained recognition models to obtain a combined parameter;

[0140] The parameter updating unit is used to update the training parameters of the recognition model with the joint parameters to obtain the recognition joint model.

[0141] The information interaction, execution process, etc. between the modules and 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 no further description is given here.

[0142] It should be understood that the various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or portions of the method and apparatus of the present invention, can take the form of program codes (i.e., instructions) embedded in a tangible medium, such as a floppy disk, a CD-ROM, a hard disk drive, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.

[0143] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute various methods of the present invention according to the instructions in the program code stored in the memory.

[0144] By way of example and not limitation, computer readable media include computer storage media and communication media. Computer readable media include computer storage media and communication media. Computer storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and includes any information delivery medium. Any combination of the above is also included within the scope of computer readable media.

[0145] It should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of invention should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, the inventive aspects lie in less than all the features of a single embodiment of the preceding invention. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0146] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples invented herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into a plurality of submodules.

[0147] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features of the invention in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device so invented may be combined in any combination. Unless otherwise expressly stated, each feature of the invention in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0148] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0149] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.

[0150] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.

[0151] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and didactic purposes, rather than for the purpose of explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The inventions made to the present invention are illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.

Claims

1. A model training method for named entity recognition, characterized in that: The method includes: S1: Sending the selected hyperparameters to each client so that each client updates the hyperparameters; the hyperparameters at least include a sample dictionary and a label dictionary; S2: Initialize the recognition model and obtain the current recognition model; S3: sending the current recognition model to each of the clients, so that each of the clients trains the current recognition model according to local data; S4: receiving a trained recognition model sent by each client, where the trained recognition model is obtained by training the current recognition model according to local data; S5: Aggregating the trained recognition models based on a joint learning algorithm to obtain a joint recognition model; S6: Execute S3 after taking the recognition joint model as the current recognition model until the recognition joint model meets preset requirements, wherein the preset requirements include preset accuracy and / or the number of training times of each client.

2. The model training method for named entity recognition according to claim 1, characterized in that: Step S2 includes: Define recognition model and loss function; Various training parameters of the recognition model are set; the training parameters include at least: batch size, learning rate and optimizer.

3. The model training method for named entity recognition according to claim 2, characterized in that: The recognition model is a bidirectional recurrent neural network model, which includes a Bi-LSTM layer, in which each training sequence in the Bi-LSTM layer is transmitted forward and backward respectively by two recurrent neural networks, and the two recurrent neural networks are connected to an output layer; The forward transfer layer obtains the previous information of each point in the input sequence, and the backward transfer layer obtains the following information of each point in the input sequence; the hidden layer states of the forward transfer layer and the backward transfer layer are merged and used as the input of the CRF layer.

4. The model training method for named entity recognition according to claim 3, characterized in that: The hidden layer neurons of the Bi-LSTM layer are protected and the cell state is controlled by an input gate, a forget gate and an output gate; the input gate, the forget gate and the output gate have the ability to delete or add information to the cell state.

5. The model training method for named entity recognition according to claim 4, characterized in that: The neuron is a d-dimensional space vector set R at time step t d , the input gate, the forget gate and the output gate are i at time t respectively t 、f t , o t ,i t 、f t , o t The value range is [0, 1], so the output value calculation formula of the neuron is: i t =δ(W (i) x t +U (i) h t-1 +b (i) ) f t =δ(W (f) x t +U (f) h t-1 +b (f) ) o t =δ(W (o) x t +U (o) h t-1 +b (o) ) u t =tanh(W (u) x t +U (u) h t-1 +b (u) ) Among them, x t represents the input value at time step t, δ represents the logistic sigmoid activation function, represents element-wise multiplication, h t Represents the output value of the neuron at time step t.

6. The model training method for named entity recognition according to claim 5, characterized in that: The CRF layer is used to model the label sequence; the CRF layer is used for a given sequence X (x1, x2, x3, ..., x n ) and the corresponding label sequence Y(y1, y2, y3, ..., y n ), the evaluation score is: Where W is the transformation matrix, The yth character of character i i The score of the labels, Indicates the yth i The label transfer score; The training of the CRF layer uses the maximum conditional likelihood estimation, and the training set {(X i , Y i )}, the likelihood function of the maximum conditional likelihood estimate is: The calculation formula of P is:

7. The model training method for named entity recognition according to any one of claims 1 to 6, characterized in that: Step S5 aggregates the trained recognition models based on a joint learning algorithm to obtain a joint recognition model, including: Performing weighted averaging on the training parameters of each of the trained recognition models to obtain a joint parameter; The training parameters of the recognition model are updated with the joint parameters to obtain the recognition joint model.

8. A model training device for named entity recognition, characterized in that: The device comprises: a hyperparameter sending module, a model initialization module, a model sending module, a model receiving module, a model combining module and a training termination module, wherein: The hyperparameter sending module is used to send the selected hyperparameters to each client so that each client updates the hyperparameters; the hyperparameters include at least a sample dictionary and a label dictionary; The model initialization module is used to initialize the recognition model and obtain the current recognition model; The model sending module is used to send the current recognition model to each client, so that each client can train the current recognition model according to local data; The model receiving module is used to receive the trained recognition model sent by each client, where the trained recognition model is obtained by training the current recognition model according to local data; The model combination module is used to aggregate the trained recognition models based on a joint learning algorithm to obtain a recognition joint model; The training termination module is used to trigger the model sending module after taking the recognition joint model as the current recognition model until the recognition joint model meets preset requirements, and the preset requirements include preset accuracy and / or the number of training times of each client.

9. A readable storage medium, characterized in that: There are executable instructions thereon, which, when executed, cause a computer to perform a method as claimed in any one of claims 1 to 7.

10. A computing device, characterized in that include: A memory, one or more processors, and a program, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors to perform the method as included in any one of claims 1-7.