Method, device, electronic device and storage medium for entity recognition in text information

The text information is divided through clustering and preset division schemes, and continued training is carried out based on the pre-trained model. This solves the problem of complexity and manual consumption in the text information entity recognition process, and achieves efficient automatic annotation and accurate recognition.

CN113255355BActive Publication Date: 2024-09-20BEIJING MININGLAMP SOFTWARE SYST CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110634748.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-08
Publication Date
2024-09-20
Estimated Expiration
2041-06-08

AI Technical Summary

Technical Problem

In the existing technology, the text information entity recognition process is complex and labor-intensive, the rule-based method is cumbersome and relies on manual annotation, and the machine learning model lacks data sensitivity in the field and is inefficient.

Method used

Divide text information into unlabeled and labeled information through clustering and preset division schemes, continue training based on the pre-trained model, and generate an initial training model for entity recognition in text information to achieve automatic annotation and improve recognition accuracy. .

Benefits of technology

It simplifies the entity recognition process, reduces the need for manual labeling, improves labeling efficiency and recognition accuracy, and enhances the generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113255355B
    Figure CN113255355B
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for entity recognition in text information, which belongs to the field of entity recognition technology. The method includes: clustering multiple text information to obtain multiple clusters through a clustering scheme; dividing the text information in each of the clusters into unlabeled information and labeled information through a preset division scheme; clustering and dividing the unlabeled information of multiple clusters through the clustering scheme and the preset division scheme until no new labeled information can be obtained; continuing training based on the text information based on the pre-trained model to obtain an initial training model; model training is performed on all the text information based on the initial training model, so as to identify entities in the text information through the trained model. The present application improves the annotation efficiency and improves the model generalization ability and training accuracy by continuing training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of entity recognition, and in particular to a method, device, electronic device and storage medium for entity recognition in text information. Background Art

[0002] With the continuous development of Internet technology, entity recognition from text information has been widely used. For example, instant messaging tools have group chat functions, through which users can communicate. The group chat interface includes the group chat name. For enterprises, the group chat name often includes the customer name. Extracting the customer name from the group chat name has practical application value for enterprises.

[0003] There are two main methods for identifying entities from text information: one is a rule-based extraction method, and the other is a machine learning method. The rule-based extraction method requires manual summary of the rules contained in the text information, pre-definition of some rules based on these rules, and then combining dictionaries, word segmentation tools and the above rules to identify entities. If the entity is a customer name, since the customer names in group chat names often appear in colloquial forms, abbreviations, pinyin initials, etc., this makes the quality of the group chat name too poor, the word segmentation tool will no longer be applicable, and the dictionary needs to be reconstructed. The rule-based method is complicated to implement.

[0004] The machine learning-based method is to use a large amount of annotation information to construct a training information set, select the corresponding machine learning model for training, and finally use the trained model to identify and extract entities in text information. Currently, annotation information is manually annotated, and a large amount of annotation information consumes manpower and is inefficient.

[0005] In addition, machine learning in the existing technology relies on feature construction and often uses pre-trained models trained on large-scale general corpus, but the pre-trained models lack sensitivity to data in the field. Summary of the invention

[0006] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for entity recognition in text information to solve the problem that the entity recognition process is complex and labor-intensive. The specific technical solution is as follows:

[0007] In a first aspect, a method for identifying entities in text information is provided, the method comprising:

[0008] Clustering the multiple text information into multiple clusters through a clustering scheme, wherein each of the clusters contains at least one text information;

[0009] Dividing the text information in each of the clusters into unlabeled information and labeled information by a preset division scheme, wherein the preset division scheme is associated with the same entity in the text information;

[0010] Clustering and dividing the unlabeled information of the plurality of clusters by the clustering scheme and the preset division scheme until no new labeled information can be obtained;

[0011] Based on the pre-trained model, further training is performed on the text information to obtain an initial training model, wherein the pre-trained model is a model generated based on large-scale general corpus training;

[0012] Model training is performed on all the text information based on the initial training model, so as to identify entities in the text information through the trained model.

[0013] Optionally, dividing the text information in each cluster into labeled information by a preset division scheme includes:

[0014] Determine the target entity that appears most frequently in the text information of the cluster;

[0015] Determining the number of occurrences of the target entity and the number of texts in the text information in the cluster;

[0016] When the number of occurrences and the amount of text satisfy a preset ratio, determining all text information in the cluster as label information to be selected;

[0017] The text information carrying the target entity in the to-be-selected tag information is used as the tagged information.

[0018] Optionally, dividing the text information in each cluster into unlabeled information by a preset division scheme includes:

[0019] When the number of occurrences and the amount of text do not satisfy a preset ratio, determining that all text information in the cluster is unlabeled information;

[0020] The text information that does not carry the target entity in the candidate tag information is regarded as unlabeled information.

[0021] Optionally, after taking the text information carrying the target entity in the to-be-selected tag information as the tagged information, the method further includes:

[0022] Using the target entity as a label for the labeled information;

[0023] The labeled information is marked in a preset marking manner to obtain the marked information.

[0024] Optionally, continuing training based on the text information based on the pre-trained model includes:

[0025] The plurality of text information are input into the pre-trained model so that the pre-trained model continues to be trained based on the text information to obtain a pre-trained model after continued training. The pre-trained model is used to obtain the prior information hidden in the text information, and the prior information includes the structural information and format information in the text information.

[0026] Optionally, performing model training on all labeled information based on the initial training model includes:

[0027] Inputting the text information into the pre-trained model after continued training to obtain a target vector of the text information output by the pre-trained model after continued training, wherein the target vector is associated with the word granularity of the text information;

[0028] Inputting the target vector into a recognition model to obtain prediction information corresponding to the text information output by the recognition model;

[0029] The parameters of the loss function are updated according to the prediction information and the annotation information until the difference between the prediction information and the annotation information is minimized, wherein the weight of the pre-trained model after continued training is updated during the parameter update process of the loss function.

[0030] Optionally, clustering the multiple text information through a clustering scheme to obtain multiple clusters includes:

[0031] Inputting initial text information into a vector model to obtain vector information of the initial text information output by the vector model;

[0032] Clustering the plurality of vector information to obtain a plurality of clusters through a clustering scheme, wherein each of the clusters contains at least one vector information;

[0033] The vector information in each of the clusters is mapped to text information according to a mapping relationship, wherein the mapping relationship is a mapping relationship between the vector information and the text information.

[0034] In a second aspect, a device for identifying entities in text information is provided, the device comprising:

[0035] A clustering module, used for clustering a plurality of text information into a plurality of clusters through a clustering scheme, wherein each of the clusters contains at least one text information;

[0036] A division module, used for dividing the text information in each of the clusters into unlabeled information and labeled information by a preset division scheme, wherein the preset division scheme is associated with the same entity in the text information;

[0037] A clustering and partitioning module, used to cluster and partition the unlabeled information of the plurality of clusters by using the clustering scheme and the preset partitioning scheme until no new labeled information can be obtained;

[0038] A continuing training module, used for continuing training based on the pre-training model on the basis of the text information to obtain an initial training model, wherein the pre-training model is a model generated based on large-scale general corpus training;

[0039] A training module is used to perform model training on all the text information based on the initial training model, so as to identify entities in the text information through the trained model.

[0040] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0041] Memory, used to store computer programs;

[0042] The processor is used to implement any of the steps of the entity recognition method in text information when executing the program stored in the memory.

[0043] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements any of the steps of the entity recognition method in text information.

[0044] Beneficial effects of the embodiments of the present application:

[0045] The present application is applied to natural language processing in the field of deep learning technology. The embodiment of the present application provides a method for entity recognition in text information. The server clusters multiple text information to obtain multiple clusters through a clustering scheme, and divides the text information in each cluster into unlabeled information and labeled information through a preset division scheme. The unlabeled information of multiple clusters is clustered and divided through the clustering scheme and the preset division scheme until no new labeled information can be obtained. Finally, the pre-trained model is used to continue training on the basis of the text information to obtain an initial training model. The model training is performed on all text information based on the initial training model to identify entities in the text information through the trained model. In the present application, multiple clusters are first obtained through clustering, and then the text information in each cluster is divided into unlabeled information and labeled information. Since there are multiple clusters, the unlabeled information of multiple clusters can be comprehensively summarized and clustered and divided again. In this way, the labeled information can be found to the maximum extent, and the amount of labeled information can be increased. The annotation method is simple, and there is no need to set rules. The server also realizes automatic annotation, and there is no need to manually annotate data, thereby improving the annotation efficiency. The continued training of this application obtains the prior information hidden in the text information, improves the accuracy of entity recognition in the text information, and improves the generalization ability of the model.

[0046] Of course, implementing any product or method of the present application does not necessarily require achieving all of the above advantages at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0048] Figure 1 A flow chart of a method for entity recognition in text information provided in an embodiment of the present application;

[0049] Figure 2 A schematic diagram of model training provided in an embodiment of the present application;

[0050] Figure 3 A schematic diagram of the structure of an entity recognition device in text information provided by an embodiment of the present application;

[0051] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0053] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.

[0054] In order to solve the problem mentioned in the background technology, according to one aspect of an embodiment of the present application, an embodiment of a method for entity recognition in text information is provided.

[0055] An embodiment of the present application provides a method for identifying entities in text information, which can be applied to a server to identify entities from text information.

[0056] The following will describe in detail a method for identifying entities in text information provided by an embodiment of the present application in conjunction with a specific implementation method. Figure 1 As shown, the specific steps are as follows:

[0057] Step 101: clustering multiple text information into multiple clusters using a clustering scheme.

[0058] Each cluster contains at least one text information.

[0059] In an embodiment of the present application, the server needs to automatically annotate multiple text messages. Therefore, it is necessary to first cluster the multiple text messages through a clustering scheme to obtain multiple clusters, each cluster containing at least one text message. Each text message may include at least an entity, or may not include an entity. Among them, the clustering scheme may also be a K-Means clustering algorithm, and the present application does not specifically limit the clustering scheme.

[0060] Step 102: Divide the text information in each cluster into unlabeled information and labeled information using a preset division scheme.

[0061] The preset division scheme is associated with the same entity in the text information.

[0062] In an embodiment of the present application, for multiple text messages in each cluster, the server determines the same entity in the multiple text messages, determines a preset division scheme based on the number of occurrences of the same entity and the amount of text messages, and then divides the text information into unlabeled information and labeled information. The unlabeled information does not carry a label, and the labeled information carries a label, which can be determined by the same entity.

[0063] Step 103: Clustering and dividing the unlabeled information of multiple clusters through a clustering scheme and a preset division scheme until no new labeled information can be obtained.

[0064] In the embodiment of the present application, after the server obtains the unlabeled information, since each cluster can obtain the unlabeled information, the server can comprehensively summarize the multiple unlabeled information, and then cluster the multiple unlabeled information according to the clustering scheme and then divide them according to the preset division scheme to obtain new labeled information and new unlabeled information again. Then repeat the above steps for the obtained unlabeled information until no new labeled information can be obtained. In this way, after multiple iterations, the labeled information can be mined to the maximum extent. For the remaining unlabeled information, the server can set its label as a negative sample of the training corpus.

[0065] Step 104: Continue training based on the pre-trained model on the basis of the text information to obtain an initial training model.

[0066] Among them, the pre-trained model is a model generated based on large-scale general corpus training.

[0067] In an embodiment of the present application, the pre-trained model is a model trained based on a large-scale general corpus in Chinese. The present application continues training based on the pre-trained model on the basis of text information to obtain an initial training model, which can obtain prior information hidden in the text information, improve the accuracy of entity recognition in the text information, and improve the generalization ability of the initial training model.

[0068] Step 105: Perform model training on all labeled information based on the initial training model, so as to identify entities in the text information through the trained model.

[0069] In an embodiment of the present application, the pre-trained model is a sub-model in the initial training model. After improving the accuracy of entity recognition in text information through the pre-trained model, the present application performs model training on all labeled information based on the initial training model, so that the trained model can recognize entities more accurately.

[0070] In the present application, multiple clusters are first obtained by clustering, and then the text information in each cluster is divided into unlabeled information and labeled information. Since there are multiple clusters, the unlabeled information of multiple clusters can be comprehensively summarized, and clustered and divided again, so that the labeled information can be found to the maximum extent and the amount of labeled information can be increased. In the process of identifying entities, word segmentation and dictionaries are not used, and there is no need to set rules, which simplifies the identification method and realizes automatic labeling by the server. There is no need to manually label data, which saves manpower and improves labeling efficiency. The continued training of the present application obtains the prior information hidden in the text information, improves the accuracy of entity recognition in the text information, improves the generalization ability of the model, and makes the subsequent model recognize entities more accurately.

[0071] As an optional implementation, dividing the text information in each cluster into labeled information through a preset division scheme includes: determining the target entity that appears most frequently in the text information of the cluster; determining the number of occurrences of the target entity and the amount of text in the text information in the cluster; when the number of occurrences and the amount of text meet a preset ratio, determining all the text information in the cluster as information to be selected for labeling; and using the text information carrying the target entity in the information to be selected for labeling as labeled information.

[0072] In an embodiment of the present application, after obtaining multiple text information in each cluster, the server determines the target entity that appears most frequently in the text information, determines the number of texts in the multiple text information, and then determines the quotient of the number of occurrences and the number of texts.

[0073] If the server determines that the quotient is greater than the preset threshold, indicating that the target entity appears more times in the text information, then most of the text information in the cluster contains the target entity, and the target entity can be used as the label of the cluster, and all the text information in the cluster is the candidate label information. However, there is still the first label information that does not contain the target entity in the candidate label information, so the server traverses the candidate label information, removes the first label information, and uses the candidate label information containing the target entity as the labeled information, so that the labeled information contains the corresponding target entity, which improves the accuracy of the label.

[0074] Among them, the preset threshold can be set to 0.5. The quotient of the number of occurrences of the target entity and the amount of text information is greater than 0.5, indicating that more than half of the text information includes the target entity. Then, using the target entity as the label of the cluster is representative and can represent most of the text information.

[0075] For example, the text information is the name of a group chat in an instant messaging tool. The text information in a cluster includes "xx sports group", "xx sports squad", "xx sports group", and "xx celebrity group". The target entity with the most appearances is "sports". The number of appearances of "sports" is 4, and there are 5 text information. 4 / 5>0.5, so "sports" is used as the label of the cluster, and all text information in the cluster is the candidate label information. Since "xx celebrity group" does not contain the target entity "sports", it is necessary to remove "xx celebrity group" from the cluster. The remaining "xx sports group", "xx sports squad", and "xx sports group" all contain "sports" and can be used as labeled information.

[0076] As an optional implementation, the text information in each cluster is divided into unlabeled information through a preset division scheme, including: when the number of occurrences and the amount of text do not meet a preset ratio, determining that all text information in the cluster is unlabeled information; and treating the text information that does not carry the target entity in the selected label information as unlabeled information.

[0077] In an embodiment of the present application, the server determines the quotient of the number of occurrences of the target entity and the amount of text information. If the server determines that the quotient is not greater than a preset threshold, it indicates that the target entity appears in the text information less frequently and the label of the cluster cannot be determined. In this case, the text information in the cluster is treated as unlabeled information.

[0078] In addition, in the above description, the server traverses the tag information to be selected, and removes the first tag information that does not contain the target entity, and the first tag information is also regarded as untagged information.

[0079] Exemplarily, the text information is the name of a group chat in an instant messaging tool. The text information in a cluster includes "xx sports group", "xx eating team", "xx basketball group", and "xx celebrity group". There is one text fragment for each cluster, and the number of text messages is 4. The preset threshold is set to 0.5, and the quotient of the number of occurrences of the text fragment and the number of text messages is not greater than 0.5. Therefore, the label of the cluster cannot be determined, and the four text messages in the cluster are all unlabeled information.

[0080] Exemplarily, the text information is the name of a group chat in an instant messaging tool. The text information in a cluster includes "xx sports group", "xx sports team", "xx sports group", and "xx celebrity group". "Sports" is used as the label of the cluster, and "xx celebrity group" is removed from the cluster and used as unlabeled information.

[0081] Optionally, after obtaining multiple unlabeled information, the server only divides the text information with different labels into one cluster because the unlabeled information is all the text information in a cluster (the number of occurrences of the target entity and the amount of text do not meet the preset ratio), or the unlabeled information is part of the text information in a cluster (the first label information), but does not meet the label of the current cluster. Therefore, the server can cluster and divide all the unlabeled information again, and may also divide out new labeled information to increase the amount of labeled information. The server repeats the above clustering and division steps for each unlabeled information obtained until no new labeled information can be obtained. In this way, after multiple iterations, the labeled information can be mined to the maximum extent.

[0082] As an optional implementation, after taking the text information carrying the target entity in the selected tag information as the labeled information, the method also includes: taking the target entity as the label of the labeled information; marking the labeled information by a preset marking method to obtain the labeled information.

[0083] In an embodiment of the present application, the server determines the quotient of the number of occurrences of the target entity and the number of texts. If the quotient is greater than a preset threshold, it indicates that the target entity appears more frequently in the text information, and most of the text information in the cluster contains the target entity. After the server removes the first label information that does not contain the target entity from the cluster, the obtained labeled information contains the target entity, and the target entity can be used as the label of the labeled information. The server then labels the labeled information using a preset labeling method, with the label being the target entity, to obtain the labeled information. The preset labeling method can be in BIO (B-begin, I-inside, O-outside) format. Unlabeled information can also be labeled using BIO, and input into the initial training model during the training process. Unlabeled information is used as a negative sample, which can play a role in data enhancement.

[0084] As an optional implementation, continuing training based on the text information based on the pre-trained model includes: inputting multiple text information into the pre-trained model so that the pre-trained model continues to be trained based on the text information to obtain a pre-trained model after continued training. The pre-trained model is used to obtain prior information hidden in the text information, and the prior information includes structural information and format information in the text information.

[0085] In an embodiment of the present application, after obtaining all the labeled information, the server first inputs multiple text information into the pre-trained model to obtain a pre-trained model after continued training. The pre-trained model is further trained on the basis of the text information. The pre-trained model is used to obtain the prior information hidden in the text information. The prior information includes the structural information and format information in the text information. Continuous training based on the prior information can make the target vector output by the pre-trained model more consistent with the labeled information in the subsequent training process. In the process of using the model, the accuracy of entity recognition in the text information is improved, and the generalization ability of the model is improved.

[0086] As an optional implementation, model training of all labeled information based on the initial training model includes: inputting text information into a pre-trained model after continued training to obtain a target vector of the text information output by the pre-trained model after continued training, wherein the target vector is associated with the character granularity of the text information; inputting the target vector into a recognition model to obtain prediction information corresponding to the text information output by the recognition model; updating the parameters of the loss function according to the prediction information and the annotation information until the difference between the prediction information and the annotation information is minimized, wherein the weights of the pre-trained model after continued training will be updated during the update of the parameters of the loss function.

[0087] In an embodiment of the present application, after the server continues to train the pre-trained model, it is still necessary to train the initial model. Specifically, the server inputs the text information into the pre-trained model after continued training, and obtains the target vector of the text information output by the pre-trained model after continued training. The target vector is associated with the word granularity of the text information. The output of the pre-trained model can be used as a vector representation of the text information at the word granularity. The information carried by vectors of different granularities is slightly different. Integrating vectors of different granularities is better than a single vector representation in most cases. Since the pre-trained model improves the model generalization ability during the continued training process, the pre-trained model can improve the accuracy of entity recognition in the pre-trained model after continued training. Among them, the pre-trained model can be a BERT (Bidirectional Encoder Representation from Transformers) model or an ENRIE (Enhanced Representation from kNowledgeIntEgration), and the present application does not limit the specific implementation of the pre-trained model.

[0088] The server then inputs the target vector into the recognition model to obtain the prediction information corresponding to the text information output by the recognition model. The server constructs a loss function, and then updates the parameters of the loss function according to the prediction information and the annotation information until the difference between the prediction information and the annotation information is minimized, and the loss function training is completed. The parameters of the loss function include the weights of the pre-trained model after continued training. The weights of the pre-trained model after continued training will be updated during the parameter update process of the loss function, so that the pre-trained model after continued training can more accurately identify entities. The recognition model can be a BILSTM model and a CRF (Conditional Random Field) model.

[0089] This application adopts the BERT+BILSTM+CRF model, which takes into account the word granularity of text information and the update of model weights, and improves the accuracy of model training.

[0090] Figure 2 This is a schematic diagram of model training, such as Figure 2 As shown, the server first continues to train the BERT model through text information, and then inputs the text information and annotation information into the trained BERT model, BILSTM model, and CRF model in turn to complete the model training process.

[0091] As an optional implementation, clustering multiple text information to obtain multiple clusters through a clustering scheme includes: inputting initial text information into a vector model to obtain vector information of the initial text information output by the vector model; clustering multiple vector information to obtain multiple clusters through a clustering scheme, wherein each cluster contains at least one vector information; mapping the vector information in each cluster to text information according to a mapping relationship, wherein the mapping relationship is a mapping relationship between the vector information and the text information.

[0092] In an embodiment of the present application, the server inputs the initial text information into the vector model, obtains the vector information of the initial text information output by the vector model, and then clusters the multiple vector information through a clustering scheme to obtain multiple clusters, each cluster containing at least one vector information. Since the subsequent determination of unlabeled information and labeled information is for text information, it is also necessary to convert the vector information into text information. The mapping relationship between the vector information and the text information is stored in the server, and the server maps the vector information in each cluster to text information according to the mapping relationship. Among them, the vector model can be a bag of words model or Word2vec, and the present application does not make specific restrictions on the vector model.

[0093] Before the server inputs the initial text information into the vector model, the server first removes the stop words from the original text information through a preset stop word removal scheme to obtain the initial text information. Specifically, the server uses stop word removal to remove prepositions, modal particles and some words without practical meaning, which can greatly increase the efficiency of subsequent text information processing.

[0094] Optionally, an embodiment of the present application also provides a processing flow chart for entity identification, and the specific steps are as follows.

[0095] Step 1: Perform a stop operation on the original text information to obtain initial text information, and vectorize the initial text information to obtain vector information.

[0096] Step 2: Cluster multiple vector information into k clusters through a clustering scheme, and determine the text information in each cluster, where the text information is the group chat name information (group name information).

[0097] Step 3: Traverse the Mk group name information in cluster k (k = 1, 2, 3 ... K) to find the target entity S that appears most frequently in the Mk group name information;

[0098] Step 4: Set the number of occurrences to N. If N ≥ 0.5Mk, set the target entity S as the label of cluster k. Remove the group name information that does not contain the target entity S in cluster k, and use the remaining group name information in the cluster as the labeled information.

[0099] Step 5: If N<0.5Mk, determine that all group name information in the cluster is unlabeled information, and treat the group name information removed in step 4 as unlabeled information.

[0100] Step 6: Repeat steps 2 to 5 for unlabeled information until no new labeled information can be obtained.

[0101] Step 7: Use the BERT model to continue training the initial text information, and use the BERT+BILSTM+CRF model after continued training to train the initial text information.

[0102] Step 8: Use the BERT+BILSTM+CRF model to identify entities in group name information.

[0103] Based on the same technical concept, the embodiment of the present application also provides a device for identifying entities in text information, such as Figure 3 As shown, the device comprises:

[0104] A clustering module 301 is used to cluster multiple text information into multiple clusters through a clustering scheme, wherein each cluster contains at least one text information;

[0105] A division module 302, configured to divide the text information in each cluster into unlabeled information and labeled information by a preset division scheme, wherein the preset division scheme is associated with the same entity in the text information;

[0106] The clustering and partitioning module 303 is used to cluster and partition the unlabeled information of multiple clusters through a clustering scheme and a preset partitioning scheme until no new labeled information can be obtained;

[0107] A continuing training module 304 is used to continue training based on the pre-training model on the basis of the text information to obtain an initial training model, wherein the pre-training model is a model generated based on large-scale general corpus training;

[0108] The training module 305 is used to perform model training on all labeled information based on the initial training model, so as to identify entities in the text information through the trained model.

[0109] Optionally, the dividing module 302 includes:

[0110] A first determination unit, used to determine the target entity that appears most frequently in the text information of the cluster;

[0111] A second determination unit is used to determine the number of occurrences of the target entity and the number of texts of the text information in the cluster;

[0112] A third determination unit is used to determine all text information in the cluster as label information to be selected when the number of occurrences and the number of texts meet a preset ratio;

[0113] The first is a unit for taking text information carrying a target entity in the to-be-selected tag information as the labeled information.

[0114] Optionally, the dividing module 302 includes:

[0115] A fourth determination unit, configured to determine that all text information in the cluster is unlabeled information when the number of occurrences and the number of texts do not satisfy a preset ratio;

[0116] The second is a unit for treating text information that does not carry the target entity in the to-be-selected label information as unlabeled information.

[0117] Optionally, the device comprises:

[0118] As a module, it is used to take the target entity as a label with label information;

[0119] The marking module is used to mark the labeled information in a preset marking method to obtain the marked information.

[0120] Optionally, the continuing training module 304 includes:

[0121] An input unit, used for inputting a plurality of text information into a vector model, so that the vector model is continuously trained based on the text information, wherein the vector model is used for obtaining a priori information hidden in the text information, the a priori information including structural information and format information in the text information;

[0122] The output unit is used to obtain a training vector output by the vector model, wherein the training vector is associated with the word granularity of the text information.

[0123] Optionally, the training module 305 includes:

[0124] A first input-output unit is used to input text information into the pre-trained model after continued training, and obtain a target vector of the text information output by the pre-trained model after continued training, wherein the target vector is associated with the word granularity of the text information;

[0125] The second input-output unit is used to input the target vector into the recognition model to obtain prediction information corresponding to the text information output by the recognition model;

[0126] An updating unit is used to update the parameters of the loss function according to the prediction information and the labeling information until the difference between the prediction information and the labeling information is minimized, wherein the weights of the pre-trained model after continued training are updated during the parameter update process of the loss function.

[0127] Optionally, the clustering module 301 includes:

[0128] A fourth input-output unit, used for inputting the initial text information into the vector model to obtain vector information of the initial text information output by the vector model;

[0129] A clustering unit, used for clustering the plurality of vector information to obtain a plurality of clusters through a clustering scheme, wherein each cluster contains at least one vector information;

[0130] The mapping unit is used to map the vector information in each cluster into text information according to a mapping relationship, wherein the mapping relationship is a mapping relationship between the vector information and the text information.

[0131] According to another aspect of the embodiments of the present application, the present application provides an electronic device, such as Figure 4 As shown, it includes a memory 403, a processor 401, a communication interface 402 and a communication bus 404. The memory 403 stores a computer program that can be run on the processor 401. The memory 403 and the processor 401 communicate through the communication interface 402 and the communication bus 404. When the processor 401 executes the computer program, the steps of the above method are implemented.

[0132] The memory and processor in the above electronic device communicate via a communication bus and a communication interface. The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, an information bus, a control bus, etc.

[0133] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0134] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0135] According to another aspect of the embodiments of the present application, a computer-readable medium having a non-volatile program code executable by a processor is provided.

[0136] Optionally, in an embodiment of the present application, a computer-readable medium is configured to store program code for the processor to execute the above method.

[0137] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0138] When the embodiments of the present application are specifically implemented, reference may be made to the above-mentioned embodiments, which have corresponding technical effects.

[0139] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0140] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0141] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0143] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0146] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk. It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.

[0147] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A method for entity recognition in text information, characterized in that: The method comprises: Clustering the multiple text information into multiple clusters through a clustering scheme, wherein each of the clusters contains at least one text information; Dividing the text information in each of the clusters into unlabeled information and labeled information by a preset division scheme, wherein the preset division scheme is associated with the same entity in the text information; Clustering and dividing the unlabeled information of the plurality of clusters by the clustering scheme and the preset division scheme until no new labeled information can be obtained; Based on the pre-trained model, further training is performed on the text information to obtain an initial training model, wherein the pre-trained model is a model generated based on large-scale general corpus training; Performing model training on all the text information based on the initial training model, so as to identify entities in the text information through the trained model; Wherein, dividing the text information in each cluster into unlabeled information and labeled information by a preset division scheme includes: Determine the target entity that appears most frequently in the text information of the cluster; Determining the number of occurrences of the target entity and the number of texts in the text information in the cluster; In the case where the number of occurrences and the number of texts meet a preset ratio, all text information in the cluster is determined as the tag information to be selected, and the text information carrying the target entity in the tag information to be selected is used as the labeled information; When the number of occurrences and the amount of text do not satisfy a preset ratio, all text information in the cluster is determined to be unlabeled information; and text information that does not carry the target entity in the to-be-selected label information is regarded as unlabeled information.

2. The method according to claim 1, characterized in that After taking the text information carrying the target entity in the candidate tag information as the tagged information, the method further includes: Using the target entity as a label for the labeled information; The labeled information is marked in a preset marking manner to obtain the marked information.

3. The method according to claim 1, characterized in that Continuing training based on the pre-trained model and the text information includes: The multiple text information are input into the pre-trained model so that the pre-trained model continues to be trained based on the text information to obtain a pre-trained model after continued training, wherein the pre-trained model is used to obtain prior information hidden in the text information, and the prior information includes structural information and format information in the text information.

4. The method according to claim 2, characterized in that: Performing model training on all the text information based on the initial training model includes: Inputting the text information into the pre-trained model after continued training to obtain a target vector of the text information output by the pre-trained model after continued training, wherein the target vector is associated with the word granularity of the text information; Inputting the target vector into a recognition model to obtain prediction information corresponding to the text information output by the recognition model; The parameters of the loss function are updated according to the prediction information and the annotation information until the difference between the prediction information and the annotation information is minimized, wherein the weight of the pre-trained model after continued training is updated during the parameter update process of the loss function.

5. The method according to claim 1, characterized in that Through the clustering scheme, multiple text information is clustered to obtain multiple clusters including: Inputting initial text information into a vector model to obtain vector information of the initial text information output by the vector model; Clustering the plurality of vector information to obtain a plurality of clusters through a clustering scheme, wherein each of the clusters contains at least one vector information; The vector information in each of the clusters is mapped to text information according to a mapping relationship, wherein the mapping relationship is a mapping relationship between the vector information and the text information.

6. A device for identifying entities in text information, characterized in that: The device comprises: A clustering module, used for clustering a plurality of text information into a plurality of clusters through a clustering scheme, wherein each of the clusters contains at least one text information; A division module, used for dividing the text information in each of the clusters into unlabeled information and labeled information by a preset division scheme, wherein the preset division scheme is associated with the same entity in the text information; A clustering and partitioning module, used to cluster and partition the unlabeled information of the plurality of clusters by using the clustering scheme and the preset partitioning scheme until no new labeled information can be obtained; A continuing training module, used for continuing training based on the pre-training model on the basis of the text information to obtain an initial training model, wherein the pre-training model is a model generated based on large-scale general corpus training; A training module, used for performing model training on all the text information based on the initial training model, so as to identify entities in the text information through the trained model; Wherein, the division module is used for: Determine the target entity that appears most frequently in the text information of the cluster; Determining the number of occurrences of the target entity and the number of texts in the text information in the cluster; In the case where the number of occurrences and the number of texts meet a preset ratio, all text information in the cluster is determined as the tag information to be selected, and the text information carrying the target entity in the tag information to be selected is used as the labeled information; When the number of occurrences and the amount of text do not satisfy a preset ratio, all text information in the cluster is determined to be unlabeled information; and text information that does not carry the target entity in the to-be-selected label information is regarded as unlabeled information.

7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Event identification method and device based on text

    CN108563655A

  • Entity labeling model training method, and entity labeling method and device

    CN111143571A

  • Task execution method, device and equipment and computer readable storage medium

    CN112148952A

  • Chinese named-entity recognition method, device, and computer-readable storage medium

    WO2021068329A1