A method, device, equipment and storage medium for named entity recognition

By mining seed entity words in the new field and labeling data, training named entity recognition model, solving the problems of large workload of data annotation and poor field migration in the existing technology, and achieving more efficient named entity recognition.

CN110555206BActive Publication Date: 2024-11-29ZTE CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201810556103.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-06-01
Publication Date
2024-11-29
Estimated Expiration
2039-01-01

AI Technical Summary

Technical Problem

Existing named entity recognition technology requires a lot of data and manual workload, and the field migration is poor, resulting in the need to re-label data sets when applied in new fields.

Method used

Through the algorithm of mining seed entity words, entity recognition is performed on text data in the new field, data labeling workload is reduced, and named entity recognition model is trained using marked data, which is suitable for new fields.

Benefits of technology

It reduces the workload of data annotation, reduces the threshold for model migration training, improves the domain universality of the algorithm, and is suitable for a variety of scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110555206B_ABST
    Figure CN110555206B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and storage medium for named entity recognition, which relates to the fields of natural language processing, semantic analysis and understanding, artificial intelligence, etc. The method comprises: performing entity recognition on new domain text data to obtain seed entity words of the new domain; annotating the new domain text data according to the seed entity words of the new domain to obtain annotated new domain text data; training a named entity recognition model using the annotated new domain text data to obtain a named entity recognition model applicable to the new domain; and identifying entity words in other text data of the new domain using the named entity recognition model applicable to the new domain. The embodiments of the present invention can reduce the workload of data annotation, lower the threshold of model migration training, and improve the domain versatility of the algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of natural language processing, semantic analysis and understanding, artificial intelligence, and in particular to a NER (Named Entities Recognition) method, device, equipment and storage medium. Background Art

[0002] Named entity recognition is a basic branch of NLP (Natural Language Processing) and one of the key technologies in information extraction. It targets proper nouns in a field. General fields mainly include: names of people, places, names of organizations, etc. Specific fields mainly refer to proper nouns in a field, such as "credit card" and "debit card" in the banking field.

[0003] Existing technologies can be divided into three categories: the first is the dictionary and rule-based method, which relies on the construction of dictionaries and rules and has great limitations in dealing with new words and new fields; the second is the statistical method: this method relies on manual feature selection and requires a lot of manpower and time; the third is the deep learning method, which reduces the workload of manual feature selection. Among them, statistical methods and deep learning methods have good performance in named entity recognition tasks. However, there are two shortcomings in the actual application process: 1) a large amount of labeled data is required, and the manual workload is large; 2) the model domain transferability is poor, and large-scale data sets need to be re-labeled when switching domains. Summary of the invention

[0004] Embodiments of the present invention provide a method, apparatus, device and storage medium for named entity recognition, which solve the problems of large workload of data annotation and difficulty in domain migration.

[0005] A method for named entity recognition provided according to an embodiment of the present invention includes:

[0006] Use the algorithm for mining seed entity words to perform entity recognition on new domain text data to obtain new domain seed entity words;

[0007] Annotating the new domain text data according to the new domain seed entity words to obtain annotated new domain text data;

[0008] Using the labeled new domain text data, training a named entity recognition model to obtain a named entity recognition model suitable for the new domain;

[0009] The named entity recognition model suitable for the new domain is used to recognize entity words in other text data of the new domain.

[0010] According to an embodiment of the present invention, a named entity recognition device is provided, the device comprising:

[0011] The entity recognition module is used to perform entity recognition on the new domain text data using the algorithm for mining seed entity words to obtain the seed entity words of the new domain;

[0012] A text labeling module, used for labeling the new domain text data according to the new domain seed entity words to obtain labeled new domain text data;

[0013] A model training module, used to train a named entity recognition model using the labeled new domain text data to obtain a named entity recognition model suitable for the new domain;

[0014] The model application module is used to use the named entity recognition model suitable for the new field to identify entity words in other text data in the new field.

[0015] According to an embodiment of the present invention, a named entity recognition device is provided, the device comprising: a processor, and a memory coupled to the processor; the memory stores a named entity recognition program that can be run on the processor, and the named entity recognition program implements the steps of the named entity recognition method when executed by the processor.

[0016] According to an embodiment of the present invention, a computer storage medium is provided, on which a named entity recognition program is stored. When the named entity recognition program is executed by a processor, the steps of the named entity recognition method are implemented.

[0017] The technical solution provided by the embodiment of the present invention has the following beneficial effects:

[0018] The embodiments of the present invention reduce the workload of data annotation, lower the threshold of model migration training, and improve the domain versatility of the algorithm by mining seed entity words in new fields and annotating text data in new fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of a named entity recognition method provided by an embodiment of the present invention;

[0020] Figure 2 is a block diagram of a named entity recognition device provided by an embodiment of the present invention;

[0021] Figure 3 is a block diagram of a named entity recognition device provided by an embodiment of the present invention;

[0022] Figure 4 is an architecture diagram of an entity recognition system provided by an embodiment of the present invention;

[0023] Figure 5 is an architecture diagram of an automated entity recognition system provided by an embodiment of the present invention;

[0024] Figure 6 This is a flowchart of new word discovery and mining seed entity words provided by an embodiment of the present invention;

[0025] Figure 7 is a flow chart of a new word discovery algorithm provided by an embodiment of the present invention;

[0026] Figure 8 This is a flow chart of sentence pattern mining seed entity words provided by an embodiment of the present invention;

[0027] Fig. 9 is a flow chart of a sentence mining algorithm provided by an embodiment of the present invention;

[0028] Fig.10 It is a schematic diagram of the domain concept map structure provided by an embodiment of the present invention;

[0029] Fig.11 is a flow chart of automatic corpus tagging provided by an embodiment of the present invention;

[0030] Fig.12 This is a flowchart of semi-automatic entity recognition in the new field of Example 1 of the present invention;

[0031] Fig.13 It is a semi-automatic entity recognition flow chart combining existing fields and new fields in Example 2 of the present invention. DETAILED DESCRIPTION

[0032] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described below are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0033] Figure 1 is a flow chart of a method for named entity recognition provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0034] Step S101: Perform entity recognition on new domain text data to obtain new domain seed entity words.

[0035] The new domain refers to a domain where entity words have not yet been mined or where entity words have not been mined sufficiently. In such new domains where entity words are to be mined, there is no or a lack of annotated corpus.

[0036] As a first way to implement step S101, the new domain text data can be split into new domain single sentences, and then the new words in each new domain single sentence are determined according to the allowed length of the new domain entity words, and the new words are filtered according to the relevance of the new words to the new domain to obtain the new domain seed entity words. That is, an algorithm for mining seed entity words, specifically an algorithm for determining the new domain seed entity words based on the discovered new words, such as the Nagao algorithm, is used to perform entity recognition on the new domain text data to obtain the new domain seed entity words.

[0037] As an embodiment, determining the new words in each new domain sentence according to the allowed length of the new domain entity words includes: for each new domain sentence, counting the phrases in the new domain sentence that meet the allowed length of the new domain entity words, and then filtering each phrase according to the characteristics of each phrase to obtain new words.

[0038] The allowed length of the new domain entity word can be any length that is not greater than the preset maximum length of the new domain entity.

[0039] Among them, the characteristics of each phrase can be word frequency, part of speech, etc.

[0040] Among them, filtering each phrase refers to filtering using features and experience thresholds, for example, taking phrases whose comparative word frequency is greater than known experience word frequency as new words, and for example, determining new words by using the average feature value and known experience word frequency calculated using the feature value and weight of each feature.

[0041] As an embodiment, filtering the new words according to the correlation between the new words and the new domain includes: using a domain concept map representing the correlation between domains and a word frequency-reverse document frequency algorithm to determine a correlation score representing the correlation between the new words and the new domain, and filtering the new words according to the correlation score and an empirical threshold, obtaining the new words with a correlation score higher than the empirical threshold as the seed entity words of the new domain. The step of determining the correlation score includes: obtaining the correlation weight between the new domain and other domains according to the domain concept map, using the word frequency-reverse document frequency algorithm to determine a probability score representing the importance of the new word to the new domain, and then using the correlation weight and the probability score to determine the correlation score between the new word and the new domain.

[0042] Among them, the domain concept map can organize and represent the relationship between domains, such as hierarchical relationships, and is a graphical representation of the relationship between domains.

[0043] Among them, the word frequency-inverse document frequency algorithm is an existing algorithm. This embodiment uses this algorithm to filter out common words in various fields, and retains important words in the new field as new field seed entity words. That is, the new words may appear in text data in other fields. In the text data set composed of new field text data and other field text data, the algorithm can determine the importance of the new words to the new field text data in the text data set, thereby realizing new word filtering.

[0044] Among them, the other fields can be any fields that are different from the upper-level fields. For example, if the upper-level field is finance, the other fields can be operators, technology, etc.

[0045] This method is suitable for scenarios where only new domain text data is available.

[0046] As a second way to implement step S101, the new domain text data and the existing domain text data can be split into new domain single sentences and existing domain single sentences respectively, and then the existing domain single sentences are used to generate sentence templates, and the new domain seed entity words in the new domain single sentences are determined by matching the new domain single sentences with the sentence templates. That is, an algorithm for mining seed entity words, specifically an algorithm for mining seed entity words in the new domain using sentence templates, is used to perform entity recognition on the new domain text data to obtain new domain seed entity words.

[0047] As an embodiment, the sentence template includes a first sentence template and a second sentence template, and the generation of the sentence template using the existing domain single sentence and the existing domain entity word includes: replacing the existing domain entity word existing in each of the existing domain single sentences with a preset entity word mining symbol to obtain a first sentence template, and replacing the words or phrases in the first sentence template with synonyms or synonymous phrases to obtain a second sentence template. The first sentence template and the second sentence template are both seed sentence templates. As another embodiment, the sentence template may also include a third sentence template, which is a sentence template derived from the seed sentence template. For example, the derivation process may be implemented using a self-expansion technology (i.e., Bootstrapping algorithm).

[0048] Among them, when the existing field and the new field are similar fields, for example, the superordinate fields to which the two belong are the same, a sentence template more suitable for the new field can be generated. Therefore, when preparing the corpus of the existing field, the similar fields of the new field can be determined through the domain concept map, and then the corpus of the similar field can be prepared. For example, when generating a sentence template for mining seed entity words of CCB (i.e., China Construction Bank), it is preferred to select text data of other banks to generate sentence templates.

[0049] This method is suitable for scenarios where there is a lack of sufficient new domain text data or annotated text in other domains.

[0050] As a third implementation method for implementing step S101, it combines the first and second implementation methods, specifically including: splitting the new domain text data and the existing domain text data into new domain single sentences and existing domain single sentences respectively, then determining the new words in each new domain single sentence according to the allowed length of the new domain entity words, and filtering the new words according to the relevance of the new words with other domains to obtain the filtered new domain seed entity words; using the existing domain single sentences, generating sentence templates, and matching the new domain single sentences with the sentence templates to obtain the matched new domain seed entity words; finally merging the filtered new domain seed entity words and the matched new domain seed entity words to obtain the new domain seed entity words. That is, using the algorithm for mining seed entity words, specifically the algorithm for determining the new domain seed entity words based on the discovered new words and the algorithm for mining the new domain seed entity words using sentence templates, entity recognition is performed on the new domain text data to obtain the new domain seed entity words.

[0051] Among them, the steps of determining new words and filtering new words can adopt the implementation method mentioned in the first method, and the step of generating sentence templates can adopt the implementation method mentioned in the second method, which will not be repeated here.

[0052] The new domain seed entity words of this embodiment are typical entity words in the new domain and are the initial conditions for discovering other entity words in the new domain. That is, the seed entity words are used to expand the entity words in the new domain.

[0053] Step S102: annotating the new domain text data according to the new domain seed entity words to obtain annotated new domain text data.

[0054] As a method of implementing step S102, for each of the new domain single sentences, the new domain single sentence is segmented by words to obtain the words that constitute the new domain single sentence, and then each word of the new domain single sentence is annotated according to the position of each word in the new domain seed entity words contained in the new domain single sentence. After all the new domain single sentences are annotated, the annotated new domain text data is obtained.

[0055] The character may be a Chinese character when performing named entity recognition on Chinese, or may be the smallest unit constituting a single sentence in other languages, such as a word in English, when performing named entity recognition on other languages.

[0056] Step S103: using the labeled new domain text data to train a named entity recognition model to obtain a named entity recognition model suitable for the new domain.

[0057] Step S104: using the named entity recognition model applicable to the new domain to identify entity words in other text data of the new domain.

[0058] As an embodiment, the named entity recognition model can be a NER model commonly used in the industry based on a deep learning framework bidirectional LSTM (Long Short-Term Memory) + CRF (Conditional Random Field).

[0059] As another implementation, after step S101, the seed entity word may also be sent to a user interface so that a user can manually verify the seed entity word.

[0060] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. Furthermore, the present invention can also provide a computer storage medium, on which a named entity recognition program is stored, and when the named entity recognition program is executed by a processor, the steps of the named entity recognition method are implemented. The storage medium may include ROM / RAM, a disk, an optical disk, and a USB flash drive.

[0061] Figure 2 is a block diagram of a named entity recognition device provided by an embodiment of the present invention, such as Figure 2 As shown, the device comprises:

[0062] The entity recognition module is used to use the algorithm of mining seed entity words to perform entity recognition on new domain text data and obtain new domain seed entity words, which can be realized Figure 1 Step S101.

[0063] The text tagging module is used to tag the new domain text data according to the new domain seed entity words to obtain the tagged new domain text data, which can achieve Figure 1 Step S102.

[0064] The model training module is used to train the named entity recognition model using the labeled new domain text data to obtain a named entity recognition model suitable for the new domain, which can achieve Figure 1 Step S103.

[0065] The model application module is used to use the named entity recognition model applicable to the new field to identify entity words in other text data of the new field, which can achieve Figure 1 Step S104.

[0066] Figure 3 is a block diagram of a named entity recognition device provided by an embodiment of the present invention, such as Figure 3 As shown, the device includes: a processor, and a memory coupled to the processor; the memory stores a named entity recognition program that can be run on the processor, and the named entity recognition program implements the steps of the named entity recognition method when executed by the processor.

[0067] The present invention mainly includes four modules: mining seed entity words (equivalent to Figure 2 Entity recognition module), automatic corpus tagging (equivalent to Figure 2 Text tagging module), offline training NER model (equivalent to Figure 2 Model training module) and online use of NER model (equivalent to Figure 2 Model application module). Among them:

[0068] 1. Mining seed entity words

[0069] This module can effectively solve the problem of domain migration and lack of standard corpus for entity recognition. It is a core module, including two submodules: new word discovery to mine seed entity words and sentence pattern to mine seed entity words.

[0070] Among them, the new word discovery method is suitable for entity recognition scenarios with only new domain corpus, such as: entity recognition in the telecommunications field, but lack of annotated corpus in telecommunications or other fields. The sentence mining method is suitable for entity recognition scenarios that combine existing and new fields. For example, there is a certain amount of entity word library in the CCB field, and sentence patterns can be used to quickly mine entity words of Bank of China or Telecom.

[0071] 2. Automatic labeling of corpus

[0072] The corpus automatic labeling module, after mining the seed entity words, the system automatically labels the new field corpus, avoiding tedious manual labeling work and providing data support for NER model training. It is another core module of the system.

[0073] 3. Offline training of NER model

[0074] This module uses the industry-wide deep learning framework, bidirectional LSTM (Long Short-Term Memory) + CRF (Conditional Random Field), to train the NER model to improve the generalization capability of the entity recognition system. It is an essential module for the system.

[0075] 4. Use the NER model online

[0076] This module is a necessary module of the system, not a core module, and its usage process is the same as that of the industry's NER model.

[0077] In order to facilitate the understanding of those skilled in the art, Figures 4 to 13 The present invention is further described. The following description is not intended to limit the protection scope of the present invention.

[0078] Figure 4 is an architecture diagram of an entity recognition system provided by an embodiment of the present invention, such as Figure 4 As shown in the figure, the system implements a set of domain-wide Chinese entity recognition algorithm systems to solve the problems of large workload of data annotation and difficulty in domain migration. It mainly includes four modules: mining seed entity words, automatic corpus labeling, offline training of NER models and online use of NER models.

[0079] The online use of the NER model is to ensure the completeness of the system. It is a non-core module and has the same use process as the industry's NER model. The offline training of the NER model uses the industry's common deep learning framework, bidirectional LSTM+CRF, to improve the generalization ability of the entity recognition system. Mining seed entity words and automatically labeling corpora can effectively solve the problem of domain migration. This is the core module. To further improve the accuracy of the system, manual verification can be introduced before automatic labeling of corpora, such as Figure 5 The semi-automatic entity recognition system architecture diagram is shown in Figure 1. The system can be applied to a variety of devices, such as smart call centers, smart set-top boxes, smart knowledge bases, etc., to improve device accuracy and reduce manual workload.

[0080] Figure 6 : is a flowchart of new word discovery and mining seed entity words provided by an embodiment of the present invention, such as Figure 6 As shown, this flowchart is applicable to entity recognition scenarios with only new domain corpus, such as: entity recognition in the telecommunications field, but lacking labeled corpus in telecommunications or other fields. Mainly using the new word discovery algorithm to mine seed domain entity words, it can be quickly applied to products or subsequent entity recognition model training processes. The new domain only needs to provide the corresponding corpus, without re-labeling, so it is one of the core modules of the present invention.

[0081] Corpus preparation: Text data in the new field can be FAQ (Frequently Asked Question) question-and-answer pairs, or chapters and text corpora.

[0082] Interface input (i.e. input parameters from the interface): Take the prepared text data and domain information, and the maximum length of the domain entity as input parameters, generate an input parameter message containing the input parameters, and input it through the interface. For example, the input parameter message can be a json (JavaScript Object Notation, JS object notation) message, which mainly includes the domain of the corpus, text data, and the maximum length of the domain entity word. The specific format is as follows:

[0083]

[0084] Below Figure 6 Each step is described in detail.

[0085] Step 301: Obtain new domain corpus.

[0086] Extract the new domain corpus (i.e., text data in the new domain) from the input message (e.g., JSON message) and store it in the cache.

[0087] Step 302: Clause splitting.

[0088] Split text data into single sentences based on punctuation marks and stop words and stop phrases.

[0089] Step 303: mining new words.

[0090] Implementation process such as Figure 7 As shown, it includes: step 401: obtaining the segmented text (i.e., clauses or single sentences); step 402: counting all phrases that meet the length (i.e., the longest length of the domain entity) in each segmented text; step 403: counting the features of each phrase; step 404: performing threshold filtering according to the features of each phrase, and obtaining the final new word as the candidate new word in step 405. That is, firstly counting the phrase combinations that meet the length. Then counting the features of each phrase, such as mutual information, left and right information entropy, word frequency, part of speech and other features, to obtain the candidate new word. Finally, filtering according to the empirical threshold value obtains the final new word.

[0091] Step 304: New word filtering.

[0092] The main purpose is to determine whether new words are related to other industries for filtering. The relevance of new words to other industries is achieved with the help of domain concept graphs and keyword extraction algorithms. The corpus of each industry comes from web crawlers. The upper and lower relationships of the concept graph are mainly used to determine the industry in which the current field is located. Its storage structure Fig.10As shown in the figure. The TF-IDF (Term Frequency–Inverse Document Frequency) keyword extraction algorithm is used to determine the importance of each new word in the current field, and TF-IDF is used as the probability score of the entity word. Finally, the entity word result is obtained according to the empirical threshold.

[0093] Step 305: Output seed entity words.

[0094] Generates JSON messages of domain entity words. It is a core module to facilitate log packet capture and information collection. The message format is as follows:

[0095]

[0096]

[0097] "zxner_domain" is the domain where the entity is located, and "zxner_result" is the entity recognition result in array form, including the entity word and the corresponding score of the word.

[0098] Figure 8 is a flow chart of sentence pattern mining seed entity words provided by an embodiment of the present invention, such as Figure 8 As shown, the flowchart is applicable to entity recognition scenarios that combine existing fields with new fields. For example, there is already a certain amount of entity word libraries in the CCB field, and the entity words of the Bank of China or Telecom can be quickly mined with the help of sentence patterns. Mainly using sentence structure to mine domain entity words, it can be quickly applied to products or subsequent entity recognition model training processes. New scenario expansion only requires providing the corresponding corpus, without re-labeling, so it is one of the core modules of the present invention.

[0099] Corpus preparation: Text data in new fields, which can be FAQ question-answer pairs, or passages and text corpora. Entity lexicons and text data in existing fields are used for sentence mining.

[0100] Interface input parameters (i.e. input parameters from the interface): Take the prepared new domain text data, new domain information, maximum length of new domain entities, existing domain text data, existing domain information, and existing domain entity words as input parameters, generate an input parameter message containing the input parameters, and input it through the interface. For example, the input parameter message can be a json message, which mainly includes the domain of the corpus and the maximum length of the text data domain entity words. The specific format is as follows:

[0101]

[0102]

[0103] Below Figure 8Each step is described in detail.

[0104] Step 501: Obtain existing domain corpus, including entity words.

[0105] Extract existing domain text data and entity words from the input message.

[0106] Step 502: Clause splitting.

[0107] Split existing domain text data into single sentences based on punctuation marks and stop words and stop phrases.

[0108] Step 503: Sentence mining.

[0109] Implementation process such as Fig. 9 As shown. Step 601: Get the segmented text (i.e., clause or single sentence); Step 602: Replace the entity words in the segmented text with [E] (i.e., the preset entity word mining symbol); Step 603: Replace the other words or phrases in the segmented text except the entity words with synonyms or synonymous phrases; Step 604: Get the seed sentence template after replacement; Step 605: Use the Bootstrapping algorithm to get more sentence templates in step 606. That is, first replace the entity words in the single sentence of step 502 with [E]. Then replace it with synonyms or synonymous phrases to form a seed sentence template. Finally, use the bootstrapping algorithm to mine more sentence templates.

[0110] Step 504: Store the sentence template.

[0111] The structure of the sentence template formed in step 503 is as follows:

[0112] Template Domain [E] How to apply CCB

[0113] Step 505: Obtain new domain corpus.

[0114] Extract new field text data from the input message.

[0115] Step 506: Clause splitting.

[0116] Split the new domain text data into single sentences based on punctuation marks and stop words and stop phrases.

[0117] Step 507: Sentence matching.

[0118] Sort the new field according to its relevance to the existing field, match the sentence template, and extract possible entity words.

[0119] The relevance of existing fields is mainly realized by means of concept knowledge graphs. The storage structure of concept graphs Fig.10As shown in the figure, domain relevance depends on two parts of the graph: one is the relationship between industries, and the other is the relationship between the upper and lower levels. The domains with the same upper word have the greatest relevance, such as between CCB and bank; the other is the relationship between sentence structure similarity between industries, such as finance and operators.

[0120] Module 508: Output seed entity words.

[0121] Generates JSON messages of domain entity words. It is a core module to facilitate log packet capture and information collection. The message format is as follows:

[0122]

[0123]

[0124] "zxner_domain" is the domain where the entity is located, and "zxner_result" is the entity recognition result in array form, including the entity word and the template corresponding to the word.

[0125] Fig.11 is a flow chart of automatic corpus labeling provided by an embodiment of the present invention, such as Fig.11 As shown in FIG. 1 , the module automatically tags the new domain corpus (i.e., labels the new domain text data) according to the seed entity words, thus reducing the manual tagging work.

[0126] In addition to serving this system, the corpus automatic labeling process can be applied to other sequence labeling task systems, such as word segmentation systems. When applied to other systems, the interface input parameters (i.e., input parameters from the interface): the domain of the corpus, entity words, and corresponding corpus are used as input parameters, and an input parameter message containing the input parameters is generated and input through the interface. For example, the input parameter message can be a json message, which mainly includes the domain of the corpus, entity words, and corresponding corpus. The specific format is as follows:

[0127]

[0128] Below Fig.11 Each step is described in detail.

[0129] Step 801: Obtain new domain corpus.

[0130] Extract new domain corpus from the input message, including domain text data and seed entity words.

[0131] Step 802: Clause splitting.

[0132] Split existing domain text data into single sentences based on punctuation marks and stop words and stop phrases.

[0133] Step 803: Segment words by characters.

[0134] Segment all clauses word by word to reduce the impact of word segmentation errors on system results.

[0135] Step 804: Determine the position of the character in the seed entity word, with the starting position marked as B, the middle position marked as I, the ending position marked as E, and the character not in the entity word marked as O.

[0136] The output is to generate a json message of the annotated corpus, which is convenient for log packet capture and information collection. The message format is as follows:

[0137]

[0138] "zxner_domain" is the domain where the entity is located, and "zxner_result" is the corpus tagging result in array form, including a single sentence corpus and the tagging result of each word.

[0139] Fig.12 This is a flowchart of semi-automatic entity recognition in the new field of Example 1 of the present invention, such as Fig.12 As shown, this embodiment mainly illustrates the following application scenario: only new domain entity recognition.

[0140] Step 901: Obtain new domain corpus.

[0141] Receive input messages and extract new domain corpus from the input messages, including new domain text data "Is Qianyuan Manyi a financial product? What are the returns of Qianyuan Manyi? Is Qianyuan Manyi a stable financial product?" and new domain information "China Construction Bank".

[0142]

[0143] Step 902: New word discovery mining seed entity words.

[0144] 1) Clause splitting results:

[0145] "Qianyuanmanyi is a financial product

[0146] How is the profit of Qianyuanmanyi?

[0147] Is Qianyuanmanyi a stable financial product?"

[0148] 2) Discover new words:

[0149] Qianyuan, Qianyuan overflowing, financial products, income

[0150] 3) New word filtering:

[0151] The domain concept map determines that the current data belongs to the financial field, and TF-IDF calculates the correlation between the new word and other industries such as operators and technology. The larger the score, the higher the correlation with the CCB field, and the lower the correlation with other fields.

[0152] Qianyuan 2.34

[0153] Qianyuan overflowing 2.12

[0154] Financial products 2.08

[0155] Profit: 1.834) The output of mining seed entity words is:

[0156]

[0157] Step 903: Manual verification to determine entity words.

[0158] Qianyuan, Qianyuan overflowing, financial products

[0159] Step 904: Automatically label the corpus: Use the industry classic BIES to label the corpus.

[0160]

[0161] Step 905: Train the model.

[0162] The training method is the same as that in the industry and will not be described in detail here.

[0163] Fig.13 This is a flow chart of semi-automatic entity recognition combining existing fields and new fields in Example 2 of the present invention, such as Fig.13 As shown, this embodiment mainly illustrates the following application scenario: entity recognition combining existing fields and new fields.

[0164] Step 1001: Acquire new domain corpus and existing domain corpus.

[0165] Receive input messages and extract new domain corpus from the input messages, including new domain text data "Credit card password change? I want to know how to apply for a debit card? How to apply for a credit card?", new domain information "CCB", existing domain information "Telecom", existing domain entity words "E-surfing Navigator A8 Package, Business Navigator Package, Campus Package" and existing domain text data "I want to know how to apply for a Business Navigator Package? How to apply for an E-surfing Navigator A8 Package?".

[0166]

[0167] Step 1002: New word discovery + sentence pattern mining seed entity words.

[0168] 1) Clause splitting results:

[0169] The results of clause splitting of the new domain corpus are as follows:

[0170] "Credit card password modification

[0171] How to apply for a debit card

[0172] How to apply for a credit card",

[0173] The results of clause splitting of existing domain corpus are as follows:

[0174] How to apply for the Business Pilot Package

[0175] How to apply for Tianyi Navigator A8 package

[0176] 2) Discover new words and sentence patterns

[0177] Discover new words: credit card

[0178] Digging sentence patterns: What is the handling method of [E]? How to handle [E]

[0179] How to activate

E

E

[0180] 3) New word filtering: The domain concept map is used to determine that the current data belongs to the financial field, and TF-IDF calculates the correlation between the new word and other industries such as operators and technology. The larger the score, the higher the correlation with the CCB field, that is, the lower the correlation with other fields.

[0181] Credit card: 2.39

[0182] 4) Sentence matching: Domain concept map. The new domain belongs to the financial field and has a high correlation with the telecommunications field. The sentence template can be matched to obtain the result.

[0183] How to apply for a debit card?

[0184]

E

[0185] 5) The output of mining seed entity words is:

[0186]

[0187]

[0188] Step 1003: Manual verification to determine entity words.

[0189] Credit Card, Debit Card

[0190] Step 1004: Automatically label the corpus: Use the industry classic BIES to label the corpus.

[0191]

[0192] 5) 1005 module training model: The training method is the same as that in the industry and will not be described in detail here.

[0193] In summary, the embodiments of the present invention have the following technical effects:

[0194] Compared with other traditional algorithms, the system of the present invention adds a mining entity seed set module (to achieve Figure 2 It uses the functions of the entity recognition module of the machine learning platform, and adopts new word discovery, keyword extraction, sentence mining, domain concept map and other technologies to automatically mine seed entity sets in new fields, and automatically label the corpus, and then conducts deep learning bidirectional LSTM+CRF algorithm training model, which can reduce the workload of data annotation, lower the threshold of model migration training, and improve the domain versatility of the algorithm. It is suitable for a variety of scenarios and can be embedded in various artificial intelligence (AI) devices such as voice assistants, intelligent customer service, and intelligent knowledge bases.

[0195] Although the present invention is described in detail above, the present invention is not limited thereto, and those skilled in the art can make various modifications based on the principles of the present invention. Therefore, all modifications made based on the principles of the present invention should be understood to fall within the protection scope of the present invention.

Claims

1. A method for named entity recognition, characterized in that: The method comprises: Perform entity recognition on text data in new domains to obtain seed entity words in new domains. New domains refer to domains where entity words have not yet been mined or where entity words have not been mined sufficiently. In such new domains where entity words are to be mined, there is no or insufficient annotated corpus. Annotating the new domain text data according to the new domain seed entity words to obtain annotated new domain text data; Using the labeled new domain text data, training a named entity recognition model to obtain a named entity recognition model suitable for the new domain; Using the named entity recognition model applicable to the new domain, identifying entity words in other text data of the new domain; The entity recognition is performed on the new domain text data to obtain the new domain seed entity words, including: Splitting the new domain text data and the existing domain text data into new domain single sentences and existing domain single sentences respectively; Generate a sentence template using the existing domain single sentence; Determining the new domain seed entity word in the new domain single sentence by matching the new domain single sentence with the sentence pattern template; The step of using the existing domain single sentence to generate a sentence template includes: Obtaining the existing domain single sentence; Replacing the entity words in the single sentence of the existing domain with preset entity word mining symbols; Replacing other words or phrases except the entity words in the existing domain single sentence with synonyms or synonymous phrases; The replaced existing domain sentence is used as a seed sentence template.

2. The method according to claim 1, characterized in that The entity recognition of the new domain text data is performed to obtain the new domain seed entity words including: Splitting the new domain text data and the existing domain text data into new domain single sentences and existing domain single sentences respectively; According to the allowed length of the new domain entity words, determine the new words in each new domain single sentence, and filter the new words according to the relevance of the new words to the new domain to obtain filtered new domain seed entity words; Generate a sentence template using the existing domain single sentence, and obtain matched new domain seed entity words by matching the new domain single sentence with the sentence template; The filtered new domain seed entity words and the matched new domain seed entity words are merged to obtain the new domain seed entity words.

3. The method according to claim 2, characterized in that The filtering of the new words according to the relevance between the new words and the new field comprises: Determine a relevance score representing the relevance of the new word to the new domain by using a domain concept graph representing the relevance between domains and a word frequency-inverse document frequency algorithm; The new words are filtered according to the relevance score and the experience threshold, and the new words whose relevance scores are higher than the experience threshold are obtained as the seed entity words of the new domain.

4. The method according to claim 3, characterized in that The method of using a domain concept graph representing the correlation between domains and a word frequency-inverse document frequency algorithm to determine a correlation score representing the correlation between the new word and the new domain includes: According to the domain concept map, obtaining the correlation weights between the new domain and other domains; Determining a probability score representing the importance of the new word to the new domain using the term frequency-inverse document frequency algorithm; The relevance score of the new word to the new domain is determined using the relevance weight and the probability score.

5. The method according to claim 2, characterized in that: The step of labeling the new domain text data according to the new domain seed entity words to obtain the labeled new domain text data includes: For each of the new domain single sentences, the new domain single sentence is segmented by characters to obtain the characters constituting the new domain single sentence; Marking each word in the new domain single sentence according to the position of each word in the new domain seed entity word contained in the new domain single sentence; After labeling all new domain single sentences, labeled new domain text data is obtained.

6. A named entity recognition device, characterized in that: The device comprises: The entity recognition module is used to perform entity recognition on text data in a new domain to obtain seed entity words in the new domain. A new domain refers to a domain where entity words have not yet been mined or where entity words have not been mined sufficiently. In such new domains where entity words are to be mined, there is no or a lack of annotated corpus. A text labeling module, used for labeling the new domain text data according to the new domain seed entity words to obtain labeled new domain text data; A model training module, used to train a named entity recognition model using the labeled new domain text data to obtain a named entity recognition model suitable for the new domain; A model application module, used to use the named entity recognition model applicable to the new field to identify entity words in other text data of the new field; The entity recognition module is used to split the new domain text data and the existing domain text data into new domain single sentences and existing domain single sentences respectively; Generate a sentence template using the existing domain single sentence; Determining the new domain seed entity word in the new domain single sentence by matching the new domain single sentence with the sentence pattern template; The entity recognition module is used to obtain the existing domain single sentence; Replacing the entity words in the single sentence of the existing domain with preset entity word mining symbols; Replacing other words or phrases except the entity words in the existing domain single sentence with synonyms or synonymous phrases; The replaced existing domain sentence is used as a seed sentence template.

7. A named entity recognition device, characterized in that: The device includes: a processor, and a memory coupled to the processor; the memory stores a named entity recognition program that can be run on the processor, and when the named entity recognition program is executed by the processor, the steps of the named entity recognition method as described in any one of claims 1 to 5 are implemented.

8. A computer storage medium, characterized in that: A named entity recognition program is stored thereon, and when the named entity recognition program is executed by a processor, the steps of the named entity recognition method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method for extracting novel field words

    CN106095736A

  • Fine-grained viewpoint mining method based on theme emotion semantic extraction

    CN106599063A