Named entity recognition method, device, electronic device and storage medium

By extracting the features of the text to be identified from a global and local perspective and splicing them, and using the named entity recognition model for processing, the problem of low accuracy of naming entity recognition in the prior art is solved, and higher recognition accuracy is achieved.

CN113761923BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011159598.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-26
Publication Date
2025-02-21
Estimated Expiration
2040-10-26

AI Technical Summary

Technical Problem

The prior art has low accuracy in naming entity recognition, especially when processing phrase elements that are far apart in text.

Method used

By extracting the features of the text to be identified from both global and local angles, the target global feature vector and the target local feature vector are obtained, and they are spliced ​​into the target feature vector, and the named entity recognition model is used for processing to obtain the entity category recognition results.

Benefits of technology

The accuracy of naming entity recognition is improved, and through the combination of global and local features, more comprehensive and rich text features are obtained, thereby improving the accuracy of the recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761923B_ABST
    Figure CN113761923B_ABST
Patent Text Reader

Abstract

The disclosed embodiments provide a method, device, electronic device and storage medium for named entity recognition. The method includes: obtaining a text to be recognized; extracting features of the text to be recognized to obtain a target global feature vector and a target local feature vector; concatenating the target global feature vector and the target local feature vector to obtain a target feature vector; and processing the target feature vector using a named entity recognition model to obtain an entity category recognition result for characterizing the text to be recognized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and more specifically, to a method, device, electronic device, and storage medium for named entity recognition. Background Art

[0002] Named Entity Recognition (NER) refers to the identification of entities with specific meanings in natural language texts. Entities mainly include names of people, places, organizations, time, money, and dates. Named entity recognition is an essential component of many natural language processing (NLP) technologies, such as information extraction, information retrieval, and machine translation.

[0003] In natural language processing, since named entity recognition is usually the first step in natural language understanding and its recognition results are used in a variety of subsequent NLP tasks, the accuracy of named entity recognition is crucial.

[0004] In the process of implementing the concept of the present disclosure, the inventors found that there are at least the following problems in the related art: the accuracy of named entity recognition using the related art is not high. Summary of the invention

[0005] In view of this, embodiments of the present disclosure provide a method, device, electronic device and storage medium for named entity recognition.

[0006] One aspect of an embodiment of the present disclosure provides a method for named entity recognition, which includes: obtaining a text to be recognized; performing feature extraction on the text to be recognized to obtain a target global feature vector and a target local feature vector; concatenating the target global feature vector and the target local feature vector to obtain a target feature vector; and processing the target feature vector using a named entity recognition model to obtain an entity category recognition result for characterizing the text to be recognized.

[0007] Another aspect of an embodiment of the present disclosure provides a named entity recognition device, which includes: an acquisition module for acquiring a text to be recognized; an extraction module for performing feature extraction on the text to be recognized to obtain a target global feature vector and a target local feature vector; a splicing module for splicing the target global feature vector and the target local feature vector to obtain a target feature vector; and a processing module for processing the target feature vector using a named entity recognition model to obtain an entity category recognition result for characterizing the text to be recognized.

[0008] Another aspect of an embodiment of the present disclosure provides an electronic device, which includes: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.

[0009] Another aspect of an embodiment of the present disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method described above.

[0010] Another aspect of an embodiment of the present disclosure provides a computer program, which includes computer executable instructions, and the instructions are used to implement the method described above when executed.

[0011] According to an embodiment of the present disclosure, a text to be recognized is obtained, and features are extracted from the text to be recognized to obtain a target global feature vector and a target local feature vector, which are then concatenated to obtain a target feature vector, and the target feature vector is processed using a named entity recognition model to obtain an entity category recognition result for characterizing the text to be recognized. Since the target global feature vector and the target local feature vector respectively reflect the global and local features of the text to be recognized, the information of the acquired text to be recognized is relatively comprehensive and rich. Therefore, the accuracy of the named entity recognition obtained by processing the target feature vector obtained by concatenating the target global feature vector and the target local feature vector based on the named entity recognition model is relatively high, thereby at least partially overcoming the technical problem of low accuracy of named entity recognition using related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0013] Figure 1 An exemplary system architecture to which a named entity recognition method can be applied according to an embodiment of the present disclosure is schematically shown;

[0014] Figure 2 A flowchart of a method for named entity recognition according to an embodiment of the present disclosure is schematically shown;

[0015] Figure 3 A schematic diagram of obtaining a character-level feature vector according to an embodiment of the present disclosure is schematically shown;

[0016] Figure 4 A schematic diagram of word-level feature vector visualization according to an embodiment of the present disclosure is schematically shown;

[0017] Figure 5 A schematic diagram schematically shows a framework of a method for named entity recognition according to an embodiment of the present disclosure;

[0018] Figure 6 The following schematically shows an application diagram of a method for named entity recognition according to an embodiment of the present disclosure;

[0019] Figure 7 A block diagram schematically shows a named entity recognition device according to an embodiment of the present disclosure; and

[0020] Figure 8 A block diagram of an electronic device suitable for implementing a method for named entity recognition according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0021] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0022] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0023] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0024] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0025] In related technologies, statistical methods are usually used for named entity recognition. Among them, the statistical method is to integrate statistical methods with probabilistic knowledge, establish a complex mathematical model for named entity recognition, and then combine the existing annotated corpus training model to achieve named entity recognition with the trained model. Among them, the statistical models used mainly include conditional random fields (CRF), hidden Markov model (HMM), maximum entropy model (ME) and support vector machine (SVM).

[0026] In the process of implementing the concept of the present disclosure, the inventors found that the related art cannot properly process phrase elements that are far apart in the text. Since the phrase elements that are far apart in the text cannot be properly processed, the accuracy of named entity recognition is not high.

[0027] In order to improve the accuracy of named entity recognition, the inventors found that text information can be divided into global information and local information. Among them, global information can obtain the characteristics of the text from the global perspective, and this characteristic reflects the detailed characteristics of the text. Local information can obtain the characteristics of the text from the local perspective, and this characteristic reflects the overall characteristics of the text. The overall characteristics are reflected in that for each text itself, each phrase element included in it has a semantic association, that is, each phrase element has corresponding semantics in the text in which it is located. For example, for the "Apple" in the text to be identified "Apple was founded by Jobs.", from the global information, it can be determined that it is an apple, but it cannot be further determined whether it refers to the apple among fruits or the apple of the mobile phone brand. From the local information, since it is combined with the text to be identified itself, it can be determined that it refers to the apple of the mobile phone brand.

[0028] Based on the fact that text information can be divided into global information and local information, the inventor proposes that the text to be recognized can be extracted from the global perspective and the local perspective respectively, and the corresponding target global feature vector and target local feature vector are obtained, and the target global feature vector and the target local feature vector are spliced ​​to obtain the target feature vector. Since the target feature vector reflects the global features and local features of the text to be recognized, it can more richly and comprehensively reflect the features of the text to be recognized. On this basis, the target feature vector is used as an input vector and input into the named entity recognition model, and the entity category recognition result for characterizing the text to be recognized is output. Since the target feature vector as an input vector can reflect the comprehensive and rich features of the text to be recognized, the accuracy of named entity recognition can be improved. The named entity recognition described in the embodiments of the present disclosure can be applied to English text. It will be specifically described below in conjunction with the embodiments.

[0029] The embodiments of the present disclosure provide a method and device for named entity recognition and an electronic device to which the method can be applied. The method includes an entity category recognition process. In the entity category recognition process, a text to be recognized is obtained, and features are extracted from the text to be recognized to obtain a target global feature vector and a target local feature vector, and the target global feature vector and the target local feature vector are concatenated to obtain a target feature vector, and the target feature vector is processed using a named entity recognition model to obtain an entity category recognition result for characterizing the text to be recognized.

[0030] Figure 1 The exemplary system architecture 100 to which the named entity recognition method according to an embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0031] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0032] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).

[0033] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0034] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0035] It should be noted that the named entity recognition method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the named entity recognition device provided in the embodiment of the present disclosure can generally be set in the server 105. The named entity recognition method provided in the embodiment of the present disclosure can also be executed by a server or a server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Correspondingly, the named entity recognition device provided in the embodiment of the present disclosure can also be set in a server or a server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Alternatively, the named entity recognition method provided in the embodiment of the present disclosure can also be executed by the terminal devices 101, 102, or 103, or can also be executed by other terminal devices different from the terminal devices 101, 102, or 103. Correspondingly, the named entity recognition apparatus provided in the embodiments of the present disclosure may also be disposed in the terminal device 101 , 102 , or 103 , or in other terminal devices different from the terminal device 101 , 102 , or 103 .

[0036] For example, the text to be recognized may be originally stored in any one of the terminal devices 101, 102, or 103 (for example, the terminal device 101, but not limited thereto), or stored in an external storage device and may be imported into the terminal device 101. Then, the terminal device 101 may locally execute the named entity recognition method provided by the embodiment of the present disclosure, or send the text to be recognized to other terminal devices, servers, or server clusters, and the other terminal devices, servers, or server clusters that receive the text to be recognized may execute the named entity recognition method provided by the embodiment of the present disclosure.

[0037] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0038] Figure 2 A flowchart of a method for named entity recognition according to an embodiment of the present disclosure is schematically shown.

[0039] like Figure 2 As shown, the method includes operations S210 to S240.

[0040] In operation S210, a text to be recognized is obtained.

[0041] In the embodiments of the present disclosure, the text to be recognized may refer to English text. The text to be recognized may come from the CoNLL (Conference on Computational Natural Language Learning) data set in network text. The text to be recognized may include multiple phrase elements (i.e., tokens).

[0042] In operation S220 , feature extraction is performed on the text to be recognized to obtain a target global feature vector and a target local feature vector.

[0043] In the embodiments of the present disclosure, in order to obtain more comprehensive and rich information about the text to be recognized, feature extraction may be performed on the text to be recognized from both global and local aspects to obtain a target global feature vector and a target local feature vector of the text to be recognized.

[0044] According to an embodiment of the present disclosure, the target global feature vector may include a word-level feature vector. The target local feature vector may include a character-level feature vector and / or a sentence-level feature vector. Among them, the word-level feature vector may represent the features of each phrase element in the text to be recognized at the word level. The word-level feature vector may be obtained by processing the text to be recognized using a word-level feature extraction model generated by training a neural network model. The character-level feature vector may represent the features of each phrase element in the text to be recognized at the character level. The character-level feature vector may be obtained by processing the text to be recognized using a character-level feature extraction model generated by training a convolutional neural network model. Compared with word-level feature vectors, character-level feature vectors may reflect deeper features.

[0045] According to an embodiment of the present disclosure, a sentence-level feature vector may include a first sentence-level feature vector and a second sentence-level feature vector. Among them, the first sentence-level feature vector may characterize the sentence-level features of the text to be recognized in terms of semantics. This is because for each phrase element, the phrase element can be identified according to the semantic association embodied in the text to be recognized in which it is located. Therefore, the features of the text to be recognized at the sentence level, that is, the first sentence-level feature vector, can be extracted from the semantic aspect. The second sentence-level feature vector may characterize the sentence-level features of the text to be recognized in terms of format. Since punctuation and capitalization of letters in the text to be recognized also play a relatively important role in named entity recognition, punctuation and capitalization of letters in the text to be recognized may also be processed to extract the features of the text to be recognized at the sentence level from the format aspect.

[0046] In operation S230, the target global feature vector and the target local feature vector are concatenated to obtain a target feature vector.

[0047] In an embodiment of the present disclosure, after obtaining a target global feature vector and a target local feature vector corresponding to the text to be recognized, the target global feature vector and the target local feature vector may be concatenated to obtain a target feature vector corresponding to the text to be recognized.

[0048] Exemplarily, if the target global feature vector is A and the target local feature vector is B, then the target feature vector C=[AB].

[0049] In operation S240, the target feature vector is processed using a named entity recognition model to obtain an entity category recognition result for characterizing the text to be recognized.

[0050] In an embodiment of the present disclosure, a named entity recognition model can be generated based on deep neural network model training. The deep neural network model may include a unidirectional long short-term memory neural network (LSTM) model or a bidirectional long short-term memory neural network (Bi-LSTM) model. The unidirectional long short-term memory neural network model is an extension of the unidirectional recurrent neural network model. The unidirectional recurrent neural network model is a network that processes sequence data. The sequence data here refers to the data obtained based on the time development line as the basis for obtaining data. At different time points, data reflecting the changing state or degree of change of a certain thing or phenomenon over time is obtained. Its biggest feature is that there is a certain relationship between the data at the previous and next time points. Text is also a kind of sequence data, which is because there is always a certain relationship between its context. The unidirectional neural network model is used to remember the previous information in the past, but cannot process the future context information. In order to better understand the context, it is necessary to obtain the future context information, and the bidirectional recurrent neural network model can solve this problem and achieve the acquisition of context information. The bidirectional long short-term memory neural network model can be understood as a combination of the bidirectional recurrent neural network model and the unidirectional long short-term memory neural network model.

[0051] According to an embodiment of the present disclosure, a named entity recognition model based on bidirectional long short-term memory neural network training generation is used as an example for explanation. A training sample set may be obtained first, wherein the training sample set may include multiple training texts and real annotation information corresponding to each training sample, and then feature extraction is performed on each training text to obtain a sample global feature vector and a sample local feature vector, and the sample global feature vector and the sample local feature vector corresponding to each training sample are concatenated to obtain a sample feature vector corresponding to each training sample, and the bidirectional long short-term memory neural network model is trained using multiple sample feature vectors and multiple real annotation information to obtain a named entity recognition model.

[0052] For example, if the text to be recognized is "Apple was founded by Jobs", the entity categories include person names, place names, organization names and others. The target feature vector obtained by feature extraction and feature concatenation is input into the named entity recognition model, and the entity recognition result is that the entity category corresponding to Jobs is a person name.

[0053] According to the technical solution of the embodiment of the present disclosure, by acquiring the text to be recognized, extracting features of the text to be recognized, obtaining a target global feature vector and a target local feature vector, concatenating the target global feature vector and the target local feature vector to obtain a target feature vector, and using a named entity recognition model to process the target feature vector, an entity category recognition result for characterizing the text to be recognized is obtained. Since the target global feature vector and the target local feature vector respectively reflect the global and local features of the text to be recognized, the information of the acquired text to be recognized is relatively comprehensive and rich. Therefore, the target feature vector obtained by concatenating the target global feature vector and the target local feature vector based on the named entity recognition model has a high accuracy rate in named entity recognition, thereby at least partially overcoming the technical problem of low accuracy rate in named entity recognition using related technologies.

[0054] Optionally, based on the above technical solution, the target local feature vector may include a first sentence-level feature vector and a second sentence-level feature vector. Performing feature extraction on the text to be recognized to obtain the target local feature vector may include the following operations.

[0055] Obtain a dictionary, wherein the dictionary includes multiple entities and entity categories corresponding to each entity, and the entity categories include multiple entities. Search the dictionary for entities that match each phrase element in the text to be recognized. According to a preset matching rule, determine the degree of match between each phrase element and the entity that matches each phrase element. According to the entity category corresponding to the entity that matches each phrase element, and the degree of match between each phrase element and the entity that matches each phrase element, obtain a first sentence-level feature vector. Process the text to be recognized using a preset conversion rule to obtain a second sentence-level feature vector, wherein the preset conversion rule is used to convert uppercase letters, lowercase letters, numbers and punctuation marks in the text to be recognized into corresponding preset forms.

[0056] In an embodiment of the present disclosure, in order to obtain the first sentence-level feature vector, a dictionary can be pre-built. The data source in the dictionary can be a database. The database can include at least one of a Dbpedia database, a Freebase database, and a WordNet database. Among them, Dbpedia is a related data set formed based on Wikipedia, the Semantic Web, and related data technology. The embodiment of the present disclosure can divide entity categories into four types, namely, names of people, places, organization names, and others.

[0057] According to an embodiment of the present disclosure, multiple entities can be obtained from the Dbpedia database, and the entity category of each entity can be determined. The entity category can be a person's name, a place name, an organization name, or others. Based on this, a corresponding relationship between each entity and the entity category corresponding to each entity can be constructed, and a dictionary can be generated. Accordingly, the dictionary can include each entity and the entity category corresponding to each entity. Each entity may belong to one or more entity categories.

[0058] After obtaining the dictionary, for each phrase element in the text to be recognized, the entity that matches the phrase element can be searched from the dictionary. According to the preset matching rules, the degree of matching between the phrase element and the entity that matches the phrase element is determined. Among them, the preset matching rules can be used as rules for setting matching types and matching values ​​corresponding to the matching types. The matching types can include matching with the beginning characters of the entity, matching with the middle characters of the entity, matching with the ending characters of the entity, and matching with the entity. The matching values ​​corresponding to the matching types can include matching values ​​corresponding to matching with the beginning characters of the entity, matching values ​​corresponding to matching with the middle characters of the entity, matching values ​​corresponding to matching with the ending characters of the entity, matching values ​​corresponding to matching with the entity, and matching values ​​corresponding to matching with the entity not matching. Among them, the matching values ​​corresponding to the matching types can be set according to actual conditions, and are not specifically limited here. It should be noted that the number of entities that match each phrase element may be one or more, that is, each phrase element may match one or more entities in the dictionary.

[0059] According to an embodiment of the present disclosure, an N-gram language model (ie, N-Gram) may be used to search a dictionary for an entity that matches the phrase element.

[0060] After determining the entity that matches each phrase element in the text to be recognized, the entity category corresponding to the matched entity can be determined as the entity category corresponding to each phrase element, and the degree of matching between each phrase element and the entity that matches each phrase element can be combined to obtain the first sentence-level feature vector corresponding to the text to be recognized.

[0061] Exemplarily, the matching types may include B, I, E, and S. The matching value corresponding to B is 0.5, the matching value corresponding to I is 0.8, the matching value corresponding to E is 0.5, the matching value corresponding to S is 1, and the matching value corresponding to the entity not matching is 0. Among them, B represents matching with the beginning characters of the entity, I represents matching with the middle characters of the entity, E represents matching with the ending characters of the entity, and S represents matching with the entity.

[0062] A phrase element in the text to be recognized is China. Search the dictionary for entities matching China, and find matching entities in the entity categories of names of people, places, organizations, and others, namely entity 1, entity 2, entity 3, and entity 4. Among them, China matches entity 1, China matches entity 2, China matches the middle character of entity 3, and China matches entity 4. Based on this, China can be represented as [1, 1, 0.5, 1].

[0063] According to an embodiment of the present disclosure, in order to obtain a second sentence-level feature vector, uppercase letters, lowercase letters, numbers and punctuation marks in the text to be recognized may be converted into corresponding preset forms according to preset conversion rules to obtain a second sentence-level feature vector.

[0064] For example, the preset conversion rule may be to convert uppercase letters, lowercase letters, numbers and punctuation marks into "C", "c", "n" and "p" respectively. The text to be recognized is "Apple was founded by Jobs in April 1976." The second sentence-level feature vector corresponding to the text to be recognized is "Ccccc ccccccccc cc Cccc cc Ccccc nnnnp".

[0065] According to the embodiments of the present disclosure, by performing sentence-level feature extraction on the text to be recognized from the semantic and format aspects respectively, a first sentence-level feature vector and a second sentence-level feature vector are obtained, thereby achieving deeper features of the text to be recognized, thereby providing data support for improving the accuracy of named entity recognition.

[0066] Optionally, based on the above technical solution, obtaining the first sentence-level feature vector according to the entity category corresponding to the entity matching each phrase element and the degree of matching between each phrase element and the entity matching each phrase element may include the following operations.

[0067] According to the entity category corresponding to the entity matched with each phrase element and the matching degree between each phrase element and the entity matched with each phrase element, a vector corresponding to each phrase element is obtained, wherein each component in the vector is used to characterize the matching degree between the phrase element and the corresponding entity category. According to the vector corresponding to each phrase element in the text to be recognized, a first sentence-level feature vector is obtained.

[0068] In the embodiment of the present disclosure, in order to obtain the first sentence-level feature vector corresponding to the text to be recognized, it can be obtained according to the vector corresponding to each phrase element in the text to be recognized. In the embodiment of the present disclosure, the entity category can include names of people, places, organizations and others.

[0069] For each phrase element in the text to be recognized, the entity category is determined according to the entity matched by the phrase element, and the vector corresponding to the phrase element is obtained according to the degree of matching between the phrase element and the entity matched by the phrase element. Each component in the vector corresponding to the phrase element can represent the degree of matching between the phrase element and the entity category corresponding to the phrase element. Each component corresponds to an entity category. The dimension of each vector is the same as the type of entity category. The degree of matching between the phrase element and the entity category corresponding to the phrase element can be represented by the matching value of the matching type. For matching types and matching values, please refer to the corresponding parts above.

[0070] For example, the vector corresponding to the phrase element can be represented as [x1, x2, x3, x4]. Among them, x1 represents the matching degree between the phrase element and the entity whose entity category is human name, x2 represents the matching degree between the phrase element and the entity whose entity category is place name, x3 represents the matching degree between the phrase element and the entity whose entity category is organization name, and x4 represents the matching degree between the phrase element and the entity whose entity category is other. Take the example that x1 represents the matching degree between the phrase element and the entity whose entity category is human name.

[0071] For a person's name, if a phrase element matches the beginning characters of an entity whose entity category is a person's name, the matching type of the phrase element can be determined to be B, and the matching value corresponding to B can be determined to be x1. If a phrase element matches the middle characters of an entity whose entity category is a person's name, the matching type of the phrase element can be determined to be I, and the matching value corresponding to I can be determined to be x1. If a phrase element matches the ending characters of an entity whose entity category is a person's name, the matching type of the phrase element can be determined to be E, and the matching value corresponding to E can be determined to be x1. If a phrase element matches an entity whose entity category is a person's name, the matching type of the phrase element can be determined to be S, and the matching value corresponding to S can be determined to be x1. If the phrase element does not match an entity whose entity category is a person's name, x1 can be determined to be 0.

[0072] After obtaining the vector corresponding to each phrase element in the text to be recognized, for each dimension of the vector, the average value of the components of each phrase element in the dimension is calculated to obtain the component mean value in the dimension. The first sentence-level feature vector corresponding to the text to be recognized is obtained according to the component mean values ​​of each dimension. Among them, the component of the first sentence-level feature vector in each dimension is the average value of the components of each phrase element in the dimension. Each component in the first sentence-level feature vector corresponds to an entity category.

[0073] For example, if the text to be recognized is "Hayao Tada, commander of the Japanese North China Area Army.", the matching types may include B, I, E, and S. The matching value corresponding to B is 0.5, the matching value corresponding to I is 0.8, the matching value corresponding to E is 0.5, the matching value corresponding to S is 1, and the matching value corresponding to the entity not matching is 0. Among them, B represents the match with the beginning character of the entity, I represents the match with the middle character of the entity, E represents the match with the ending character of the entity, and S represents the match with the entity. The matching results of the text to be recognized and the entities in the dictionary are shown in Table 1 below.

[0074] Table 1

[0075]

[0076] According to an embodiment of the present disclosure, Hayao=[0.5, 0, 0, 0], Tada=[0.5, 0, 0, 0], commander=[0, 0, 0, 1], of=[0, 0, 0, 0.5], the=[0, 0.5, 0.5, 0.5], Japanese=[0, 0.8, 0.8, 0.8], North=[0, 0, 0.5, 1], China=[1, 1, 0.8, 1], Area=[0, 0, 0.8, 1], Army=[0, 0, 0.5, 1]. The first sentence-level feature vector [0.19, 0.21, 0.35, 0.62] is obtained by averaging each dimension of each vector in the text to be recognized.

[0077] Optionally, based on the above technical solution, the target local feature vector may further include a character-level feature vector. Performing feature extraction on the text to be recognized to obtain the target local feature vector may include the following operations.

[0078] The text to be recognized is processed by an embedded character extraction model to obtain embedded characters, wherein the embedded character extraction model is generated based on the training of the first neural network model. The text to be recognized is processed by a character-level feature extraction model to obtain a character-level feature vector, wherein the character-level feature extraction model is generated based on the training of the convolutional neural network model.

[0079] In an embodiment of the present disclosure, in order to improve the accuracy of named entity recognition, the features of the text to be recognized at the character level, that is, the character-level feature vector, can be extracted. This is because for morphologically related phrase elements, if based on word-level features, it is more difficult to represent the connection between morphologically related phrase elements. Therefore, a method of extracting deeper features, that is, a method of extracting character-level features, can be adopted to determine the connection between morphologically related phrase elements, thereby improving the accuracy of named entity recognition. For example, the phrase elements dog and dogs will be determined as two different phrase elements at the word level. However, at the character level, these two phrase elements will be considered different.

[0080] According to an embodiment of the present disclosure, an embedded character extraction model generated based on the training of the first neural network model can be used to process the text to be recognized to obtain embedded characters, and a character-level feature extraction model generated based on the training of the convolutional neural network model can be used to process the embedded characters to obtain a character-level feature vector. The embedded characters can be understood as a vector. The dimension of the embedded characters described in the embodiment of the present disclosure can be 25 dimensions. The dimension of the character-level feature vector can be 55 dimensions.

[0081] According to an embodiment of the present disclosure, the embedded character extraction model is generated based on the training of the first neural network model, which may include the following operations. Obtain a first training sample set, wherein the first training sample set may include multiple first training texts and real annotation information corresponding to each first training text. Use the first training sample set to train the first neural network model to obtain an embedded character extraction model. The first training sample set may come from phrase elements in the Wikipedia corpus. The embedded character extraction model may be a Word2Vec model.

[0082] According to an embodiment of the present disclosure, a character-level feature extraction model is generated based on training of a convolutional neural network model, and may include the following operations. Obtain a second training sample set, wherein the second training sample set may include multiple training embedded characters and real annotation information corresponding to each training embedded character, and the training embedded characters are obtained by processing the first training text in the first training sample set based on the embedded character extraction model. Use the second training sample set to train the convolutional neural network model to obtain a character-level feature extraction model. The convolutional neural network model may include a convolution layer and a maximum pooling layer.

[0083] Figure 3 A schematic diagram of obtaining a character-level feature vector according to an embodiment of the present disclosure is schematically shown. Figure 3 As shown, the text to be recognized is Picasso. The text to be processed is processed based on the embedded character extraction model to obtain the corresponding embedded characters. The embedded characters are processed based on the character-level feature extraction model to obtain a character-level feature vector.

[0084] According to the embodiments of the present disclosure, by performing character-level feature extraction on the text to be recognized and obtaining a character-level feature vector, it is possible to obtain deeper features of the text to be recognized, thereby providing data support for improving the accuracy of named entity recognition.

[0085] Optionally, based on the above technical solution, the target global feature vector may include a word-level feature vector. Performing feature extraction on the text to be recognized to obtain the target global feature vector may include the following operations.

[0086] The text to be recognized is processed using a word-level feature extraction model to obtain a word-level feature vector, wherein the word-level feature extraction model is generated based on the training of the second neural network model.

[0087] In the embodiments of the present disclosure, in order to improve the accuracy of named entity recognition, the features of the text to be recognized at the word level, that is, the word-level feature vector, can be extracted. This is because the features at the word level include the semantic similarity of different phrase elements, so different phrase elements and different contexts with similar semantics can be determined based on the features at the word level.

[0088] Figure 4 A schematic diagram of a word-level feature vector visualization according to an embodiment of the present disclosure is schematically shown. Figure 4 As shown, the word group elements "CAT", "DOG", "KirrEN" and "HOVERCAFT" are displayed. Word group elements with similar semantics are also close in space after being vectorized.

[0089] According to an embodiment of the present disclosure, a word-level feature extraction model generated by training a second neural network model may be used to process the text to be recognized to obtain a word-level feature vector, wherein the second neural network model may be a Word2Vec model.

[0090] Optionally, based on the above technical solution, the named entity recognition model is generated based on the training of a bidirectional long short-term memory neural network model, which may include the following operations.

[0091] A training sample set is obtained, wherein the training sample set includes multiple training texts and real annotation information corresponding to each training text. Feature extraction is performed on each training text to obtain a sample global feature vector and a sample local feature vector. The sample global feature vector and the sample local feature vector corresponding to each training text are concatenated to obtain a sample feature vector corresponding to each training text. A bidirectional long short-term memory neural network model is trained using multiple sample feature vectors and multiple real annotation information to obtain a named entity recognition model.

[0092] In the embodiment of the present disclosure, the training sample set may refer to the third training sample set. The training text may refer to the second training text. Extracting features from each training sample to obtain a sample global feature vector and a sample local feature vector corresponding to each training sample may include the following operations.

[0093] Obtain a dictionary, wherein the dictionary includes multiple entities and entity categories corresponding to each entity, and the entity categories include multiple entities. Search the dictionary for entities that match each phrase element in each training text. According to a preset matching rule, determine the degree of matching between each phrase element in each training text and the entity that matches each phrase element. According to the entity category corresponding to the entity that matches each phrase element in each training text, and the degree of matching between each phrase element and the entity that matches each phrase element, obtain a vector corresponding to each phrase element in each training text. According to the vector corresponding to each phrase element in each training text, obtain a first sentence-level feature vector corresponding to each training text.

[0094] Each training text is processed using a preset conversion rule to obtain a second sentence-level feature vector corresponding to each training text.

[0095] Each training text is processed using an embedded character extraction model to obtain an embedded character corresponding to each training text, wherein the embedded character extraction model is generated based on the training of the first neural network model.

[0096] The embedded characters corresponding to each training text are processed using a character-level feature extraction model to obtain a character-level feature vector corresponding to each training text, wherein the character-level feature extraction model is generated based on convolutional neural network model training.

[0097] Each training text is processed using a word-level feature extraction model to obtain a word-level feature vector corresponding to each training text, wherein the word-level feature extraction model is generated based on the training of the second neural network model.

[0098] Optionally, based on the above technical solution, a bidirectional long short-term memory neural network model is trained using multiple sample feature vectors and multiple real annotation information to obtain a named entity recognition model, which may include the following operations.

[0099] The sample feature vector corresponding to each training text is input into the forward module of the bidirectional long short-term memory neural network model to obtain the first predicted labeling information. The sample feature vector corresponding to each training text is input into the backward module of the bidirectional long short-term memory neural network model to obtain the second predicted labeling information. The first predicted labeling information corresponding to each training text, the second predicted labeling information corresponding to each training text and the true labeling information corresponding to each training text are input into the loss function of the bidirectional long short-term memory neural network model to obtain the loss result. According to the loss result, the network parameters of the bidirectional long short-term memory neural network model are adjusted until the loss function converges, and the bidirectional long short-term memory neural network model obtained after training is used as the named entity recognition model.

[0100] In an embodiment of the present disclosure, a bidirectional long short-term memory neural network model may include a forward module, a backward module and an output layer. The output results of the forward module and the backward module are input into the same output layer. The forward module is used to process the previous information, and the backward module is used to process the following information. The output layer is used to jointly process the output results of the forward module and the output results of the backward module, that is, the first predicted annotation information corresponding to each training text, the second predicted annotation information corresponding to each training text, and the true annotation information corresponding to each training text are input into the loss function of the bidirectional long short-term memory neural network model.

[0101] According to the embodiments of the present disclosure, the bidirectional long short-term memory neural network model can be understood as a combination of a bidirectional recurrent neural network model and a unidirectional long short-term memory neural network model. Since the bidirectional long short-term memory neural network model can learn the input data twice, both positively and negatively, for each phrase element in the text, not only the information of the previous text can be learned, but also the information of the following text can be learned, thereby effectively improving the prediction accuracy of the named entity model, thereby improving the accuracy of named entity recognition.

[0102] According to another method for named entity recognition of an embodiment of the present disclosure, the method comprises the following operations.

[0103] A training sample set is obtained, wherein the training sample set includes a plurality of training texts and true annotation information corresponding to each training text.

[0104] A dictionary is obtained, wherein the dictionary includes a plurality of entities and an entity category corresponding to each entity, and the entity category includes multiple types.

[0105] Look up entities from the dictionary that match each phrase element in each training text.

[0106] According to the preset matching rules, the matching degree between each phrase element in each training text and the entity matched with each phrase element is determined.

[0107] According to the entity category corresponding to the entity matching each phrase element in each training text, and the matching degree between each phrase element and the entity matching each phrase element, a vector corresponding to each phrase element in each training text is obtained, wherein each component in the vector is used to characterize the matching degree between the phrase element and the corresponding entity category.

[0108] According to the vector corresponding to each phrase element in each training text, a first sentence-level feature vector corresponding to each training text is obtained.

[0109] Each training text is processed using a preset conversion rule to obtain a second sentence-level feature vector corresponding to each training text, wherein the preset conversion rule is used to convert uppercase letters, lowercase letters, numbers and punctuation marks in the training text into corresponding preset forms.

[0110] Each training text is processed using an embedded character extraction model to obtain an embedded character corresponding to each training text, wherein the embedded character extraction model is generated based on the training of the first neural network model.

[0111] The embedded characters corresponding to each training text are processed using a character-level feature extraction model to obtain a character-level feature vector corresponding to each training text, wherein the character-level feature extraction model is generated based on convolutional neural network model training.

[0112] Each training text is processed using a word-level feature extraction model to obtain a word-level feature vector corresponding to each training text, wherein the word-level feature extraction model is generated based on the training of the second neural network model.

[0113] The first sentence-level feature vector, the second sentence-level feature vector, the character-level feature vector, and the word-level feature vector corresponding to each training text are concatenated to obtain a sample feature vector corresponding to each training text.

[0114] The sample feature vector corresponding to each training text is input into the forward module of the bidirectional long short-term memory neural network model to obtain the first predicted labeling information.

[0115] The sample feature vector corresponding to each training text is input into the backward module of the bidirectional long short-term memory neural network model to obtain the second prediction labeling information.

[0116] The first predicted annotation information corresponding to each training text, the second predicted annotation information corresponding to each training text, and the true annotation information corresponding to each training text are input into the loss function of the bidirectional long short-term memory neural network model to obtain the loss result.

[0117] The network parameters of the bidirectional long short-term memory neural network model are adjusted according to the loss result until the loss function converges, and the bidirectional long short-term memory neural network model obtained after training is used as a named entity recognition model.

[0118] Get the text to be recognized.

[0119] Look up an entity from the dictionary that matches each phrase element in the text to be recognized.

[0120] According to the preset matching rules, the matching degree between each phrase element in the text to be recognized and the entity matching each phrase element is determined.

[0121] Based on the entity category corresponding to the entity matching each phrase element and the degree of matching between each phrase element and the entity matching each phrase element, a vector corresponding to each phrase element is obtained, wherein each component in the vector is used to characterize the degree of matching between the phrase element and the corresponding entity category.

[0122] According to the vector corresponding to each phrase element in the text to be recognized, a first sentence-level feature vector corresponding to the text to be recognized is obtained.

[0123] The text to be recognized is processed using a preset conversion rule to obtain a second sentence-level feature vector corresponding to the text to be recognized.

[0124] The embedded character extraction model is used to process the text to be recognized to obtain the embedded characters corresponding to the text to be recognized.

[0125] The character-level feature extraction model is used to process the embedded characters corresponding to the text to be recognized, and a character-level feature vector corresponding to the text to be recognized is obtained.

[0126] The word-level feature extraction model is used to process the text to be recognized, and a word-level feature vector corresponding to the text to be recognized is obtained.

[0127] The first sentence-level feature vector, the second sentence-level feature vector, the character-level feature vector and the word-level feature vector corresponding to the sample to be recognized are concatenated to obtain a target feature vector corresponding to the sample to be recognized.

[0128] The target feature vector is processed using the named entity recognition model to obtain the entity category recognition result used to characterize the text to be recognized.

[0129] In the embodiments of the present disclosure, Figure 5 A schematic diagram schematically shows a framework of a method for named entity recognition according to an embodiment of the present disclosure. Figure 6 The following schematically shows an application diagram of a method for named entity recognition according to an embodiment of the present disclosure. Figure 6As shown in the figure, the text to be recognized is "Apple was founded by Jobs". The bidirectional long short-term memory neural network model includes a forward module, a backward module and an output layer. The entity categories are now set to include names of people, places, organizations and others.

[0130] The text to be recognized is subjected to word-level feature extraction, character-level feature extraction, first sentence-level feature extraction, and second sentence-level feature extraction, respectively, to obtain a word-level feature vector, a character-level feature vector, a first sentence-level feature vector, and a second sentence-level feature vector. The word-level feature vector, the character-level feature vector, the first sentence-level feature vector, and the second sentence-level feature vector are spliced ​​and input into the forward module and the backward module respectively, and the output result of the forward module and the output result of the backward module are output. The output result of the forward module and the output result of the backward module are input into the output layer to obtain the score (i.e., probability value) of each entity category of each phrase element in the text to be recognized, and the entity category corresponding to the maximum score is used as the entity category of the phrase element. Thus, the entity category corresponding to each phrase element in the file to be recognized is obtained, wherein the entity category corresponding to Jobs is a person's name.

[0131] According to the technical solution of the embodiment of the present disclosure, by acquiring the text to be recognized, feature extraction is performed on the text to be recognized, and a target global feature vector and a target local feature vector are obtained, wherein the target global feature vector includes a word-level feature vector, and the target local feature vector includes a character-level feature vector, a first sentence-level feature vector, and a second sentence-level feature vector, the target global feature vector and the target local feature vector are concatenated to obtain a target feature vector, and the target feature vector is processed using a named entity recognition model generated by training a bidirectional long short-term memory neural network model to obtain an entity category recognition result for characterizing the text to be recognized. Since the target global feature vector and the target local feature vector respectively reflect the global and local features of the text to be recognized, the information of the acquired text to be recognized is relatively comprehensive and rich. Therefore, the target feature vector obtained by concatenating the target global feature vector and the target local feature vector based on the named entity recognition model is processed, and the accuracy of the obtained named entity recognition is relatively high, thereby at least partially overcoming the technical problem of low accuracy of named entity recognition using related technologies. In addition, since the bidirectional long short-term memory neural network model can learn the input data twice, both positively and negatively, for each phrase element in the text, it can learn not only the previous information but also the following information, thereby effectively improving the prediction accuracy of the named entity model and thus improving the accuracy of named entity recognition.

[0132] Figure 7 A block diagram of a named entity recognition device according to an embodiment of the present disclosure is schematically shown.

[0133] like Figure 7 As shown, the named entity recognition apparatus 700 may include an acquisition module 710 , an extraction module 720 , a concatenation module 730 and a processing module 740 .

[0134] The acquisition module 710 , the extraction module 720 , the splicing module 730 and the processing module 740 are communicatively connected.

[0135] The acquisition module 710 is used to acquire the text to be recognized.

[0136] The extraction module 720 is used to extract features from the text to be recognized to obtain a target global feature vector and a target local feature vector.

[0137] The concatenation module 730 is used to concatenate the target global feature vector and the target local feature vector to obtain a target feature vector.

[0138] The processing module 740 is used to process the target feature vector using the named entity recognition model to obtain an entity category recognition result for representing the text to be recognized.

[0139] According to the technical solution of the embodiment of the present disclosure, by acquiring the text to be recognized, extracting features of the text to be recognized, obtaining a target global feature vector and a target local feature vector, concatenating the target global feature vector and the target local feature vector to obtain a target feature vector, and using a named entity recognition model to process the target feature vector, an entity category recognition result for characterizing the text to be recognized is obtained. Since the target global feature vector and the target local feature vector respectively reflect the global and local features of the text to be recognized, the information of the acquired text to be recognized is relatively comprehensive and rich. Therefore, the target feature vector obtained by concatenating the target global feature vector and the target local feature vector based on the named entity recognition model has a high accuracy rate in named entity recognition, thereby at least partially overcoming the technical problem of low accuracy rate in named entity recognition using related technologies.

[0140] Optionally, based on the above technical solution, the target local feature vector includes a first sentence-level feature vector and a second sentence-level feature vector.

[0141] To perform feature extraction on the text to be recognized, the extraction module 720 may include an acquisition submodule, a search submodule, a determination submodule, a first processing submodule, and a second processing submodule.

[0142] The acquisition submodule is used to acquire a dictionary, wherein the dictionary includes multiple entities and entity categories corresponding to each entity, and the entity categories include multiple types.

[0143] The search submodule is used to search the dictionary for entities that match each phrase element in the text to be recognized.

[0144] The determination submodule is used to determine the matching degree between each phrase element and the entity matched with each phrase element according to a preset matching rule.

[0145] The first processing submodule is used to obtain a first sentence-level feature vector according to the entity category corresponding to the entity matched with each phrase element and the matching degree between each phrase element and the entity matched with each phrase element.

[0146] The second processing submodule is used to process the text to be recognized using a preset conversion rule to obtain a second sentence-level feature vector, wherein the preset conversion rule is used to convert uppercase letters, lowercase letters, numbers and punctuation marks in the text to be recognized into corresponding preset forms.

[0147] Optionally, based on the above technical solution, the first processing submodule may include a first processing unit and a second processing unit.

[0148] The first processing unit is used to obtain a vector corresponding to each phrase element based on the entity category corresponding to the entity matching each phrase element and the degree of matching between each phrase element and the entity matching each phrase element, wherein each component in the vector is used to represent the degree of matching between the phrase element and the corresponding entity category.

[0149] The second processing unit is used to obtain a first sentence-level feature vector according to the vector corresponding to each phrase element in the text to be recognized.

[0150] Optionally, based on the above technical solution, the target local feature vector also includes a character-level feature vector.

[0151] The extraction module 720 may further include a third processing submodule and a fourth processing submodule.

[0152] The third processing submodule is used to process the text to be recognized by using the embedded character extraction model to obtain embedded characters, wherein the embedded character extraction model is generated based on the training of the first neural network model.

[0153] The fourth processing submodule is used to process the embedded characters using a character-level feature extraction model to obtain a character-level feature vector, wherein the character-level feature extraction model is generated based on convolutional neural network model training.

[0154] Optionally, based on the above technical solution, the target global feature vector includes a word-level feature vector.

[0155] The extraction module 720 may further include a fifth processing submodule.

[0156] The fifth processing submodule is used to process the text to be recognized by using a word-level feature extraction model to obtain a word-level feature vector, wherein the word-level feature extraction model is generated based on the training of the second neural network model.

[0157] Optionally, based on the above technical solution, the named entity recognition model is generated based on the training of a bidirectional long short-term memory neural network model, which may include the following operations.

[0158] A training sample set is obtained, wherein the training sample set includes multiple training texts and real annotation information corresponding to each training text. Feature extraction is performed on each training text to obtain a sample global feature vector and a sample local feature vector. The sample global feature vector and the sample local feature vector corresponding to each training text are concatenated to obtain a sample feature vector corresponding to each training text. A bidirectional long short-term memory neural network model is trained using multiple sample feature vectors and multiple real annotation information to obtain a named entity recognition model.

[0159] Optionally, based on the above technical solution, a bidirectional long short-term memory neural network model is trained using multiple sample feature vectors and multiple real annotation information to obtain a named entity recognition model, which may include the following operations.

[0160] The sample feature vector corresponding to each training text is input into the forward module of the bidirectional long short-term memory neural network model to obtain the first predicted labeling information. The sample feature vector corresponding to each training text is input into the backward module of the bidirectional long short-term memory neural network model to obtain the second predicted labeling information. The first predicted labeling information corresponding to each training text, the second predicted labeling information corresponding to each training text and the true labeling information corresponding to each training text are input into the loss function of the bidirectional long short-term memory neural network model to obtain the loss result. According to the loss result, the network parameters of the bidirectional long short-term memory neural network model are adjusted until the loss function converges, and the bidirectional long short-term memory neural network model obtained after training is used as the named entity recognition model.

[0161] According to the modules, submodules, and units of the embodiments of the present disclosure, any multiple or at least part of the functions of any multiple thereof can be implemented in one module. According to the modules, submodules, and units of the embodiments of the present disclosure, any one or more thereof can be split into multiple modules for implementation. According to the modules, submodules, and units of the embodiments of the present disclosure, any one or more thereof can be at least partially implemented as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a System on a Chip, a System on a Substrate, a System on a Package, an Application Specific Integrated Circuit (ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware or in any appropriate combination of any of them. Alternatively, according to the modules, submodules, and units of the embodiments of the present disclosure, one or more thereof can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0162] For example, any multiple of the acquisition module 710, the extraction module 720, the splicing module 730 and the processing module 740 can be combined in one module / submodule / unit for implementation, or any one of the modules / submodules / units can be split into multiple modules / submodules / units. Alternatively, at least part of the functions of one or more modules / submodules / units in these modules / submodules / units can be combined with at least part of the functions of other modules / submodules / units and implemented in one module / submodule / unit. According to an embodiment of the present disclosure, at least one of the acquisition module 710, the extraction module 720, the splicing module 730 and the processing module 740 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the acquisition module 710, the extraction module 720, the splicing module 730 and the processing module 740 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be performed.

[0163] It should be noted that the named entity recognition device part in the embodiment of the present disclosure corresponds to the named entity recognition method part in the embodiment of the present disclosure. The description of the named entity recognition device part specifically refers to the named entity recognition method part, which will not be repeated here.

[0164] Figure 8 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0165] like Figure 8 As shown, the electronic device 800 according to the embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.

[0166] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0167] According to an embodiment of the present disclosure, the system 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The system 800 may further include one or more of the following components connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0168] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0169] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0170] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM (Erasable Programmable Read Only Memory) or flash memory), a portable compact disk read-only memory (Computer Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0171] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 802 and / or the RAM 803 described above and / or one or more memories other than the ROM 802 and the RAM 803 .

[0172] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0173] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A method for named entity recognition, comprising: Get the text to be recognized; Perform feature extraction on the text to be recognized to obtain a target global feature vector and a target local feature vector, wherein the target global feature vector includes a word-level feature vector representing the features of each phrase element in the text to be recognized at the word level, and the target local feature vector includes: a character-level feature vector representing the features of each phrase element in the text to be recognized at the character level, and / or a sentence-level feature vector; the sentence-level feature vector includes a first sentence-level feature vector representing the sentence-level features of the text to be recognized in terms of semantics, and a second sentence-level feature vector representing the sentence-level features of the text to be recognized in terms of format; the second sentence-level feature vector is obtained by converting uppercase letters, lowercase letters, numbers and punctuation marks in the text to be recognized into corresponding preset forms according to preset conversion rules; Concatenating the target global feature vector and the target local feature vector to obtain a target feature vector; and The target feature vector is processed using a named entity recognition model to obtain an entity category recognition result for characterizing the text to be recognized.

2. The method according to claim 1, wherein: The target local feature vector includes a first sentence-level feature vector and a second sentence-level feature vector; The step of extracting features from the text to be recognized to obtain a target local feature vector includes: Obtain a dictionary, wherein the dictionary includes a plurality of entities and an entity category corresponding to each of the entities, and the entity category includes multiple types; Searching the dictionary for an entity that matches each phrase element in the text to be recognized; Determining the degree of matching between each of the phrase elements and the entity that matches each of the phrase elements according to a preset matching rule; Obtaining the first sentence-level feature vector according to the entity category corresponding to the entity matched with each of the phrase elements and the degree of matching between each of the phrase elements and the entity matched with each of the phrase elements; and The text to be recognized is processed using the preset conversion rule to obtain the second sentence-level feature vector, wherein the preset conversion rule is used to convert uppercase letters, lowercase letters, numbers and punctuation marks in the text to be recognized into corresponding preset forms.

3. The method according to claim 2, wherein: The first sentence-level feature vector is obtained according to the entity category corresponding to the entity matched with each of the phrase elements and the degree of matching between each of the phrase elements and the entity matched with each of the phrase elements, including: According to the entity category corresponding to the entity matched with each of the phrase elements and the degree of matching between each of the phrase elements and the entity matched with each of the phrase elements, a vector corresponding to each of the phrase elements is obtained, wherein each component in the vector is used to represent the degree of matching between the phrase element and the corresponding entity category; and The first sentence-level feature vector is obtained according to the vector corresponding to each of the phrase elements in the text to be recognized.

4. The method according to claim 2, wherein: The target local feature vector also includes a character-level feature vector; The step of extracting features from the text to be recognized to obtain a target local feature vector includes: Processing the to-be-recognized text using an embedded character extraction model to obtain embedded characters, wherein the embedded character extraction model is generated based on training of a first neural network model; and The embedded characters are processed using a character-level feature extraction model to obtain the character-level feature vector, wherein the character-level feature extraction model is generated based on convolutional neural network model training.

5. The method according to claim 1, wherein: The target global feature vector includes a word-level feature vector; The step of extracting features from the text to be recognized to obtain a target global feature vector includes: The text to be recognized is processed using a word-level feature extraction model to obtain the word-level feature vector, wherein the word-level feature extraction model is generated based on training of a second neural network model.

6. The method according to claim 1, wherein: The named entity recognition model is generated based on the training of a bidirectional long short-term memory neural network model, including: Acquire a training sample set, wherein the training sample set includes a plurality of training texts and real annotation information corresponding to each of the training texts; Performing feature extraction on each of the training texts to obtain a sample global feature vector and a sample local feature vector; Concatenating the sample global feature vector and the sample local feature vector corresponding to each of the training texts to obtain a sample feature vector corresponding to each of the training texts; and The bidirectional long short-term memory neural network model is trained using the plurality of sample feature vectors and the plurality of real annotation information to obtain the named entity recognition model.

7. The method according to claim 6, wherein: The method of training the bidirectional long short-term memory neural network model using the plurality of sample feature vectors and the plurality of real annotation information to obtain the named entity recognition model includes: Inputting the sample feature vector corresponding to each of the training texts into the forward module of the bidirectional long short-term memory neural network model to obtain first predicted labeling information; Inputting the sample feature vector corresponding to each of the training texts into the backward module of the bidirectional long short-term memory neural network model to obtain second predicted labeling information; Inputting the first predicted labeling information corresponding to each of the training texts, the second predicted labeling information corresponding to each of the training texts, and the real labeling information corresponding to each of the training texts into the loss function of the bidirectional long short-term memory neural network model to obtain a loss result; and The network parameters of the bidirectional long short-term memory neural network model are adjusted according to the loss result until the loss function converges, and the bidirectional long short-term memory neural network model obtained after training is used as the named entity recognition model.

8. A named entity recognition device, comprising: An acquisition module is used to acquire the text to be recognized; An extraction module is used to extract features from the text to be recognized to obtain a target global feature vector and a target local feature vector, wherein the target global feature vector includes a word-level feature vector representing the features of each phrase element in the text to be recognized at the word level, and the target local feature vector includes: a character-level feature vector representing the features of each phrase element in the text to be recognized at the character level, and / or a sentence-level feature vector; the sentence-level feature vector includes a first sentence-level feature vector representing the sentence-level features of the text to be recognized in terms of semantics, and a second sentence-level feature vector representing the sentence-level features of the text to be recognized in terms of format; the second sentence-level feature vector is obtained by converting uppercase letters, lowercase letters, numbers and punctuation marks in the text to be recognized into corresponding preset forms according to preset conversion rules; a concatenation module, configured to concatenate the target global feature vector and the target local feature vector to obtain a target feature vector; and The processing module is used to process the target feature vector using a named entity recognition model to obtain an entity category recognition result for characterizing the text to be recognized.

9. An electronic device, comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Rapid named body identification method

    CN110598212A