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

By combining deep learning and Gaussian mixture models, character features of target text are obtained for boundary and entity classification, which solves the problem of insufficient accuracy in named entity recognition, achieves more accurate and reliable entity recognition results, and provides uncertainty indication.

CN115130474BActive Publication Date: 2026-06-02TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-05-12
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies lack sufficient accuracy in named entity recognition and lack indications of the reliability of recognition results.

Method used

Using deep learning technology, boundary and entity classification is performed by acquiring the character features of the target text. Combined with Gaussian mixture model, the probability distribution of boundaries and entities and uncertainty values ​​are output to perform named entity recognition and provide uncertainty indication.

Benefits of technology

It improves the accuracy of named entity recognition, provides an indication of the reliability of entity recognition results, and supports decision-making for subsequent tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115130474B_ABST
    Figure CN115130474B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a named entity recognition method, device and equipment and a storage medium. The method comprises: performing boundary classification processing and entity classification processing on character features of each character in a target text obtained, to obtain boundary classification results and corresponding entity classification results of each character; any boundary classification result comprises a boundary probability distribution of a corresponding character and an uncertainty value of the corresponding boundary probability distribution, and any entity classification result comprises an entity probability distribution of a corresponding character and an uncertainty value of the corresponding entity probability distribution; performing named entity recognition on the target text based on the boundary probability distribution of each character and the corresponding entity probability distribution, to obtain an entity recognition result; and outputting uncertainty indication information of the entity recognition result based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution. The embodiments of the present application can improve the accuracy of the entity recognition result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a named entity recognition method, apparatus, device and storage medium. Background Technology

[0002] Currently, with the continuous development of internet technology, natural language processing (such as text processing) has become an important direction in the fields of computer science and artificial intelligence, and has been widely applied. Named Entity Recognition (NER) is a fundamental task for other natural language processing tasks. NER refers to identifying words with entity meaning from text (such as extracting names of people, places, and organizations from a sentence). Therefore, improving the accuracy of named entity recognition for target text has become a research hotspot. Summary of the Invention

[0003] This application provides a named entity recognition method, apparatus, device, and storage medium, which can improve the accuracy of named entity recognition of target text, that is, improve the accuracy of entity recognition results, and can output uncertainty indication information of entity recognition results to further indicate the accuracy (i.e., reliability) of entity recognition results.

[0004] On one hand, embodiments of this application provide a named entity recognition method, the method comprising:

[0005] Obtain the character features of each character in the target text;

[0006] The character features of each character are subjected to boundary classification processing to obtain the boundary classification results of each character; any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution, wherein the boundary probability distribution indicates the distribution of the probability of the corresponding character belonging to each boundary category;

[0007] The character features of each character are subjected to entity classification processing to obtain the entity classification result of each character; any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution, wherein the entity probability distribution indicates the distribution of the probability of the corresponding character belonging to each entity category;

[0008] Based on the boundary probability distribution of each character and the corresponding entity probability distribution, named entity recognition is performed on the target text to obtain entity recognition results; and based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, uncertainty indication information of the entity recognition results is output.

[0009] On the other hand, embodiments of this application provide a named entity recognition device, the device comprising:

[0010] The acquisition unit is used to acquire the character features of each character in the target text;

[0011] The processing unit is used to perform boundary classification processing on the character features of each character to obtain the boundary classification result of each character; any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution, wherein the boundary probability distribution indicates the distribution of the probability of the corresponding character belonging to each boundary category;

[0012] The processing unit is further configured to perform entity classification processing on the character features of each character to obtain the entity classification result of each character; any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution, wherein the entity probability distribution indicates the distribution of the probability of the corresponding character belonging to each entity category;

[0013] The processing unit is further configured to perform named entity recognition on the target text based on the boundary probability distribution of each character and the corresponding entity probability distribution, to obtain entity recognition results; and to output uncertainty indication information of the entity recognition results based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution.

[0014] In another aspect, embodiments of this application provide a computer device, the computer device including a processor and a memory, wherein the memory is used to store a computer program, and the computer program, when executed by the processor, performs the following steps:

[0015] Obtain the character features of each character in the target text;

[0016] The character features of each character are subjected to boundary classification processing to obtain the boundary classification results of each character; any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution, wherein the boundary probability distribution indicates the distribution of the probability of the corresponding character belonging to each boundary category;

[0017] The character features of each character are subjected to entity classification processing to obtain the entity classification result of each character; any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution, wherein the entity probability distribution indicates the distribution of the probability of the corresponding character belonging to each entity category;

[0018] Based on the boundary probability distribution of each character and the corresponding entity probability distribution, named entity recognition is performed on the target text to obtain entity recognition results; and based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, uncertainty indication information of the entity recognition results is output.

[0019] In another aspect, embodiments of this application provide a computer storage medium storing a computer program adapted for loading by a processor and executing the following steps:

[0020] Obtain the character features of each character in the target text;

[0021] The character features of each character are subjected to boundary classification processing to obtain the boundary classification results of each character; any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution, wherein the boundary probability distribution indicates the distribution of the probability of the corresponding character belonging to each boundary category;

[0022] The character features of each character are subjected to entity classification processing to obtain the entity classification result of each character; any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution, wherein the entity probability distribution indicates the distribution of the probability of the corresponding character belonging to each entity category;

[0023] Based on the boundary probability distribution of each character and the corresponding entity probability distribution, named entity recognition is performed on the target text to obtain entity recognition results; and based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, uncertainty indication information of the entity recognition results is output.

[0024] In another aspect, embodiments of this application provide a computer program product, which includes a computer program that, when executed by a processor, implements the aforementioned named entity recognition method.

[0025] After obtaining the character features of each character in the target text, this embodiment of the application can perform boundary classification processing on the character features of each character to obtain the boundary classification results of each character. Each boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution. Then, entity classification processing can be performed on the character features of each character to obtain the entity classification results of each character. Each entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution. Then, based on the boundary probability distribution of each character and the corresponding entity probability distribution, named entity recognition can be performed on the target text to obtain more accurate entity recognition results, which can improve the accuracy of named entity recognition on the target text, that is, improve the accuracy of entity recognition results. Furthermore, based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, uncertainty indication information of entity recognition results can be output, thereby further indicating the accuracy (i.e., reliability) of entity recognition results and providing richer instructions for decision-making in subsequent tasks. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1a This is a flowchart illustrating a named entity recognition scheme provided in an embodiment of this application;

[0028] Figure 1b This is a schematic diagram illustrating the interaction between a terminal and a server, provided in an embodiment of this application.

[0029] Figure 2 This is a flowchart illustrating a named entity recognition method provided in an embodiment of this application;

[0030] Figure 3 This is a flowchart illustrating another named entity recognition method provided in an embodiment of this application;

[0031] Figure 4 This is a flowchart illustrating another named entity recognition method provided in an embodiment of this application;

[0032] Figure 5 This is a schematic diagram of the structure of a named entity recognition device provided in an embodiment of this application;

[0033] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0034] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0035] With the continuous development of internet technology, artificial intelligence (AI) technology has also seen significant advancements. Artificial intelligence refers to the theories, methods, technologies, and application systems that utilize digital computers or computers-controlled machines to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce new intelligent machines capable of reacting in a manner similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.

[0036] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0037] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory, among others. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Deep learning, on the other hand, is a technique that utilizes deep neural network systems for machine learning. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0038] Based on machine learning / deep learning techniques in AI, this application proposes a named entity recognition scheme to improve the accuracy of named entity recognition of target files, i.e., to improve the accuracy of the corresponding entity recognition results. It can also output uncertainty indication information of the entity recognition results to further indicate the accuracy (i.e., reliability) of the entity recognition results. It should be noted that this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0039] See Figure 1a As shown in the embodiments of this application, the general principle of the named entity recognition scheme is as follows: First, the character features of each character in the target text can be obtained, and boundary classification and entity classification processing can be performed on the character features of each character respectively to obtain the boundary classification result and the corresponding entity classification result of each character; wherein, any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution, and any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution. Then, named entity recognition can be performed on the target text based on the boundary probability distribution of each character and the corresponding entity probability distribution to obtain entity recognition results; and uncertainty indication information of entity recognition results can be output based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution.

[0040] Practice has shown that the named entity recognition scheme proposed in this application can have at least the following beneficial effects: ① It can improve the accuracy of named entity recognition of target text, that is, improve the accuracy of entity recognition results; ② It can output uncertainty indication information of entity recognition results to further indicate the accuracy (i.e., reliability) of entity recognition results; ③ It can provide richer instructions for decision-making in subsequent tasks, thereby enabling subsequent tasks to obtain more reliable decision results.

[0041] In practical implementation, the named entity recognition scheme mentioned above can be executed by a computer device, which can be a terminal or a server. The terminal mentioned here can include, but is not limited to, smartphones, tablets, laptops, desktop computers, smartwatches, smart voice interaction devices, smart home appliances, in-vehicle terminals, and aircraft. Various clients (apps) can run within the terminal, such as video playback clients, social media clients, browser clients, news feed clients, educational clients, and so on. The server mentioned here can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc. Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. Furthermore, the computer device mentioned in the embodiments of this application can be located outside or inside the blockchain network, and there is no limitation on this. The so-called blockchain network is a network composed of a peer-to-peer network (P2P network) and a blockchain. The blockchain refers to a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. In essence, it is a decentralized database, which is a series of data blocks (or blocks) linked together using cryptographic methods.

[0042] Alternatively, in other embodiments, the named entity recognition scheme mentioned above can also be executed jointly by a server and a terminal; the terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited herein. For example, the terminal can be responsible for acquiring the character features of each character in the target text and sending the character features of each character to the server; the server can then perform boundary classification processing and entity classification processing on the character features of each character respectively, obtain the boundary classification results and the corresponding entity classification results of each character, and send the boundary classification results and the corresponding entity classification results of each character to the terminal; then the terminal performs named entity recognition on the target text based on the boundary classification results and the corresponding entity classification results of each character, obtains the entity recognition result, and outputs uncertainty indication information of the entity recognition result, such as... Figure 1bAs shown. For example, the terminal can acquire the character features of each character in the target text, and perform boundary classification and entity classification processing on each character's features to obtain the boundary classification results and corresponding entity classification results for each character. These results are then sent to the server. The server, based on the boundary classification results and corresponding entity classification results, performs named entity recognition on the target text, obtains the entity recognition results, and outputs uncertainty indication information for the entity recognition results, and so on. It should be understood that this is merely an illustrative example of two scenarios where the terminal and server jointly execute the aforementioned named entity recognition scheme, and is not an exhaustive list.

[0043] Based on the above description of the named entity recognition scheme, this application proposes a named entity recognition method, which can be executed by the aforementioned computer device (terminal or server); or, the named entity recognition method can be executed jointly by the terminal and the server. For ease of explanation, the following description will use the execution of the named entity recognition method by a computer device as an example; please refer to [link to relevant documentation]. Figure 2 The named entity recognition method may include the following steps S201-S204:

[0044] S201, Obtain the character features of each character in the target text.

[0045] It should be noted that this application proposes a deep model architecture (i.e., a named entity recognition model) for named entity recognition. This architecture can serve as a basic module for a series of tasks in business, such as question answering systems (QA) and machine translation. A question answering system is a high-level form of information retrieval system that can answer user questions posed in natural language accurately and concisely. Machine translation refers to the process of converting one natural language (source language) into another natural language (target language). Furthermore, this architecture can also perform uncertainty quantification and be applied to active learning scenarios. The uncertainty quantification module can be used to mine samples with higher value in actual business (i.e., uncertain text or samples with high uncertainty) and filter samples with lower value (i.e., deterministic text), thereby reducing the cost of manual annotation.

[0046] Specifically, when a computer device acquires the character features of each character in a target text, it can acquire the target text and extract features from each character in the target text to obtain the character features of each character; or, if the computer device's storage space stores the character features of each character included in each of one or more texts, the computer device can select the target text from the stored one or more texts to obtain the character features of each character in the target text, and so on; this application does not limit this.

[0047] The methods for obtaining the target text include, but are not limited to, the following:

[0048] The first method is to obtain the target text by first acquiring its download link, and then downloading it using that link. Alternatively, if the computer device has one or more text files stored in its storage, it can select at least one text file from those files and use all selected text files as the target text.

[0049] The second method of acquisition: The computer device can be configured with a text input component, so the computer device can acquire text through the text input component and use the acquired text as the target text.

[0050] Accordingly, after acquiring the target text, the computer device can use the word feature extraction module (i.e., the deep feature extraction module) in the above architecture to extract features from each character in the target text, obtaining the character features of each character; wherein, the deep feature extraction module is a deep model based on a transformer, and the input is the embedding representation of each character in the target text. i After a series of self-attention modules and regularization modules, the character features (i.e., the deep representations of different characters) h of each character are obtained. i , i∈[1,D], where D is the number of characters in the target text; that is, the computer device can call the deep feature extraction module in the named entity recognition model to extract features from each character and obtain the character features of each character, such as Figure 3 As shown.

[0051] The main modules of the aforementioned deformer include a stacked multi-head attention module, a regularization module, and a fully connected module (Feed-forward). The regularization module can also be called a normalization module (Add&Norm). In general, the deep feature extraction module takes the original feature embedding of each character as input, models the relationship between different features through the deformer, and finally obtains the deep feature expression, that is, the character features of each character.

[0052] S202, perform boundary classification processing on the character features of each character to obtain the boundary classification result of each character; any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution. The boundary probability distribution indicates the distribution of the probability of the corresponding character belonging to each boundary category.

[0053] The boundary category of any character can be used to indicate the position of that character in the corresponding word. It should be noted that computer devices can use BIO annotations to represent boundary categories, that is, BIO annotations can be used to annotate the boundary categories of each character; computer devices can also use BIOES annotations to represent boundary categories, that is, BIOES annotations can be used to annotate the boundary categories of each character, and so on; this application does not limit this.

[0054] Specifically, when using BIO annotations to represent boundary categories, boundary categories can be divided into three categories, and each character's boundary category can be labeled using annotations B, I, and O respectively. Annotation B indicates that the boundary category of the corresponding character is "start," annotation I indicates that the boundary category of the corresponding character is "middle," and annotation O indicates that the boundary category of the corresponding character is "other," i.e., not an entity. In other words, when a character's boundary category is "start," the corresponding character is located at the beginning of an entity; when a character's boundary category is "middle," the corresponding character is located in the middle of an entity; and when a character's boundary category is "other," the corresponding character is located outside of any entity, i.e., the corresponding character does not belong to any entity.

[0055] Correspondingly, when using BIOES annotations to represent boundary categories, the boundary categories can be divided into five categories, and each character's boundary category can be annotated using annotations B, I, E, S, and O respectively. Annotation B is used to indicate that the boundary category of the corresponding character is the beginning, annotation I is used to indicate that the boundary category of the corresponding character is the middle, annotation E is used to indicate that the boundary category of the corresponding character is the end, annotation S is used to indicate that the boundary category of the corresponding character is a single character, annotation O is used to indicate that the boundary category of the corresponding character is other, and so on.

[0056] It should be noted that the named entity recognition model proposed in this application may also include a probabilistic decision module, which comprises two sub-modules: a boundary detection module (i.e., a boundary detector) and an entity classification module (entity classifier). Each module can be composed of a Gaussian Mixture Model (GMM). Accordingly, the boundary detection module can also be called the first Gaussian Mixture Network, and the entity classification module can also be called the second Gaussian Mixture Network. It is understood that for samples with high boundary detection uncertainty, the performance of the boundary detector in the named entity recognition model can be further improved, i.e., the boundary detector can be strengthened. Samples with high boundary detection uncertainty can refer to text where the summation of the uncertainty values ​​of the boundary probability distributions of each character (i.e., the uncertainty values ​​of boundary detection) is greater than a preset summation boundary threshold, or text where the mean of the uncertainty values ​​of the boundary probability distributions of each character is greater than a preset mean boundary threshold, etc.; this application does not limit this. Correspondingly, for samples with high uncertainty in entity classification, the performance of the entity classifier in the named entity recognition model can be further improved, i.e., the entity classifier can be strengthened. Among them, samples with high uncertainty in entity classification can refer to text in which the summation of the uncertainty values ​​of the entity probability distribution of each character (i.e., the uncertainty value of entity classification or the uncertainty value of entity category prediction) is greater than a preset summation threshold, or text in which the mean of the uncertainty values ​​of the entity probability distribution of each character is greater than a preset mean threshold, etc. This application does not limit this.

[0057] In this case, the computer device can call the first Gaussian mixture network to perform boundary classification processing on the character features of each character and obtain the boundary classification results of each character; that is, the computer device can output the boundary classification results of each character through the first Gaussian mixture network.

[0058] S203, perform entity classification processing on the character features of each character to obtain the entity classification result of each character; any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution, the entity probability distribution indicates the distribution of the probability of the corresponding character belonging to each entity category.

[0059] Each entity category includes, but is not limited to: personal names, place names, organization names, time and date, etc.; this application does not limit this.

[0060] Specifically, the computer device can call the second Gaussian mixture network to perform entity classification processing on the character features of each character, and obtain the entity classification results of each character; that is, the computer device can output the entity classification results of each character through the second Gaussian mixture network.

[0061] Understandably, the named entity recognition model integrates a deformer and a Gaussian mixture model. The deformer is responsible for extracting character features (i.e., word representation features), while the Gaussian mixture model outputs the final decision result and the corresponding uncertainty value. Furthermore, this named entity recognition model separates boundary classification from entity classification, using two independent modules to obtain the boundary classification results and entity classification results respectively. This design allows the named entity recognition model to simultaneously obtain the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution.

[0062] S204. Based on the boundary probability distribution of each character and the corresponding entity probability distribution, perform named entity recognition on the target text to obtain entity recognition results; and based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, output uncertainty indication information of the entity recognition results.

[0063] It should be noted that the output methods for uncertainty indication information of entity recognition results include, but are not limited to, the following:

[0064] The first output method: The computer device can use the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution as uncertainty indication information of the entity recognition result. In this case, the computer device can output the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution to indicate the accuracy, i.e., the reliability, of the entity recognition result.

[0065] The second output method: The computer device can sum the uncertainty values ​​of the boundary probability distribution of each character to obtain the boundary uncertainty value of the entity recognition result; and sum the uncertainty values ​​of the entity probability distribution of each character to obtain the entity uncertainty value of the entity recognition result; then, the computer device can use the boundary uncertainty value and the entity uncertainty value as uncertainty indication information of the entity recognition result. In this case, the computer device can output the boundary uncertainty value and the entity uncertainty value of the entity recognition result to indicate the accuracy of the entity recognition result.

[0066] The third output method: The computer device can sum the uncertainty values ​​of the boundary probability distribution of each character and the uncertainty values ​​of the corresponding entity probability distribution to obtain the target uncertainty value, and use the target uncertainty value as the uncertainty indication information of the entity recognition result; in this case, the computer device can output the target uncertainty value to indicate the accuracy of the entity recognition result.

[0067] The fourth output method involves a computer device determining the result type of the entity recognition result based on the uncertainty values ​​of the boundary probability distributions of each character and the corresponding entity probability distributions. This result type indicates whether the entity recognition result is uncertain or deterministic. It can also be used as uncertainty indication information for the entity recognition result, and so on. In this case, the computer device can calculate a target uncertainty value based on the uncertainty values ​​of the boundary probability distributions of each character and the corresponding entity probability distributions. If the target uncertainty value is greater than a preset target threshold, the result type can be determined to indicate that the entity recognition result is uncertain. If the target uncertainty value is less than or equal to the preset target threshold, the result type can be determined to indicate that the entity recognition result is deterministic. Alternatively, the computer device can first calculate the boundary uncertainty value and the entity uncertainty value of the entity recognition result. If the boundary uncertainty value is greater than a preset boundary threshold and the entity uncertainty value is greater than a preset entity threshold, the computer device can determine the result type to indicate that the entity recognition result is uncertain, and so on. This application does not limit the specific implementation method for determining the result type of the entity recognition result.

[0068] After obtaining the character features of each character in the target text, this embodiment of the application can perform boundary classification processing on the character features of each character to obtain the boundary classification results of each character. Each boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution. Then, entity classification processing can be performed on the character features of each character to obtain the entity classification results of each character. Each entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution. Then, based on the boundary probability distribution of each character and the corresponding entity probability distribution, named entity recognition can be performed on the target text to obtain more accurate entity recognition results, which can improve the accuracy of named entity recognition on the target text, that is, improve the accuracy of entity recognition results. Furthermore, based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, uncertainty indication information of entity recognition results can be output, thereby further indicating the accuracy (i.e., reliability) of entity recognition results and providing richer instructions for decision-making in subsequent tasks.

[0069] Please see Figure 4 This is a flowchart illustrating another named entity recognition method provided in an embodiment of this application. This named entity recognition method can be executed by the computer device (terminal or server) mentioned above; or, it can be executed jointly by the terminal and the server. For ease of explanation, the following description will use the execution of this named entity recognition method by a computer device as an example; please refer to [link to documentation]. Figure 4The named entity recognition method may include the following steps S401-S408:

[0070] S401, Obtain the character features of each character in the target text.

[0071] S402, perform M boundary detection processes on the character features of any character to obtain M boundary parameter sets, where M is a positive integer; each boundary parameter set includes: parameter set weights, the mean of a Gaussian distribution involved in the boundary probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution.

[0072] Specifically, the computer device can acquire a first Gaussian mixture network, which includes M first Gaussian sub-networks for boundary detection processing. Accordingly, the computer device can call each of the first Gaussian sub-networks in the first Gaussian mixture network to perform boundary detection processing on the character features of any character in parallel, thereby obtaining M boundary parameter sets.

[0073] In this case, the computer device can determine the character characteristics {h} of each character. i ∈R H+1}, i = 1, ..., D are used as inputs to the boundary detection module, and H is a positive integer; that is, the computer device can use the character features of each character as inputs to each first Gaussian sub-network, and a first Gaussian sub-network can refer to a fully connected network, so that the character features of each character pass through a fully connected network (the network parameters and structure are shared by all features) to output each boundary parameter set (i.e., the parameters of each component of the first Gaussian mixture network).

[0074] Understandably, for the i-th character in the target text, the computer device can call the m-th first Gaussian sub-network to perform boundary detection processing on the character feature hi of the i-th character, and obtain the m-th boundary parameter set of the i-th character, that is, the parameter set of the m-th component of the first Gaussian mixture model under the i-th character. Where m∈[1,M], and pos refers to position, i.e. entity position prediction, used to indicate the parameters obtained by boundary detection processing. These three parameters correspond to the parameter group weights in the m-th boundary parameter group, the mean of a Gaussian distribution involved in the boundary probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution. That is, these three parameters correspond to the parameter group weights (i.e., combined weights), the mean of the Gaussian distribution, and the variance of the m-th component of the i-th character in the first Gaussian mixture network.

[0075] S403 uses the mean and variance of each of the M boundary parameter groups to construct the Gaussian distribution corresponding to each boundary parameter group.

[0076] If any of the above characters is the i-th character in the target text, then the Gaussian distribution corresponding to the m-th boundary parameter set of the i-th character can be:

[0077] S404, according to the weights of the parameter groups in each boundary parameter group, perform a weighted summation on the corresponding Gaussian distribution to obtain the boundary probability distribution of any character; and, according to the weights of the parameter groups in each boundary parameter group, perform a weighted summation on the variances in each boundary parameter group to obtain the uncertainty value of the corresponding boundary probability distribution.

[0078] Specifically, if any of the above characters is the i-th character in the target text, then for the i-th character in the target text, the computer device can use Formula 1.1 to calculate the boundary probability distribution of the i-th character as follows:

[0079]

[0080] Accordingly, for the i-th character in the target text, the computer device can use Formula 1.2 to calculate the uncertainty value of the boundary probability distribution of the i-th character as follows:

[0081]

[0082] S405, perform N entity detection processes on the character features of any character to obtain N entity parameter sets, where N is a positive integer; each entity parameter set includes: parameter set weights, the mean of a Gaussian distribution involved in the entity probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution.

[0083] Specifically, the computer device can acquire a second Gaussian mixture network, which includes N second Gaussian sub-networks for entity detection processing. Accordingly, the computer device can call each second Gaussian sub-network in the second Gaussian mixture network to perform entity detection processing on the character features of any character in parallel, and obtain N entity parameter sets.

[0084] In this case, the computer device can determine the character characteristics {h} of each character. i ∈R H+1}, i = 1, ..., D are used as inputs to the entity classification module; that is, the computer device can use the character features of each character as inputs to each second Gaussian subnetwork, and a second Gaussian subnetwork can refer to a fully connected network, so that the character features of each character pass through a fully connected network (the network parameters and structure are shared by all features) to output each entity parameter group (i.e., the parameters of each component of the second Gaussian mixture network).

[0085] Understandably, for the i-th character in the target text, the computer device can call the n-th second Gaussian sub-network to perform entity detection processing on the character features hi of the i-th character, and obtain the n-th entity parameter set of the i-th character, that is, the parameter set of the n-th component of the second Gaussian mixture model under the i-th character. Where n∈[1,N], and cls is used to indicate the parameters obtained by entity detection processing. These three parameters correspond to the parameter group weights in the nth entity parameter group, the mean of a Gaussian distribution involved in the entity probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution. That is, these three parameters correspond to the parameter group weights (i.e., combined weights), the mean of the Gaussian distribution, and the variance of the nth component of the second Gaussian mixture network under the i-th character.

[0086] S406 uses the mean and variance of each of the N entity parameter groups to construct the Gaussian distribution corresponding to each entity parameter group.

[0087] If any of the above characters is the i-th character in the target text, then the Gaussian distribution corresponding to the m-th boundary parameter set of the i-th character can be:

[0088] S407, according to the parameter group weights in each entity parameter group, perform a weighted summation of the corresponding Gaussian distributions to obtain the entity probability distribution of any character; and, according to the parameter group weights in each entity parameter group, perform a weighted summation of the variances in each entity parameter group to obtain the uncertainty value of the corresponding entity probability distribution.

[0089] Specifically, if any of the above characters is the i-th character in the target text, then for the i-th character in the target text, the computer device can use Formula 1.3 to calculate the entity probability distribution of the i-th character as follows:

[0090]

[0091] Accordingly, for the i-th character in the target text, the computer device can use Formula 1.4 to calculate the uncertainty value of the entity probability distribution of the i-th character as follows:

[0092]

[0093] S408, based on the boundary probability distribution of each character and the corresponding entity probability distribution, performs named entity recognition on the target text to obtain entity recognition results; and based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, outputs uncertainty indication information of the entity recognition results.

[0094] In a specific implementation, when a computer device performs named entity recognition on target text based on the boundary probability distribution of each character and the corresponding entity probability distribution to obtain entity recognition results, it can first sample the boundary probability distribution of each character to obtain the first sampling result of each character, and the first sampling result of any character includes the probability that the corresponding character belongs to each boundary category; and then sample the entity probability distribution of each character to obtain the second sampling result of each character, and the second sampling result of any character includes the probability that the corresponding character belongs to each entity category; then, named entity recognition can be performed on the target text based on the first sampling result and the corresponding second sampling result of each character to obtain entity recognition results.

[0095] In one implementation, when performing named entity recognition on the target text based on the first sampling result and the corresponding second sampling result of each character to obtain entity recognition results, the computer device can determine the target boundary category to which each character belongs based on the first sampling result of each character; the target boundary category to which any character belongs refers to the boundary category corresponding to the highest probability in the corresponding first sampling result; and determine the target entity category to which each character belongs based on the second sampling result of each character; the target entity category to which any character belongs refers to the entity category corresponding to the highest probability in the corresponding second sampling result; thereby performing named entity recognition on the target text based on the target boundary category to which each character belongs and the corresponding target entity category to obtain entity recognition results.

[0096] For example, to illustrate the determination of the target boundary category to which any character belongs, suppose the computer device can determine the target boundary category of any character from boundary category A, boundary category B, and boundary category C. That is, the boundary categories can be divided into three categories. Then, the first sampling result of any character can be used to indicate: the probability that any character belongs to boundary category A, the probability that any character belongs to boundary category B, and the probability that any character belongs to boundary category C. Furthermore, suppose that the highest probability in the first sampling result of any character is the probability that any character belongs to boundary category A. Then, the computer device can determine that the target boundary category to which any character belongs is boundary category A.

[0097] Understandably, when performing named entity recognition on target text based on the target boundary category and corresponding target entity category of each character to obtain entity recognition results, the computer device can perform word segmentation on the target text according to the target boundary category of each character to extract one or more entities from the target text; correspondingly, the computer device can determine the entity category of each extracted entity according to the target entity category of each character, thereby obtaining entity recognition results.

[0098] In another implementation, when performing named entity recognition on the target text based on the first sampling result and the corresponding second sampling result of each character to obtain the entity recognition result, the computer device can acquire the entity recognition network and input the first sampling result and the corresponding second sampling result of each character into the entity recognition network to achieve named entity recognition of the target text and obtain the entity recognition result.

[0099] In another implementation, when performing named entity recognition on the target text based on the first sampling result and the corresponding second sampling result of each character to obtain the entity recognition result, the computer device can first determine the target boundary category to which each character belongs based on the first sampling result of each character; and then perform word segmentation on the target text based on the target boundary category to which each character belongs to obtain one or more entities. Then, the computer device can determine the target entity category to which each character belongs based on the second sampling result of each character in the one or more entities; and determine the entity category of each entity based on the target entity category to which each character belongs to, to obtain the entity recognition result.

[0100] It should be noted that the entity recognition result can be obtained by calling the entity recognition network in the target model to perform named entity recognition on the target text. The target model also includes: a first Gaussian mixture network for determining the boundary classification result of any character, and a second Gaussian mixture network for determining the entity classification result of any character; wherein, the first Gaussian mixture network determines the boundary classification result of the corresponding character based on the M boundary parameter sets of any character, and the second Gaussian mixture network determines the entity classification result of the corresponding character based on the N entity parameter sets of any character.

[0101] In this scenario, the computer device can also acquire character annotation information for each character. This character annotation information includes: boundary annotation information obtained by annotating the probability that the corresponding character belongs to each boundary category, and entity annotation information obtained by annotating the probability that the corresponding character belongs to each entity category. Accordingly, the computer device can calculate a first model loss value based on the M boundary parameter sets and corresponding boundary annotation information for each character; and calculate a second model loss value based on the N entity parameter sets and corresponding entity annotation information for each character. Further, the first and second model loss values ​​can be weighted and summed to obtain the target model loss value; and the target model can be optimized in the direction of reducing the target model loss value.

[0102] Specifically, when calculating the first model loss value based on the M boundary parameter sets and corresponding boundary annotation information of each character, the computer device can perform difference calculations on the mean of each boundary parameter set of each character and the corresponding boundary annotation information of the character to obtain multiple first differences; and calculate the first model loss value based on each first difference and the variance in the corresponding boundary parameter set. The number of first differences corresponding to any given character is the same as the number of boundary parameter sets for that character, that is, the number of first differences corresponding to any given character is equal to M, meaning the number of first differences included in the above multiple first differences is equal to the number of boundary parameter sets for each character; furthermore, there is a one-to-one correspondence between the first differences and the boundary parameter sets, meaning the computer device can calculate one first difference based on one boundary parameter set.

[0103] It should be noted that, for the i-th character in the target text, the computer device can use Formula 1.5 to calculate the model loss value corresponding to the i-th character under boundary classification processing:

[0104]

[0105] Where, p i This refers to the boundary labeling information of the i-th character; it can be understood that the computer device can sum the model loss values ​​corresponding to each character under boundary classification processing to obtain the first model loss value.

[0106] Accordingly, when calculating the second model loss value based on the N entity parameter groups and corresponding entity annotation information of each character, the computer device can perform difference calculations on the mean of each entity parameter group of each character and the corresponding entity annotation information to obtain multiple second differences; and calculate the second model loss value based on each second difference and the variance in the corresponding entity parameter group. The number of second differences corresponding to any given character is the same as the number of entity parameter groups for that character, that is, the number of second differences corresponding to any given character is equal to M, meaning the number of second differences included in the above multiple second differences is equal to the number of entity parameter groups for each character; furthermore, there is a one-to-one correspondence between the second differences and the entity parameter groups, meaning the computer device can calculate one second difference based on one entity parameter group.

[0107] It should be noted that, for the i-th character in the target text, the computer device can use Formula 1.6 to calculate the model loss value corresponding to the i-th character in entity classification processing:

[0108]

[0109] Among them, y iThis refers to the entity labeling information of the i-th character; it can be understood that the computer device can sum the model loss values ​​corresponding to each character under entity classification processing to obtain the second model loss value.

[0110] Furthermore, the computer device can determine the text type of the target text based on the uncertainty indication information of the entity recognition result. This text type indicates whether the target text is uncertain or certain. Accordingly, if the text type indicates that the target text is uncertain, then the target text is used as a training sample for the target model, triggering the step of obtaining character annotation information for each character. In other words, if the text type indicates that the target text is uncertain, the computer device can use the target text to train and optimize the target model. In this case, the computer device can identify uncertain text as a high-value sample, thus using only high-value samples to train and optimize the target model, thereby reducing the cost of manual annotation.

[0111] It should be noted that the text type can be numerical or character, and this application does not limit the specific representation of the text type; for example, the text type can be numerical A or numerical B. When the text type is numerical A, the text type can be used to indicate that the target text is uncertain text, and when the text type is numerical B, the text type can be used to indicate that the target text is certain text; as another example, the text type can be the identifier "uncertain text" or the identifier "certain text". When the text type is the identifier "uncertain text", the text type can be used to indicate that the target text is uncertain text, and when the text type is the identifier "certain text", the text type can be used to indicate that the target text is certain text, and so on.

[0112] The methods for determining the text type of the target text include, but are not limited to, the following:

[0113] The first determination method: The uncertainty indication information of the above entity recognition results refers to the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution. Then, the computer device can count the number of first characters in the target text whose uncertainty value of the boundary probability distribution is greater than the character boundary threshold, and count the number of second characters in the target text whose uncertainty value of the entity probability distribution is greater than the character entity threshold. If the ratio between the number of first characters and the number of characters included in the target text is greater than the first ratio, and the ratio between the number of second characters and the number of characters included in the target text is greater than the second ratio, then the text type can be determined to indicate that the target text is uncertain text. If the ratio between the number of first characters and the number of characters included in the target text is less than or equal to the first ratio, or the ratio between the number of second characters and the number of characters included in the target text is less than or equal to the second ratio, then the text type can be determined to indicate that the target text is deterministic text. Alternatively, the computer device can sum the first number of characters and the second number of characters to obtain the target number of characters. If the ratio between the target number of characters and twice the number of characters included in the target text is greater than a third ratio, then the text type can be determined to indicate that the target text is uncertain text, etc.; this application does not limit this.

[0114] The second determination method: The uncertainty indication information of the aforementioned entity recognition result refers to the boundary uncertainty value and entity uncertainty value of the entity recognition result; or, the uncertainty indication information of the aforementioned entity recognition result refers to the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, and the computer device can calculate the boundary uncertainty value and entity uncertainty value of the entity recognition result based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution; then, correspondingly, the computer device can determine the text type of the target text based on the boundary uncertainty value and entity uncertainty value of the entity recognition result. Specifically, if the boundary uncertainty value is greater than the result boundary threshold, and the entity uncertainty value is greater than the result entity threshold, then the text type can be determined to indicate that the target text is uncertain text; if the boundary uncertainty value is less than or equal to the result boundary threshold, or the entity uncertainty value is less than or equal to the result entity threshold, then the text type can be determined to indicate that the target text is deterministic text.

[0115] The third determination method: The uncertainty indication information of the above entity recognition result refers to the target uncertainty value; or, the uncertainty indication information of the above entity recognition result refers to the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, and the computer device can calculate the target uncertainty value based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution; then, correspondingly, the computer device can determine the text type of the target text based on the target uncertainty value. Specifically, if the target uncertainty value is greater than the result target threshold, the text type can be determined to indicate that the target text is uncertain text; if the target uncertainty value is less than or equal to the result target threshold, the text type can be determined to indicate that the target text is deterministic text.

[0116] The fourth determination method: The uncertainty indication information of the aforementioned entity recognition result refers to the result type of the entity recognition result; or, the uncertainty indication information of the aforementioned entity recognition result refers to the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, and the computer device can determine the result type of the entity recognition result based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution; then, correspondingly, the computer device can determine the text type of the target text based on the result type of the entity recognition result. Specifically, if the result type indicates that the entity recognition result is uncertain, the computer device can determine the text type to indicate that the target text is uncertain text; if the result type indicates that the entity recognition result is accurate, the computer device can determine the text type to indicate that the target text is deterministic text, and so on.

[0117] It should be noted that the aforementioned character boundary threshold, character entity threshold, first ratio, and second ratio can all be set based on experience or according to actual needs, and this application does not limit them.

[0118] It should be understood that the computer device can also use the first model loss value to optimize the first Gaussian mixture network (i.e., the boundary detection module) in the target model. That is, the computer device can optimize the first Gaussian mixture network in the target model in the direction of reducing the first model loss value. Correspondingly, the computer device can use the second model loss value to optimize the second Gaussian mixture network (i.e., the entity classification module) in the target model. That is, the computer device can optimize the second Gaussian mixture model in the target model in the direction of reducing the first model loss value, and so on. This application does not limit this.

[0119] This embodiment of the application can, after obtaining the character features of each character in the target text, perform M boundary detection processes on the character features of any character to obtain M boundary parameter sets; and use the M boundary parameter sets of any character to determine the boundary probability distribution and uncertainty value of the corresponding character; correspondingly, it can perform N entity detection processes on the character features of any character to obtain N entity parameter sets; and use the N entity parameter sets of any character to determine the entity probability distribution and uncertainty value of the corresponding character; then, based on the boundary probability distribution of each character and the corresponding entity probability distribution, it can perform named entity recognition on the target text to obtain entity recognition results with higher accuracy, thereby improving the accuracy of named entity recognition on the target text; and based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, it can output uncertainty indication information of the entity recognition result, which can further measure the reliability of the entity recognition result, thereby providing reliable indication for subsequent tasks. As can be seen, this application implements the method to obtain the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, thereby providing richer indication information for the entity recognition result and thus providing richer indication for subsequent tasks; moreover, this application only needs to obtain the uncertainty indication information of the entity recognition result through a single target model, which can effectively save storage space.

[0120] Based on the description of the relevant embodiments of the named entity recognition method above, this application also proposes a named entity recognition device, which can be a computer program (including program code) running on a computer device. The named entity recognition device can execute... Figure 2 or Figure 4 The named entity recognition method shown; please refer to [link / reference]. Figure 5 The named entity recognition device can operate the following units:

[0121] The acquisition unit 501 is used to acquire the character features of each character in the target text;

[0122] The processing unit 502 is used to perform boundary classification processing on the character features of each character to obtain the boundary classification result of each character; any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution, wherein the boundary probability distribution indicates the distribution of the probability of the corresponding character belonging to each boundary category;

[0123] The processing unit 502 is further configured to perform entity classification processing on the character features of each character to obtain the entity classification result of each character; any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution, wherein the entity probability distribution indicates the distribution of the probability of the corresponding character belonging to each entity category;

[0124] The processing unit 502 is further configured to perform named entity recognition on the target text based on the boundary probability distribution of each character and the corresponding entity probability distribution, and obtain entity recognition results; and output uncertainty indication information of the entity recognition results based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution.

[0125] In one embodiment, when the processing unit 502 performs boundary classification processing on the character features of each character to obtain the boundary classification results of each character, it may specifically be used for:

[0126] Perform boundary detection processing on the character features of any character M times to obtain M boundary parameter sets, where M is a positive integer; each boundary parameter set includes: parameter set weights, the mean of a Gaussian distribution involved in the boundary probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution;

[0127] Using the mean and variance of each of the M boundary parameter sets, construct the Gaussian distribution corresponding to each boundary parameter set;

[0128] According to the weights of the parameter groups in each boundary parameter group, the corresponding Gaussian distributions are weighted and summed to obtain the boundary probability distribution of any character; and, according to the weights of the parameter groups in each boundary parameter group, the variances in each boundary parameter group are weighted and summed to obtain the uncertainty value of the corresponding boundary probability distribution.

[0129] In another embodiment, when the processing unit 502 performs M boundary detection processes on the character features of any character to obtain M boundary parameter sets, it can be specifically used for:

[0130] Obtain a first Gaussian mixture network, which includes M first Gaussian sub-networks for boundary detection processing;

[0131] Each of the first Gaussian subnetworks in the first Gaussian mixture network is invoked in parallel to perform boundary detection processing on the character features of any character, resulting in M ​​boundary parameter groups.

[0132] In another embodiment, when the processing unit 502 performs entity classification processing on the character features of each character to obtain the entity classification result of each character, it may specifically be used to:

[0133] Perform N entity detection processes on the character features of any character to obtain N entity parameter sets, where N is a positive integer. Each entity parameter set includes: parameter set weights, the mean of a Gaussian distribution involved in the entity probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution.

[0134] Using the mean and variance of each of the N entity parameter groups, construct the Gaussian distribution corresponding to each entity parameter group respectively;

[0135] According to the parameter group weights in each entity parameter group, the corresponding Gaussian distribution is weighted and summed to obtain the entity probability distribution of any character; and according to the parameter group weights in each entity parameter group, the variances in each entity parameter group are weighted and summed to obtain the uncertainty value of the corresponding entity probability distribution.

[0136] In another embodiment, when the processing unit 502 performs N entity detection processes on the character features of any character to obtain N entity parameter sets, it can be specifically used for:

[0137] Obtain a second Gaussian mixture network, which includes N second Gaussian sub-networks for entity detection processing;

[0138] Each of the second Gaussian subnetworks in the second Gaussian mixture network is invoked in parallel to perform entity detection processing on the character features of any character, resulting in N entity parameter groups.

[0139] In another embodiment, when the processing unit 502 performs named entity recognition on the target text based on the boundary probability distribution and the corresponding entity probability distribution of each character to obtain the entity recognition result, it can be specifically used for:

[0140] The boundary probability distribution of each character is sampled to obtain the first sampling result of each character. The first sampling result of any character includes the probability that the corresponding character belongs to each boundary category.

[0141] The entity probability distribution of each character is sampled to obtain the second sampling result of each character. The second sampling result of any character includes the probability that the corresponding character belongs to each entity category.

[0142] Based on the first sampling result and the corresponding second sampling result of each character, named entity recognition is performed on the target text to obtain entity recognition results.

[0143] In another embodiment, when the processing unit 502 performs named entity recognition on the target text based on the first sampling result and the corresponding second sampling result of each character to obtain the entity recognition result, it can be specifically used for:

[0144] Based on the first sampling result of each character, the target boundary category to which each character belongs is determined; the target boundary category to which any character belongs refers to the boundary category corresponding to the highest probability in the corresponding first sampling result;

[0145] Based on the second sampling results of each character, the target entity category to which each character belongs is determined; the target entity category to which any character belongs refers to the entity category corresponding to the highest probability in the corresponding second sampling results;

[0146] Based on the target boundary category and the corresponding target entity category of each character, named entity recognition is performed on the target text to obtain entity recognition results.

[0147] In another implementation, the entity recognition result is obtained by calling the entity recognition network in the target model to perform named entity recognition on the target text. The target model further includes: a first Gaussian mixture network for determining the boundary classification result of any character, and a second Gaussian mixture network for determining the entity classification result of any character; wherein, the first Gaussian mixture network determines the boundary classification result of the corresponding character based on M boundary parameter sets of any character, and the second Gaussian mixture network determines the entity classification result of the corresponding character based on N entity parameter sets of any character; the processing unit 502 can also be used for:

[0148] Obtain character annotation information for each character. Any character annotation information includes: boundary annotation information obtained by annotating the probability that the corresponding character belongs to each boundary category, and entity annotation information obtained by annotating the probability that the corresponding character belongs to each entity category.

[0149] The first model loss value is calculated based on the M boundary parameter sets and corresponding boundary annotation information of each character; and the second model loss value is calculated based on the N entity parameter sets and corresponding entity annotation information of each character.

[0150] The first model loss value and the second model loss value are weighted and summed to obtain the target model loss value of the target model; and the target model is optimized in the direction of reducing the target model loss value.

[0151] In another embodiment, when the processing unit 502 calculates the first model loss value based on the M boundary parameter sets and corresponding boundary annotation information of each character, it may specifically be used for:

[0152] The mean of each boundary parameter group of each character and the boundary label information of the corresponding character are respectively subjected to difference operation to obtain multiple first difference values; and the first model loss value is calculated based on each first difference value and the variance in the corresponding boundary parameter group.

[0153] When processing unit 502 calculates the second model loss value based on the N entity parameter groups and corresponding entity annotation information of each character, it can specifically be used for:

[0154] The mean of each entity parameter group of each character and the corresponding entity annotation information are respectively calculated to obtain multiple second differences; and the second model loss value is calculated based on each second difference and the variance in the corresponding entity parameter group.

[0155] In another embodiment, the processing unit 502 may also be used for:

[0156] Based on the uncertainty indication information of the entity recognition result, the text type of the target text is determined, and the text type is used to indicate whether the target text is uncertain text or deterministic text;

[0157] If the text type indicates that the target text is uncertain text, then the target text is used as a training sample for the target model, and the step of obtaining the character annotation information of each character is triggered.

[0158] According to one embodiment of this application, Figure 2 or Figure 4 Each step involved in the method shown can be derived from... Figure 5 This is performed by the individual units in the named entity recognition device shown. For example, Figure 2 Step S201 shown can be performed by Figure 5 The acquisition unit 501 shown is executed, and steps S202-S204 can all be performed by... Figure 5 The processing unit 502 shown executes this. For example, Figure 4 Step S401 shown can be performed by Figure 5 The acquisition unit 501 shown is executed, and steps S402-S408 can all be performed by... Figure 5 The processing unit 502 shown executes, etc.

[0159] According to another embodiment of this application, Figure 5The named entity recognition device shown can be constructed by combining each unit individually or entirely into one or more other units, or one or more of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the named entity recognition device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0160] According to another embodiment of this application, the following can be achieved by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), a device capable of performing operations such as... Figure 2 or Figure 4 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 5 The document describes a named entity recognition device and a named entity recognition method for implementing embodiments of this application. The computer program may be recorded on, for example, a computer storage medium, loaded onto the aforementioned computing device via the computer storage medium, and run therein.

[0161] After obtaining the character features of each character in the target text, this embodiment of the application can perform boundary classification processing on the character features of each character to obtain the boundary classification results of each character. Each boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution. Then, entity classification processing can be performed on the character features of each character to obtain the entity classification results of each character. Each entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution. Then, based on the boundary probability distribution of each character and the corresponding entity probability distribution, named entity recognition can be performed on the target text to obtain more accurate entity recognition results, which can improve the accuracy of named entity recognition on the target text, that is, improve the accuracy of entity recognition results. Furthermore, based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, uncertainty indication information of entity recognition results can be output, thereby further indicating the accuracy (i.e., reliability) of entity recognition results and providing richer instructions for decision-making in subsequent tasks.

[0162] Based on the description of the above method and apparatus embodiments, this application also provides a computer device. Please refer to... Figure 6The computer device includes at least a processor 601, an input interface 602, an output interface 603, and a computer storage medium 604. The processor 601, input interface 602, output interface 603, and computer storage medium 604 within the computer device can be connected via a bus or other means.

[0163] Computer storage medium 604 can be stored in the memory of a computer device. The computer storage medium 604 is used to store computer programs, which include program instructions. The processor 601 is used to execute the program instructions stored in the computer storage medium 604. The processor 601 (or CPU (Central Processing Unit)) is the computing and control core of the computer device, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve a corresponding method flow or corresponding function. In one embodiment, the processor 601 described in this application embodiment can be used to perform a series of named entity recognition tasks, specifically including: obtaining the character features of each character in the target text; performing boundary classification processing on the character features of each character to obtain the boundary classification results of each character; any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution, the boundary probability distribution indicating that the corresponding character belongs to each boundary. The distribution of probabilities of boundary categories; entity classification processing is performed on the character features of each character to obtain the entity classification result of each character; any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution, the entity probability distribution indicating the distribution of the probability of the corresponding character belonging to each entity category; based on the boundary probability distribution of each character and the corresponding entity probability distribution, named entity recognition is performed on the target text to obtain the entity recognition result; and based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, uncertainty indication information of the entity recognition result is output, etc.

[0164] This application embodiment also provides a computer storage medium (memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer storage medium provides storage space that stores the operating system of the computer device. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer storage medium located remotely from the aforementioned processor. In one embodiment, the processor can load and execute one or more instructions stored in the computer storage medium to implement the above-mentioned... Figure 2 or Figure 4 The various method steps in the embodiments of the named entity recognition method shown.

[0165] After obtaining the character features of each character in the target text, this embodiment of the application can perform boundary classification processing on the character features of each character to obtain the boundary classification results of each character. Each boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution. Then, entity classification processing can be performed on the character features of each character to obtain the entity classification results of each character. Each entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution. Then, based on the boundary probability distribution of each character and the corresponding entity probability distribution, named entity recognition can be performed on the target text to obtain more accurate entity recognition results, which can improve the accuracy of named entity recognition on the target text, that is, improve the accuracy of entity recognition results. Furthermore, based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, uncertainty indication information of entity recognition results can be output, thereby further indicating the accuracy (i.e., reliability) of entity recognition results and providing richer instructions for decision-making in subsequent tasks.

[0166] It should be noted that, according to one aspect of this application, a computer program product or computer program is also provided, which includes computer instructions stored in a computer storage medium. The processor of a computer device reads the computer instructions from the computer storage medium, executes the computer instructions, and causes the computer device to perform the aforementioned actions. Figure 2 or Figure 4The methods provided in various alternative ways in the embodiments of the named entity recognition method shown are examples of methods.

[0167] Furthermore, it should be understood that the above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application are still within the scope of this application.

Claims

1. A named entity recognition method, characterized in that, include: Obtain the character features of each character in the target text; The character features of each character are subjected to boundary classification processing to obtain the boundary classification results of each character; Any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution. The boundary probability distribution indicates the distribution of the probability of the corresponding character belonging to each boundary category. Specifically, M boundary detection processes are performed on the character features of any character to obtain M boundary parameter sets, where M is a positive integer. Each boundary parameter set includes: parameter set weights, the mean of a Gaussian distribution involved in the boundary probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution. Using the mean and variance of each of the M boundary parameter sets, a Gaussian distribution corresponding to each boundary parameter set is constructed. The Gaussian distributions are then weighted and summed according to the parameter set weights to obtain the boundary probability distribution of the corresponding character. Finally, the variances of each boundary parameter set are weighted and summed according to the parameter set weights to obtain the uncertainty value of the corresponding boundary probability distribution. The character features of each character are subjected to entity classification processing to obtain the entity classification result of each character; any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution, wherein the entity probability distribution indicates the distribution of the probability of the corresponding character belonging to each entity category; Based on the boundary probability distribution of each character and the corresponding entity probability distribution, named entity recognition is performed on the target text to obtain entity recognition results; and based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution, uncertainty indication information of the entity recognition results is output.

2. The method as described in claim 1, characterized in that, The process of performing M boundary detection operations on the character features of any character yields M sets of boundary parameters, including: Obtain a first Gaussian mixture network, which includes M first Gaussian sub-networks for boundary detection processing; Each of the first Gaussian subnetworks in the first Gaussian mixture network is invoked in parallel to perform boundary detection processing on the character features of any character, resulting in M ​​boundary parameter groups.

3. The method as described in claim 1, characterized in that, The entity classification processing of the character features of each character to obtain the entity classification result of each character includes: Perform N entity detection processes on the character features of any character to obtain N entity parameter sets, where N is a positive integer. Each entity parameter set includes: parameter set weights, the mean of a Gaussian distribution involved in the entity probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution. Using the mean and variance of each of the N entity parameter groups, construct the Gaussian distribution corresponding to each entity parameter group respectively; According to the parameter group weights in each entity parameter group, the corresponding Gaussian distribution is weighted and summed to obtain the entity probability distribution of any character; and according to the parameter group weights in each entity parameter group, the variances in each entity parameter group are weighted and summed to obtain the uncertainty value of the corresponding entity probability distribution.

4. The method as described in claim 3, characterized in that, The process of performing N entity detection operations on the character features of any character yields N sets of entity parameters, including: Obtain a second Gaussian mixture network, which includes N second Gaussian sub-networks for entity detection processing; Each of the second Gaussian subnetworks in the second Gaussian mixture network is invoked in parallel to perform entity detection processing on the character features of any character, resulting in N entity parameter groups.

5. The method according to any one of claims 1-4, characterized in that, The method of performing named entity recognition on the target text based on the boundary probability distribution of each character and the corresponding entity probability distribution to obtain entity recognition results includes: The boundary probability distribution of each character is sampled to obtain the first sampling result of each character. The first sampling result of any character includes the probability that the corresponding character belongs to each boundary category. The entity probability distribution of each character is sampled to obtain the second sampling result of each character. The second sampling result of any character includes the probability that the corresponding character belongs to each entity category. Based on the first sampling result and the corresponding second sampling result of each character, named entity recognition is performed on the target text to obtain entity recognition results.

6. The method as described in claim 5, characterized in that, The step of performing named entity recognition on the target text based on the first sampling result and the corresponding second sampling result of each character to obtain entity recognition results includes: Based on the first sampling result of each character, the target boundary category to which each character belongs is determined; the target boundary category to which any character belongs refers to the boundary category corresponding to the highest probability in the corresponding first sampling result; Based on the second sampling results of each character, the target entity category to which each character belongs is determined; the target entity category to which any character belongs refers to the entity category corresponding to the highest probability in the corresponding second sampling results; Based on the target boundary category and the corresponding target entity category of each character, named entity recognition is performed on the target text to obtain entity recognition results.

7. The method according to any one of claims 1-4, characterized in that, The entity recognition result is obtained by calling the entity recognition network in the target model to perform named entity recognition on the target text. The target model further includes: a first Gaussian mixture network for determining the boundary classification result of any character, and a second Gaussian mixture network for determining the entity classification result of any character; wherein, the first Gaussian mixture network determines the boundary classification result of the corresponding character based on M boundary parameter sets of any character, and the second Gaussian mixture network determines the entity classification result of the corresponding character based on N entity parameter sets of any character. The N entity parameter sets of any character are obtained by performing N entity detection processes on the character features of the corresponding character, where N is a positive integer. An entity parameter set includes: parameter set weights, the mean of a Gaussian distribution involved in the entity probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution; The method further includes: Obtain character annotation information for each character. Any character annotation information includes: boundary annotation information obtained by annotating the probability that the corresponding character belongs to each boundary category, and entity annotation information obtained by annotating the probability that the corresponding character belongs to each entity category. The first model loss value is calculated based on the M boundary parameter sets and corresponding boundary annotation information of each character; and the second model loss value is calculated based on the N entity parameter sets and corresponding entity annotation information of each character. The first model loss value and the second model loss value are weighted and summed to obtain the target model loss value of the target model; and the target model is optimized in the direction of reducing the target model loss value.

8. The method as described in claim 7, characterized in that, The step of calculating the first model loss value based on the M boundary parameter sets of each character and the corresponding boundary annotation information includes: The mean of each boundary parameter group of each character and the boundary label information of the corresponding character are respectively subjected to difference operation to obtain multiple first difference values; and the first model loss value is calculated based on each first difference value and the variance in the corresponding boundary parameter group. The step of calculating the second model loss value based on the N entity parameter groups of each character and the corresponding entity annotation information includes: The mean of each entity parameter group of each character and the corresponding entity annotation information are respectively calculated to obtain multiple second differences; and the second model loss value is calculated based on each second difference and the variance in the corresponding entity parameter group.

9. The method as described in claim 7, characterized in that, The method further includes: Based on the uncertainty indication information of the entity recognition result, the text type of the target text is determined, and the text type is used to indicate whether the target text is uncertain text or deterministic text; If the text type indicates that the target text is uncertain text, then the target text is used as a training sample for the target model, and the step of obtaining the character annotation information of each character is triggered.

10. A named entity recognition device, characterized in that, include: The acquisition unit is used to acquire the character features of each character in the target text; The processing unit is used to perform boundary classification processing on the character features of each character to obtain the boundary classification result of each character; Any boundary classification result includes: the boundary probability distribution of the corresponding character and the uncertainty value of the corresponding boundary probability distribution. The boundary probability distribution indicates the distribution of the probability that the corresponding character belongs to each boundary category. The processing unit is further configured to perform entity classification processing on the character features of each character to obtain the entity classification result of each character; any entity classification result includes: the entity probability distribution of the corresponding character and the uncertainty value of the corresponding entity probability distribution, wherein the entity probability distribution indicates the distribution of the probability of the corresponding character belonging to each entity category; wherein, the character features of any character are subjected to M boundary detection processes to obtain M boundary parameter sets, where M is a positive integer; each boundary parameter set includes: parameter set weights, the mean of a Gaussian distribution involved in the boundary probability distribution of the corresponding character, and the variance used to describe the fluctuation of the corresponding Gaussian distribution; using the mean and variance of each boundary parameter set in the M boundary parameter sets, Gaussian distributions corresponding to each boundary parameter set are constructed respectively, and the corresponding Gaussian distributions are weighted and summed according to the parameter set weights in each boundary parameter set to obtain the boundary probability distribution of the corresponding character, and the variances in each boundary parameter set are weighted and summed according to the parameter set weights in each boundary parameter set to obtain the uncertainty value of the corresponding boundary probability distribution; The processing unit is further configured to perform named entity recognition on the target text based on the boundary probability distribution of each character and the corresponding entity probability distribution, to obtain entity recognition results; and to output uncertainty indication information of the entity recognition results based on the uncertainty value of the boundary probability distribution of each character and the uncertainty value of the corresponding entity probability distribution.

11. A computer device, characterized in that, It includes a processor and a memory, wherein the memory is used to store a computer program that, when executed by the processor, implements the method as described in any one of claims 1-9.

12. A computer storage medium, characterized in that, The computer storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-9.