Entity recognition model training method and device and entity recognition method and device
By building a sample template set and training an entity recognition model based on a pre-trained language network, the problem of poor accuracy and scalability of named entity recognition in the prior art is solved, and efficient recognition effect in the case of small samples is achieved.
Patent Information
- Application Number
- CN202310664489.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2024-12-06
AI Technical Summary
The existing named entity recognition technology has problems such as low accuracy of rule extraction, poor scalability of entity dictionaries, low recall, high cost, and inapplicable to small sample data.
By obtaining training samples with entity type tags, building a sample template set, and training based on a pre-trained language network, the noise-added strategy is used to improve the model, which is used to characterize the correspondence between entity fragments and entity sentences, and improve the entity recognition model Robustness and accuracy.
In the case of small samples, the efficiency and accuracy of naming entity recognition are improved, and the robustness and recognition effect of the model are enhanced.
Smart Images

Figure CN119089190A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, specifically to the field of artificial intelligence technology, and in particular to an entity recognition model training method and device, an entity recognition method and device, an electronic device, and a computer-readable medium. Background Art
[0002] The main technologies of existing named entity recognition include three categories: rule extraction, entity dictionary matching, and named entity recognition model recognition. Address text has a relatively flexible structure of hot spots. The accuracy of extracting address entities with a single rule is low, and rule extraction requires a lot of manual intervention, which makes it difficult to migrate applications; entity dictionary matching also has the disadvantages of poor scalability, low recall rate, and high cost; named entity recognition models have certain generalization capabilities, but require a large amount of labeled data for training, which is not suitable for small sample situations. Summary of the invention
[0003] The embodiments of the present disclosure provide an entity recognition model training method and device, an entity recognition method and device, an electronic device, and a computer-readable medium.
[0004] In a first aspect, an embodiment of the present disclosure provides an entity recognition model training method, the method comprising: obtaining training samples, the training samples comprising: sample fragments with entity type labels; constructing a sample template set based on the sample fragments and an entity naming dictionary; constructing sample sentences based on the training samples and the sample template set; training a pre-trained language network based on the sample sentences and the sample fragments to obtain an entity recognition model corresponding to the pre-trained language network, the pre-trained language network being used to characterize the correspondence between entity fragments and entity sentences.
[0005] In some embodiments, the above-mentioned pre-trained language network is used to predict the correspondence between address fragments and address sentences, and the method also includes: when training the pre-trained language network, using a noise addition strategy to improve the pre-trained language network; the noise addition strategy includes at least one of the following: making the token masking task include masking any address text; making the token removal task include removing any address text; making the continuous token masking task include masking a continuous address; making the sentence sorting task include determining whether two addresses are adjacent.
[0006] In some embodiments, the above-mentioned construction of the sample template set based on the sample fragment and the entity naming dictionary includes: determining the dictionary positive template based on the sample fragment, the entity type, and the entity naming dictionary; determining the dictionary negative template based on the sample fragment; and obtaining the sample template set based on the dictionary positive template and the dictionary negative template.
[0007] In some embodiments, the above-mentioned construction of the sample template set based on the sample fragment and the entity naming dictionary includes: determining the text positive template based on the sample fragment and the entity type; determining the text negative template based on the sample fragment; determining the dictionary positive template based on the sample fragment, the entity type, and the entity naming dictionary; determining the dictionary negative template based on the sample fragment; obtaining the sample template set based on the text positive template, the text negative template, the dictionary positive template and the dictionary negative template.
[0008] In some embodiments, the above-mentioned sample template set includes: a positive sample template set and a negative sample template set. Based on the training samples and the sample template set, constructing sample sentences includes: obtaining at least one positive sample sentence based on the positive sample template set; obtaining at least one negative sample sentence based on samples without entity type labels in the training samples and the negative sample template set; and taking at least one positive sample sentence and at least one negative sample sentence as sample sentences.
[0009] In a second aspect, an embodiment of the present disclosure provides an entity recognition method, the method comprising: obtaining a text to be recognized; obtaining a predicted sentence based on a text segment of the text to be recognized and a pre-set sample template set; using the predicted sentence and an entity recognition model to predict the text to be recognized, and obtaining a recognition result of the text to be recognized, wherein the entity recognition model is trained using the entity recognition model training method of any embodiment of the first aspect.
[0010] In a third aspect, an embodiment of the present disclosure provides an entity recognition model training device, which includes: a sample acquisition unit, configured to acquire training samples, the training samples including: sample fragments with entity type labels; a template construction unit, configured to construct a sample template set based on the sample fragments and an entity naming dictionary; a sample construction unit, configured to construct a sample sentence based on the training sample and the sample template set; a training unit, configured to train a pre-trained language network based on the sample sentences and the sample fragments to obtain an entity recognition model corresponding to the pre-trained language network, the pre-trained language network being used to characterize the correspondence between entity fragments and entity sentences.
[0011] In some embodiments, the pre-trained language network is used to predict the correspondence between address fragments and address sentences, and the device further includes: a noise adding unit configured to improve the pre-trained language network by adopting a noise adding strategy when the pre-trained language network is trained; the noise adding strategy includes at least one of the following: making the token masking task include masking any address text; making the token removal task include removing any address text; making the continuous token masking task include masking a continuous address; making the sentence sorting task include determining whether two addresses are adjacent.
[0012] In some embodiments, the template construction unit is further configured to: determine the dictionary positive template based on sample fragments, entity types, and entity naming dictionaries; determine the dictionary negative template based on sample fragments; and obtain a sample template set based on the dictionary positive template and the dictionary negative template.
[0013] In some embodiments, the template construction unit is further configured to: determine a text positive template based on sample fragments and entity types; determine a text negative template based on sample fragments; determine a dictionary positive template based on sample fragments, entity types, and entity naming dictionaries; determine a dictionary negative template based on sample fragments; obtain a sample template set based on the text positive template, the text negative template, the dictionary positive template, and the dictionary negative template.
[0014] In some embodiments, the sample template set includes: a positive sample template set and a negative sample template set, and the sample construction unit is further configured to: fill entity types and text fragments into the positive sample template set to obtain at least one positive sample sentence; based on samples without entity type labels in training samples and negative sample templates, obtain at least one negative sample sentence; use at least one negative sample sentence and at least one negative sample sentence as sample sentences.
[0015] In a fourth aspect, an embodiment of the present disclosure provides an entity recognition device, which includes: a text acquisition unit, configured to acquire text to be recognized; an acquisition unit, configured to obtain a predicted sentence based on a text segment of the text to be recognized and a pre-set sample template set; a prediction unit, configured to use the predicted sentence and the entity recognition model to predict the text to be recognized and obtain a recognition result of the text to be recognized, and the entity recognition model is trained using the entity recognition model training device of any embodiment of the third aspect.
[0016] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any embodiment of the first aspect or the second aspect.
[0017] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the first aspect or the second aspect.
[0018] The entity recognition model training method and device provided by the embodiments of the present disclosure first obtain training samples, and the training samples include: sample segments with entity type labels; secondly, based on the sample segments and the entity naming dictionary, a sample template set is constructed; thirdly, based on the training samples and the sample template set, a sample sentence is constructed; finally, based on the sample sentences and the sample segments, a pre-trained language network is trained to obtain an entity recognition model corresponding to the pre-trained language network. Thus, by introducing a template to transform the original sample segments into sample sentences, and training the entity recognition model based on the sample sentences, the entity recognition model can make a judgment on the sample sentences and give a judgment result, so that the named entity recognition task of a small sample can obtain a better recognition effect in the case of a sample, thereby improving the efficiency of entity recognition; further, the use of the entity naming dictionary enriches the template construction method, and enhances the robustness and accuracy of the entity recognition model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0020] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
[0021] Figure 2 is a flowchart of an embodiment of an entity recognition model training method according to the present disclosure;
[0022] Figure 3 is a schematic diagram of generating a sample template set in the present disclosure;
[0023] Figure 4 It is a structural schematic diagram of the pre-trained language network training in the present disclosure;
[0024] Figure 5 is a flow chart of an embodiment of an entity recognition method according to the present disclosure;
[0025] Figure 6 is a structural schematic diagram of an embodiment of an entity recognition model training device according to the present disclosure;
[0026] Figure 7 is a structural schematic diagram of an embodiment of an entity identification device according to the present disclosure;
[0027] Figure 8 It is a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION
[0028] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0029] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0030] Figure 1 An exemplary system architecture 100 is shown to which the entity recognition model training method or entity recognition method of the present disclosure can be applied.
[0031] like Figure 1 As shown, the system architecture 100 may include terminals 101, 102, a network 103, a database server 104, and a server 105. The network 103 is used to provide a medium for communication links between the terminals 101, 102, the database server 104, and the server 105. The network 103 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0032] The user 110 can use the terminals 101 and 102 to interact with the server 105 through the network 103 to receive or send messages, etc. Various client applications can be installed on the terminals 101 and 102, such as model training applications, image recognition applications, shopping applications, payment applications, web browsers, and instant messaging tools.
[0033] The terminals 101 and 102 here can be hardware or software. When the terminals 101 and 102 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Dynamic Image Experts Compression Standard Audio Layer 3), laptops and desktop computers, etc. When the terminals 101 and 102 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0034] The database server 104 may be a database server that provides various services. For example, a sample set may be stored in the database server. The sample set includes a large number of training samples, and the training samples may include sample segments with entity type labels and sample segments without entity type labels, wherein the entity type label is a label corresponding to the entity recognition task. In this way, the user 110 may also select material samples from the material sample set stored in the database server 104 through the terminals 101 and 102.
[0035] The server 105 may also be a server that provides various services, such as a background server that provides support for various applications displayed on the terminals 101 and 102. The background server may use the sample segments in the sample set sent by the terminals 101 and 102 to construct a sample template set, train an entity recognition model, and may send the trained entity recognition model to the terminals 101 and 102. In this way, the user may apply the generated entity recognition model to determine the recognition result of the text to be recognized, etc.
[0036] The database server 104 and the server 105 here can also be hardware or software. When they are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When they are software, they can be implemented as multiple software or software modules (for example, for providing distributed services), or as a single software or software module. No specific limitation is made here.
[0037] It should be noted that the entity recognition model training method or entity recognition method provided in the embodiments of the present disclosure is generally executed by the server 105. Accordingly, the entity recognition model training device or entity recognition device is generally also provided in the server 105.
[0038] It should be pointed out that, in the case where the server 105 can implement the related functions of the database server 104 , the database server 104 may not be provided in the system architecture 100 .
[0039] It should be understood that Figure 1 The number of terminals, networks, database servers and servers in the embodiment is only for illustration. Any number of terminals, networks, database servers and servers may be provided according to the implementation requirements.
[0040] The present disclosure provides an entity recognition model training method, such as Figure 2 , shows a process 200 of an embodiment of an entity recognition model training method according to the present disclosure, the entity recognition model training method comprising the following steps:
[0041] Step 201, obtaining training samples.
[0042] In this embodiment, the training samples include: sample segments with entity type labels. The training samples are samples obtained from the sample set. For different entity recognition tasks, the form of the training samples may be different. For example, for the address named entity recognition task, the training samples may be text segments including the address entity. For the brand entity recognition task, the training samples may be text segments including the brand entity.
[0043] In this embodiment, the sample segment can be a text segment including at least one entity, and the entity carries an entity type label. The entity type label is a label related to the recognition task, that is, a label corresponding to the entity recognition task. Through the entity type label, the model can accurately determine the entity type to which the entity in the sample sentence belongs. For example, the label of "abc" is an address entity.
[0044] In this embodiment, the training sample may be data randomly extracted from a sample set, where the sample set is a data set for implementing entity recognition model prediction, and the sample set includes multiple training samples.
[0045] Optionally, the training samples may include: sample fragments with entity type labels and samples without entity type labels, wherein the number of sample fragments with entity type labels is relatively small, while the number of samples without entity type labels is relatively large. By expanding the sample fragments in the sample template set, a large number of sample sentences are obtained, which can provide a large amount of training samples for the entity recognition model.
[0046] In this embodiment, the execution subject of the entity recognition model training method (for example Figure 1 The server shown in the figure can obtain the sample set in a variety of ways and extract training samples from the sample set. For example, the execution subject can obtain the training samples from the database server (for example, Figure 1 For example, a user may obtain an existing sample set stored in the database server 104 as shown in FIG. Figure 1 In this way, the execution subject can receive the training samples collected by the terminal and store these training samples locally, thereby generating a sample set.
[0047] Step 202: construct a sample template set based on the sample fragments and the entity naming dictionary.
[0048] In this embodiment, the sample template set includes at least one sample template, and the formats and information contents of various templates in the sample template set are different, and different sentence formats are expressed through various types. For an entity recognition model that requires positive samples and negative samples to participate, the sample template may include a positive sample template and a negative sample template, and for this purpose, the sample template set may include a positive sample template set and a negative sample template set.
[0049] In this embodiment, the template transforms the original input into a format similar to a cloze test, so that the language model can answer the sentences constructed by the template, and then infer the results of the downstream tasks from these sentences. The template is the carrier of the content. By adding content of one style to the template, you can get content of another style.
[0050] In this embodiment, the template has corresponding slots for sample segments and entity naming dictionaries. By filling the slots of the template with units of sample segments and entity names of entity naming dictionaries, a sample template set having information of sample segments and entity naming dictionaries can be obtained.
[0051] Step 203: construct a sample sentence based on the training sample and the sample template set.
[0052] In this embodiment, the sample sentence is a sentence input into the pre-trained language network, and the pre-trained language network can analyze the sample sentence to determine the confidence of the sample sentence.
[0053] In this embodiment, the above-mentioned construction of sample sentences based on training samples and sample template sets includes: selecting samples from the training samples, detecting whether the sample template set has sentences similar to the sample; in response to having sentences similar to the sample, taking the sentences similar to the sample as sample sentences.
[0054] In this embodiment, the sample sentences may include: positive sample sentences and negative sample sentences. In the training samples of the current scenario, all sample segments containing entity types can be used to construct positive sample sentences. For example, assuming that the sample segment x i:j The corresponding entity type is y k , then x will be i:j and k Fill it into the positive sample template in the constructed sample template set to obtain the positive sample sentence Assume that the text segment x in the training sample i:j is not an entity part, then it may also be used to construct a negative sample sentence, that is, it is filled into the negative sample template in the sample template set to obtain a negative sample sentence
[0055] Step 204: Based on the sample sentences and sample fragments, the pre-trained language network is trained to obtain an entity recognition model corresponding to the pre-trained language network.
[0056] In this embodiment, the sample sentences and sample segments are used as sample outputs to the pre-trained language network, so that the encoder of the pre-trained language network represents the sample segments as a vector with semantics, and the decoder of the pre-trained language network uses the vector generated by the encoder as input to decode the target text sequence (such as Figure 3The output layer of the pre-trained language network compares the target text sequence with the sample sentence to obtain the similarity value between the sample segment and the sample sentence, that is, the confidence of the sample sentence, which is also called the prediction score.
[0057] In this embodiment, a pre-trained language network is trained based on sample sentences and sample fragments to obtain an entity recognition model corresponding to the pre-trained language network, including: inputting both the sample fragment and the sample sentence into the pre-trained language network to obtain a prediction result of the pre-trained language network for the sample fragment, comparing the prediction result with the sample sentence for similarity to obtain a prediction score corresponding to each sample sentence; based on the prediction score corresponding to each sample sentence (for example, selecting the sample sentence with the highest prediction score as the most accurate sentence corresponding to the prediction result of the sample fragment), determining the entity type in the sample sentence corresponding to the sample fragment.
[0058] In this embodiment, the pre-trained language network is used to characterize the correspondence between entity segments and entity sentences. To this end, the trained entity recognition model is also used to characterize the correspondence between entity segments and entity sentences. Further, the entity recognition model can accurately characterize the entity types in entity segments and entity sentences.
[0059] In this embodiment, the pre-trained language network is a network that performs masking and text type prediction processing on text. Specifically, the pre-trained language network can adopt a Bert (Bidirectional Encoder Representations from Transformers, bidirectional encoding representation based on Transformer) model structure.
[0060] The pre-trained language network includes: encoder and decoder, such as Figure 3 As shown in the figure, the sample segment "abc Building 1" is input into the encoder of the pre-trained language network, and the encoder predicts the sample segment to obtain the representation of the entire sentence "abc is small" (in Figure 3 middle <s>is the start symbol), the representation of the entire sentence "abc is small" is input into the decoder, and the decoder's prediction result for the representation of the entire sentence is obtained, "abc is a small area". The pre-trained language network also includes: a hidden layer, which compares the similarity between the target text sequence of the decoder and the sample sentence (not shown in the figure) to obtain the prediction score corresponding to each sample sentence.
[0061] In this embodiment, in the process of constructing the training data of the pre-trained language network, the execution subject uses the sample segments containing entity types in the training samples and the positive sample sentences in the sample sentences to construct positive samples, which are expressed as (X, T + ), and some other text fragments (samples without entity types) in the training samples and negative sample sentences in the sample sentences are randomly selected to construct negative sample pairs (X, T - ), and ensure that the number of negative sample pairs is 1.5 times greater than the number of positive sample pairs.
[0062] Assuming that a training dataset (X, T) is given, the original text X is first input into the encoder of the pre-trained language network. At this time, the output result of the encoder can be used to represent the entire sentence as shown in formula (1), that is:
[0063] h enc =ENCODER(x 1:n ) (1)
[0064] After that, the decoder of the pre-trained language network works. The decoder is based on h enc And the prediction results given previously to the current step can be formally expressed as formula (2):
[0065]
[0066] That is, the prediction result of step c in formula (2) is obtained during the decoding process, and then the prediction probability of the input vocabulary (the actual input sample sentence) is obtained after the output layer of the pre-trained language network and the softmax function, which can be expressed as:
[0067]
[0068] In formula (3) b lm ∈R |V| , |V| represents the vocabulary size for training the pre-trained language network. The pre-trained language network can use cross entropy loss for model parameter optimization.
[0069] In this embodiment, positive samples and negative samples are input into the pre-trained language network multiple times, and the loss of the pre-trained language network is calculated until the pre-trained language network meets the training completion condition, thereby obtaining an entity recognition model.
[0070] In this embodiment, the training completion condition may include: the number of training iterations reaches a predetermined iteration threshold, and the loss of the pre-trained language network is less than a predetermined loss threshold. For example, the training iterations reach 50,000 times, and the loss of the pre-trained language network is less than 0.05. In this embodiment, the model convergence speed can be accelerated by setting the training completion condition.
[0071] The entity recognition model training method provided by the embodiments of the present disclosure can apply the sample template set to the scenario of address named entity recognition. According to the characteristics of the address naming task, the existing address dictionary can be used to enrich the construction method of the sample templates in the sample template set, thereby increasing the robustness and accuracy of the model, thereby enabling the address named entity recognition task to achieve better results with small samples.
[0072] The entity recognition model training method provided by the embodiment of the present disclosure first obtains training samples, and the training samples include: sample fragments with entity type labels; secondly, based on the sample fragments and the entity naming dictionary, a sample template set is constructed; thirdly, based on the training samples and the sample template set, a sample sentence is constructed; finally, based on the sample sentences and the sample fragments, a pre-trained language network is trained to obtain an entity recognition model corresponding to the pre-trained language network. Thus, by introducing a template to transform the original sample fragment into a sample sentence, and training the entity recognition model based on the sample sentence, the entity recognition model can judge the sample sentence and give a judgment result, so that the named entity recognition task of a small sample can obtain a better recognition effect in the case of a sample, thereby improving the efficiency of entity recognition; further, the use of the entity naming dictionary enriches the template construction method, and enhances the robustness and accuracy of the entity recognition model training.
[0073] In some optional implementations of this embodiment, the pre-trained language network is used to predict the correspondence between the address fragment and the address sentence, and the method further includes:
[0074] When training a pre-trained language network, a noise adding strategy is used to improve the pre-trained language network; the noise adding strategy includes at least one of the following: making the token masking task include masking any address text; making the token removal task include removing any address text; making the continuous token masking task include masking a section of continuous addresses; making the sentence sorting task include judging whether two addresses are adjacent.
[0075] In this embodiment, the pre-trained language network is a generative pre-trained model in the field of natural language processing. The model generally has several noise adding tasks: Noise adding task 1 Token Masking, randomly replacing tokens with masks; Noise adding task 2 Token Deletion, randomly removing tokens; Noise adding task 3 Text Infilling, randomly replacing a continuous range of tokens with masks, the length of the continuous tokens obeys the Poisson distribution of λ=3, when the length of the continuous tokens is zero, it is equivalent to inserting a mask; Noise adding task 4 Sentence Permutation, shuffling the sentences of a document; Noise adding task 5 Document Rotation, randomly selecting a token from the document sequence, and then using the token as the beginning of the document.
[0076] In this embodiment, the token masking task is a task obtained after the noise adding task one is modified. When the token is replaced with a mask, the mask information needs to be an address text; the token removal task is a task obtained after the noise adding task two is modified. When removing the token, the token with the address text needs to be removed; the continuous token masking task is a task obtained after the noise adding task three is modified. When a continuous token is replaced with a mask, the content of the mask is a continuous address; the sentence sorting task is a task obtained after the noise adding task four is modified. When the sentences of a document are shuffled, it is a task to determine whether two addresses are adjacent.
[0077] Specifically, in order to obtain the subordinate relationship between addresses of different levels and make the address contain the information of the addresses of its adjacent levels, the token masking task changes the original noise addition task in the pre-trained language network to mask the address information and predict the current address from its context address. If the context address can successfully infer the current address, it means that the current address already contains the information of the addresses of the adjacent levels.
[0078] In order to enable the model to acquire the ability to judge a single address and its location, the original noise-adding task 2 in the pre-trained language network is changed to randomly delete a single address. Different from the original noise-adding task 1, this strategy allows the model to learn which locations lack address information.
[0079] In order to enable the model to acquire the ability to determine how many addresses correspond to a certain interval, the original noise-adding task three in the pre-trained language network is changed to randomly replace a continuous address with a mask. The length of the interval follows a Poisson distribution of λ=2. This strategy enables the model to learn the span relationship between address levels.
[0080] In order to enable the model to learn the distance relationship between addresses at the same level, the original noise addition task 4 in the pre-trained language network is improved to a task of determining whether two addresses are adjacent. The closer the two addresses are, the closer their corresponding word vectors are; otherwise, the greater the difference.
[0081] In this optional implementation, the noise adding strategy enables the model to distinguish the hierarchical structure between addresses. The word embeddings of adjacent addresses are closer. The current address can be inferred from the word embeddings of the adjacent hierarchical addresses, enriching the information contained in the word embeddings of the address.
[0082] The denoising strategy provided by this optional implementation method uses an improved denoising strategy during the training of the pre-trained language network, which can enable the pre-trained language network to fully learn the representation of the word vector of the address text, and provide reliable quality assurance for the task of the pre-trained language network.
[0083] In some optional implementations of the present embodiment, constructing a sample template set based on sample fragments and an entity naming dictionary includes: determining a dictionary positive template based on the sample fragments, entity types, and an entity naming dictionary; determining a dictionary negative template based on the sample fragments; and obtaining a sample template set based on the dictionary positive template and the dictionary negative template.
[0084] In this optional implementation, the entity naming dictionary is an entity naming library of existing known entity types, and the entity naming dictionary includes entity names of multiple entity types. For example, for the address type, the entity naming dictionary includes: W community. The dictionary positive template is a template constructed by sample fragments, entity types and entity naming dictionary. In the dictionary positive template, two slots are included, one slot is used to fill in the unit of the sample fragment (the basic unit constituting the sample fragment, for example, it can be an entity name), and the other slot is used to fill in the entity name in the entity naming dictionary of the known entity type. By using the entity name of the known entity type to judge the unit of the sample fragment, it is concluded that the sample fragment belongs to the entity type. The dictionary negative template is a template constructed by the unit of the sample fragment, and the dictionary negative template includes a slot, which is used to fill in the unit of the sample fragment.
[0085] In this optional implementation, the above-mentioned determination of the dictionary positive template based on the sample fragment, entity type, and entity naming dictionary includes: based on the entity type corresponding to the sample fragment, determining the entity name in the entity naming dictionary that has the same entity type as the sample fragment, filling the unit of the sample fragment and the entity name into the slot corresponding to the dictionary positive template, and obtaining the dictionary positive template.
[0086] Determining the negative template of the dictionary based on the sample segment includes: filling the units of the sample segment into the slots corresponding to the negative template of the dictionary to obtain the negative template of the dictionary.
[0087] This optional implementation provides a method for obtaining a sample template set by comparing units in sample fragments with the entity naming dictionary with the same entity type to obtain a dictionary positive template, and obtains a dictionary negative template through the sample fragments, providing a reliable implementation method for obtaining a sample template set.
[0088] In some optional implementations of the present embodiment, constructing a sample template set based on sample fragments and an entity naming dictionary includes: determining a text positive template based on the sample fragment and the entity type; determining a text negative template based on the sample fragment; determining a dictionary positive template based on the sample fragment, the entity type, and the entity naming dictionary; determining a dictionary negative template based on the sample fragment; obtaining a sample template set based on the text positive template, the text negative template, the dictionary positive template, and the dictionary negative template.
[0089] In this embodiment, the text positive template and the text negative template are templates constructed only from sample fragments. The text positive template is a template including two slots, one slot is used to fill the unit of the sample fragment, and the other slot is used to fill the entity type of the unit of the sample fragment; the text negative template is a template including one slot, which is used to fill the unit of the sample fragment.
[0090] See Figure 4 As shown in , the entity naming dictionary includes: (Residential Area: W), (Building Number: Building 3), (House Number: Room 1109), and the sample segment is: abc Building 1 Unit 1917 is placed on the cabinet. Through the units "abc" and "cabinet", we get the text positive template Z1, text negative template F1, dictionary positive template Z2 and dictionary negative template F2. The text positive template Z1 includes multiple positive sample sentences, such as Figure 4 In the sentence "the cabinet is a community", "the cabinet is a building number", and "the cabinet is a house number", "community", "building number" and "house number" in the positive sample sentence are all entity types. The text negative template F1 includes a negative sample sentence, such as Figure 4 In the negative sample sentence, "the cabinet is not an address entity", "the cabinet" is a unit in the sample segment. The dictionary positive template Z2 includes multiple positive sample sentences, such as Figure 4 In the examples, "abc and W are address entities of the same level", "abc and Sandong are address entities of the same level", and "abc and 1109 are address entities of the same level", each positive sample sentence is obtained by comparing the unit of the sample segment with the entity type of the name in the entity naming dictionary. The dictionary negative template F2 includes a negative sample sentence, such as Figure 4 "abc is not an address entity".
[0091] This optional implementation method provides a method for obtaining a sample template set, obtaining a text positive template through units and entity types in sample fragments, and obtaining a text negative template through sample fragments; obtaining a dictionary positive template by comparing units in sample fragments with the entity naming dictionary with the same entity type, and obtaining a dictionary negative template through sample fragments, providing another reliable implementation method for obtaining a sample template set.
[0092] Optionally, the entity recognition model training method disclosed herein further includes: mapping entity type tags with the same semantics in the entity type tags corresponding to the current data to the same entity type tag based on a pre-constructed mapping relationship. For example, the entity type tags include: community, family compound; through the pre-constructed mapping relationship, the family compound is mapped to the community, thereby achieving the purpose of associating the model prediction result with the model's vocabulary.
[0093] In some optional implementations of the present embodiment, the upper sample template set includes: a positive sample template set and a negative sample template set. Based on the training samples and the sample template set, constructing sample sentences includes: obtaining at least one positive sample sentence based on the positive sample template set; obtaining at least one negative sample sentence based on samples without entity type labels in the training samples and the negative sample template set; and using at least one positive sample sentence and at least one negative sample sentence as sample sentences.
[0094] In this embodiment, the sample template set is a template pre-constructed through sample fragments. In the actual training process of the pre-trained language network, it is necessary to generate positive samples and negative samples through the sample template set, wherein the positive sample is a positive sample sentence obtained by the positive sample template in the positive sample template set, and the negative sample is a negative sample sentence obtained by filling the sample without entity type label into the negative sample template in the negative sample template set.
[0095] In this embodiment, the positive sample template set may include: a dictionary positive template obtained by filling two template slots with an entity naming dictionary and a sample fragment, and the positive sample template set may also include: a text positive template obtained by filling two template slots with a sample fragment.
[0096] In this embodiment, the negative sample template set may include: a dictionary negative template obtained by filling a template slot with a unit of the sample fragment after comparing the sample fragment with the entity name in the entity naming dictionary. The negative sample template set may also include: a text negative template obtained after filling a template slot with the sample fragment.
[0097] The method for constructing sample sentences provided in this embodiment constructs positive sample sentences through a positive sample template set, and constructs negative sample sentences through a negative sample template set, thereby providing reliable corpus support for the generation of sample sentences.
[0098] Optionally, the above-mentioned constructing of sample sentences based on training samples and sample template sets also includes: detecting whether the number of at least one negative sample sentence is 1.5 times the number of at least one positive sample sentence; in response to the number of at least one negative sample sentence being not 1.5 times the number of at least one positive sample sentence, using text fragments other than the training samples and the negative sample template set to obtain negative sample sentences, until the number of all negative sample sentences obtained is 1.5 times the number of all positive sample sentences.
[0099] See also Figure 5 , which shows a process 500 of an embodiment of an entity recognition method provided by the present disclosure, and the entity recognition method may include the following steps:
[0100] Step 501, obtaining the text to be recognized.
[0101] In this embodiment, the execution subject on which the entity identification method runs can communicate with the terminal (such as Figure 1 The terminals 101 and 102 communicate with each other to obtain the text to be recognized sent by the terminals.
[0102] In this embodiment, the text to be recognized is text whose entity type cannot be determined. For example, the text to be recognized includes: XXX is in a certain area, but the entity type of XXX cannot be determined.
[0103] Step 502: Get a predicted sentence based on the text segment of the text to be recognized and a preset sample template set.
[0104] In this embodiment, after obtaining the text to be recognized, the text segments corresponding to the text to be recognized are listed, and the format of the text segments is similar to that of the sample segments. The units of the text segments are filled into a preset sample template set, and the sample template set gives all the predicted sentences corresponding to the units of the text segments of the text to be recognized. Based on the setting of the slots in the sample template set, the predicted sentences have entity types. In this embodiment, the format of the predicted sentences is the same as that of the sample sentences.
[0105] In this embodiment, in order to improve the prediction efficiency, the execution entity may also limit the length of the text segment so that the continuous byte segment range in the text segment is between 1-8.
[0106] Step 503: Use the prediction sentence and entity recognition model to predict the text to be recognized and obtain the recognition result of the text to be recognized.
[0107] In this embodiment, the text fragment and the predicted sentence of the text to be recognized are input into the entity recognition model. The entity recognition model will assign a prediction score to the positive sample in the predicted sentence for each entity type in the predicted sentence, and will also assign a prediction score to the negative sample in the predicted sentence. Finally, based on the size of the prediction score, the entity type corresponding to the highest score in the text fragment will be assigned.
[0108] In this embodiment, the recognition result of the text to be recognized includes: prediction scores of the text segments of the text to be recognized belonging to different entity types. The prediction scores of the text segments can be used to determine the prediction scores of the entity types of the text to be recognized.
[0109] In this embodiment, the entity recognition model is trained based on the entity recognition model training method of this embodiment. The entity recognition model is generated by the entity recognition model training method of the above embodiment, wherein the specific generation process of the entity recognition model can be referred to in Figure 2 The relevant description of the embodiments will not be repeated here.
[0110] It should be noted that the entity recognition method of this embodiment can be used to test the entity recognition model generated by the above embodiments. Then, the entity recognition model can be continuously optimized according to the test results. This method can also be a practical application method of the entity recognition model generated by the above embodiments. Using the entity recognition model generated by the above embodiments to identify the entity type in the test sentence helps to improve the recognition efficiency of the entity.
[0111] The entity recognition method provided by the embodiment of the present disclosure first obtains the text to be recognized; secondly, inputs the text fragment in the text to be recognized into a preset sample template set to obtain a predicted sentence; finally, the predicted sentence and the entity recognition model are used to predict the text to be recognized, and the recognition result of the text to be recognized is obtained. Thus, the predicted sentence is recognized by the pre-trained entity recognition model to obtain the recognition result of the text to be recognized, and the entity type to which the text to be recognized belongs can be quickly identified, thereby improving the efficiency of entity recognition.
[0112] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an entity recognition model training device, which is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0113] like Figure 6 As shown, an embodiment of the present disclosure provides an entity recognition model training device 600, and the device 600 includes: a sample acquisition unit 601, a template construction unit 602, a sample construction unit 603, and a training unit 604. Among them, the above-mentioned sample acquisition unit 601 can be configured to obtain training samples, and the training samples include: sample fragments with entity type labels. The above-mentioned template construction unit 602 can be configured to construct a sample template set based on sample fragments and an entity naming dictionary. The above-mentioned sample construction unit 603 can be configured to construct a sample sentence based on the training sample and the sample template set. The above-mentioned training unit 604 can be configured to train a pre-trained language network based on sample sentences and sample fragments to obtain an entity recognition model corresponding to the pre-trained language network, and the pre-trained language network is used to characterize the correspondence between entity fragments and entity sentences.
[0114] In this embodiment, the specific processing of the sample acquisition unit 601, the template construction unit 602, the sample construction unit 603, and the training unit 604 and the technical effects thereof can be referred to in detail. Figure 2 Corresponding to step 201, step 202, step 203, and step 204 in the embodiment.
[0115] In some embodiments, the pre-trained language network is used to predict the correspondence between address fragments and address sentences. The above-mentioned device 600 also includes: a noise adding unit (not shown in the figure), which can be configured to adopt a noise adding strategy to improve the pre-trained language network when the pre-trained language network is trained; the noise adding strategy includes at least one of the following: making the token masking task include masking any address text; making the token removal task include removing any address text; making the continuous token masking task include masking a continuous address; making the sentence sorting task include determining whether two addresses are adjacent.
[0116] In some embodiments, the template construction unit 602 is further configured to: determine the dictionary positive template based on sample fragments, entity types, and entity naming dictionaries; determine the dictionary negative template based on sample fragments; and obtain a sample template set based on the dictionary positive template and the dictionary negative template.
[0117] In some embodiments, the template construction unit 602 is further configured to: determine a text positive template based on sample fragments and entity types; determine a text negative template based on sample fragments; determine a dictionary positive template based on sample fragments, entity types, and entity naming dictionaries; determine a dictionary negative template based on sample fragments; obtain a sample template set based on the text positive template, the text negative template, the dictionary positive template, and the dictionary negative template.
[0118] In some embodiments, the sample template set includes: a positive sample template set and a negative sample template set, and the sample construction unit 603 is further configured to: fill the entity type and text fragment into the positive sample template set to obtain at least one positive sample sentence; based on the samples without entity type labels and negative sample templates in the training samples, obtain at least one negative sample sentence; use at least one negative sample sentence and at least one negative sample sentence as sample sentences.
[0119] The entity recognition model training device provided by the embodiment of the present disclosure, firstly, the sample acquisition unit 601 acquires the training sample, and the training sample includes: a sample segment with an entity type label; secondly, the template construction unit 602 constructs a sample template set based on the sample segment and the entity naming dictionary; thirdly, the sample construction unit 603 constructs a sample sentence based on the training sample and the sample template set; finally, the training unit 604 trains the pre-trained language network based on the sample sentence and the sample segment to obtain the entity recognition model corresponding to the pre-trained language network. Therefore, by introducing the template to transform the original sample segment into a sample sentence, and training the entity recognition model based on the sample sentence, the entity recognition model can judge the sample sentence and give a judgment result, so that the named entity recognition task of a small sample can obtain a better recognition effect in the case of a sample, thereby improving the efficiency of entity recognition; further, the use of the entity naming dictionary enriches the template construction method, and enhances the robustness and accuracy of the entity recognition model training.
[0120] Further references Figure 7 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an entity recognition device, which is similar to Figure 5 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0121] like Figure 7 As shown, an embodiment of the present disclosure provides an entity recognition device 700, and the device 700 includes: a text acquisition unit 701, an obtaining unit 702, and a prediction unit 703. Among them, the above-mentioned text acquisition unit 701 can be configured to obtain a text to be recognized. The above-mentioned obtaining unit 702 can be configured to obtain a predicted sentence based on a text segment of the text to be recognized and a preset sample template set. The above-mentioned prediction unit 703 can be configured to use the predicted sentence and the entity recognition model to predict the text to be recognized and obtain the recognition result of the text to be recognized.
[0122] In this embodiment, the entity recognition model is trained using an entity recognition model training device.
[0123] In this embodiment, the specific processing of the text acquisition unit 701, the obtaining unit 702, and the prediction unit 703 and the technical effects thereof can be referred to in Figure 5 Corresponding to step 501, step 502, and step 503 in the embodiment.
[0124] In the entity recognition device provided by the embodiment of the present disclosure, first, the text acquisition unit 701 acquires the text to be recognized; secondly, the acquisition unit 702 inputs the text fragment in the text to be recognized into a preset sample template set to obtain a predicted sentence; finally, the prediction unit 703 uses the predicted sentence and the entity recognition model to predict the text to be recognized and obtain the recognition result of the text to be recognized. Thus, the predicted sentence is recognized by the pre-trained entity recognition model to obtain the recognition result of the text to be recognized, and the entity type to which the text to be recognized belongs can be quickly identified, thereby improving the efficiency of entity recognition.
[0125] It should be noted that in the technical solution of the present invention, the collection, use, storage, sharing and transfer of user personal information involved are in compliance with the provisions of relevant laws and regulations, and it is necessary to inform the user and obtain the user's consent or authorization. When applicable, the user's personal information is de-identified and / or anonymized and / or encrypted.
[0126] Reference below Figure 8 , which shows a structural schematic diagram of an electronic device 800 suitable for implementing an embodiment of the present disclosure.
[0127] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0128] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 8 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0129] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0130] It should be noted that the computer-readable medium of the embodiment of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiment of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the embodiment of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0131] The computer-readable medium may be included in the server; or it may exist independently without being installed in the server. The computer-readable medium carries one or more programs. When the one or more programs are executed by the server, the server: obtains training samples, the training samples include: sample segments with entity type labels; constructs a sample template set based on the sample segments and the entity naming dictionary; constructs sample sentences based on the training samples and the sample template set; trains a pre-trained language network based on the sample sentences and sample segments to obtain an entity recognition model corresponding to the pre-trained language network, and the pre-trained language network is used to characterize the correspondence between entity segments and entity sentences.
[0132] Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0133] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The described units may also be arranged in a processor, for example, may be described as: a processor including a sample acquisition unit, a template construction unit, a sample construction unit, and a training unit. The names of these units do not constitute limitations on the units themselves in certain circumstances, for example, the sample acquisition unit may also be described as a unit "configured to acquire training samples, the training samples including: sample fragments with entity type labels".
[0135] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.< / s>
Claims
1. A method for training an entity recognition model, the method include: Acquire training samples, wherein the training samples include: sample segments with entity type labels; Building a sample template set based on the sample fragments and entity naming dictionary; Constructing a sample sentence based on the training sample and the sample template set; Based on the sample sentences and the sample fragments, a pre-trained language network is trained to obtain an entity recognition model corresponding to the pre-trained language network, and the pre-trained language network is used to characterize the corresponding relationship between the entity fragments and the entity sentences.
2. The method according to claim 1, wherein the pre-trained language network is used to predict the correspondence between address segments and address sentences, and the method further include: When training the pre-trained language network, adopting a noise adding strategy to improve the pre-trained language network; The noise adding strategy includes at least one of the following: Make the token masking task include masking any address text; Make the token removal task include removing any address text; Making the continuous token masking task include masking a continuous range of addresses; The task of ordering statements involves determining whether two addresses are adjacent.
3. The method according to claim 1, in, Based on the sample fragments and entity naming dictionary, constructing a sample template set includes: Determine a dictionary positive template based on the sample fragment, the entity type, and the entity naming dictionary; Based on the sample fragment, determining a negative template of the dictionary; The sample template set is obtained based on the dictionary positive template and the dictionary negative template.
4. The method according to claim 1, in, Based on the sample fragments and entity naming dictionary, constructing a sample template set includes: Determine a text positive template based on the sample fragment and the entity type; Based on the sample fragment, determining a text negative template; Determine a dictionary positive template based on the sample fragment, the entity type, and the entity naming dictionary; Based on the sample fragment, determining a negative template of the dictionary; A sample template set is obtained based on the text positive template, the text negative template, the dictionary positive template and the dictionary negative template.
5. The method according to any one of claims 1 to 4, in, The sample template set includes: a positive sample template set and a negative sample template set, and constructing a sample sentence based on the training sample and the sample template set includes: Based on the positive sample template set, obtaining at least one positive sample sentence; Based on the samples without entity type labels in the training samples and the negative sample template set, obtaining at least one negative sample sentence; The at least one positive sample sentence and the at least one negative sample sentence are used as sample sentences.
6. A method for entity recognition, the method comprising: include: Get the text to be recognized; Obtaining a predicted sentence based on the text segment of the text to be recognized and a preset sample template set; The predicted sentence and entity recognition model are used to predict the text to be recognized to obtain a recognition result of the text to be recognized. The entity recognition model is trained using the entity recognition model training method described in any one of claims 1 to 5.
7. An entity recognition model training device, the device include: The sample acquisition unit is configured to acquire a training sample, wherein the training sample includes: a sample segment with an entity type label; A template construction unit, configured to construct a sample template set based on the sample fragments and the entity naming dictionary; A sample construction unit, configured to construct a sample sentence based on the training sample and the sample template set; The training unit is configured to train a pre-trained language network based on the sample sentences and the sample fragments to obtain an entity recognition model corresponding to the pre-trained language network, wherein the pre-trained language network is used to characterize the correspondence between entity fragments and entity sentences.
8. An entity recognition device, the device include: A text acquisition unit, configured to acquire a text to be recognized; An obtaining unit is configured to obtain a predicted sentence based on the text segment of the text to be recognized and a preset sample template set; The prediction unit is configured to use the predicted sentence and the entity recognition model to predict the text to be recognized and obtain the recognition result of the text to be recognized. The entity recognition model is trained using the entity recognition model training device described in claim 7.
9. An electronic device, include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
10. A computer readable medium having a computer program stored thereon, in, When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Text data processing method, device, electronic device and computer-readable medium
CN109299472A
Entity identification method and device based on multilayer model, equipment and storage medium
CN111738008A
Scientific and technological resource relation extraction method and device based on pre-training language model
CN112989813A
Knowledge prompt fused legal text small sample named entity recognition method
CN115062104A
Small sample named entity recognition model training method and recognition method
CN115759103A
