Named entity recognition method and apparatus, program product, and electronic device

By combining a multi-head dual affine decoder with a conditional random field decoder, the problem of unclear entity boundaries in named entity recognition is solved, improving the accuracy of named entity recognition and the generalization ability of the model, making it suitable for multilingual scenarios.

WO2026036871A1PCT designated stage Publication Date: 2026-02-19CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/099346
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-16
Filing Date
2025-06-05
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

Existing named entity recognition technologies are not very accurate when dealing with unclear entity boundaries, and they have difficulty capturing global and local dependencies, which limits the generalization ability of the model in different language scenarios.

Method used

A multi-head dual affine decoder combined with a conditional random field decoder is used to encode the text through a bidirectional encoder. The multi-head dual affine decoder learns the relationship between local and global features, dynamically adjusts the contribution value of the heads, and fuses the decoded information to improve the accuracy of named entity recognition.

Benefits of technology

It improves the accuracy of named entity recognition and the generalization ability of the model, enabling it to better handle different types of named entity recognition tasks and is applicable to a wider range of language scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025099346_19022026_PF_FP_ABST
    Figure CN2025099346_19022026_PF_FP_ABST
Patent Text Reader

Abstract

A named entity recognition method and apparatus, a program product, and an electronic device. The method comprises: coding a target text to obtain coded text information (S110); using a first decoder to decode the coded text information to obtain first decoded information (S120); using a multi-head biaffine decoder to decode the coded text information to obtain second decoded information (S130); and determining a named entity recognition result of the target text on the basis of the first decoded information and the second decoded information (S140). In this way, the accuracy of named entity recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Named entity recognition method, device, program product and electronic device

[0001] Cross-reference to Related Applications

[0002] The present application claims priority to the Chinese patent application No. 202411132266.1, filed on August 16, 2024, entitled "Named entity recognition method, device, program product and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0003] The present disclosure relates to the technical field of natural language processing, and particularly relates to a named entity recognition method, a named entity recognition device, a computer program product and an electronic device. BACKGROUND

[0004] Named entity recognition is one of the core tasks in the field of natural language processing, which is used to identify and classify entities with specific meanings from text, such as names, place names, organization names, time, numbers, etc. In related technologies, the accuracy of named entity recognition needs to be improved. SUMMARY

[0005] The present disclosure provides a named entity recognition method, a named entity recognition device, a computer program product and an electronic device to improve the accuracy of named entity recognition at least to some extent.

[0006] According to a first aspect of the present disclosure, a named entity recognition method is provided, the method comprising: encoding a target text to obtain text encoding information; decoding the text encoding information using a first decoder to obtain first decoding information; decoding the text encoding information using a multi-head bi-affine decoder to obtain second decoding information; and determining a named entity recognition result of the target text according to the first decoding information and the second decoding information.

[0007] According to a second aspect of the present disclosure, a named entity recognition device is provided, the device comprising: an encoding module configured to encode a target text to obtain text encoding information; a first decoding module configured to decode the text encoding information using a first decoder to obtain first decoding information; a second decoding module configured to decode the text encoding information using a multi-head bi-affine decoder to obtain second decoding information; and a result output module configured to determine a named entity recognition result of the target text according to the first decoding information and the second decoding information.

[0008] According to a third aspect of the present disclosure, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the method of the first aspect and possible implementation manners thereof.

[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of the first aspect and possible implementation manners thereof by executing the executable instructions.

[0010] The technical solution of the present disclosure has the following beneficial effects:

[0011] On the one hand, the multi-head dual-affine decoder is set, and different heads can learn different feature relationships in the text, thereby comprehensively and fully learning and mining the text information, especially flexibly capturing the complex relationship between labels in the case where the entity boundary is not obvious, which is conducive to accurately identifying the entity boundary and improving the accuracy of the final named entity recognition result. On the other hand, through the combination of the two decoders, the local features and global features in the text can be captured, the text structure and entity boundary can be more comprehensively understood, the generalization ability of the entire model can be improved, different types of named entity recognition tasks can be coped with, and the model can be applied to more extensive language scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0012] FIG. 1 shows a flowchart of a named entity recognition method in the present exemplary embodiment.

[0013] FIG. 2 shows a flowchart of another named entity recognition method in the present exemplary embodiment.

[0014] FIG. 3 shows a flowchart of another named entity recognition method in the present exemplary embodiment.

[0015] FIG. 4 shows a schematic architecture diagram of a multi-head dual-affine decoder in the present exemplary embodiment.

[0016] FIG. 5 shows a flowchart of another named entity recognition method in the present exemplary embodiment.

[0017] FIG. 6 shows a schematic diagram of a named entity recognition method in the present exemplary embodiment.

[0018] FIG. 7 shows a structural schematic diagram of a named entity recognition device in the present exemplary embodiment.

[0019] FIG. 8 shows a structural schematic diagram of an electronic device in the present exemplary embodiment. DETAILED DESCRIPTION

[0020] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.

[0021] The accompanying drawings are illustrative of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams in the drawings can be functional entities that can not necessarily correspond to physically or logically separate entities. These functional entities can be implemented in software, or in hardware, or in a combination of hardware and software, or in network, processor, or microcontroller. The embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. The features, structures, or characteristics described in the present disclosure can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, one skilled in the relevant art will recognize that one or more of the specific details can be omitted, or other methods, components, devices, steps, etc. can be used in place of one or more of the specific details.

[0022] In the related art, a neural network architecture combined with a CRF (Conditional Random Fields) is used to implement named entity recognition. The present inventors have found that the related art has the following problems:

[0023] Named entity recognition needs to determine the boundaries of entities. Algorithms such as CRF usually only consider local dependencies between adjacent labels, and ignore more extensive or longer distance global dependencies. It can be difficult to accurately capture the boundaries of entities with the help of a CRF decoder alone, especially in cases where entity types are diverse and boundaries are not obvious. The diversity and complexity of language mean that entities can have different forms in different contexts. Machine learning models in the related art are difficult to capture context diversity, limiting their ability to generalize to new contexts.

[0024] The above factors result in low accuracy of named entity recognition and difficulty in widely applying it to different language scenarios.

[0025] In view of one or more of the above problems, the exemplary embodiments of the present disclosure provide a named entity recognition method, a named entity recognition device, a computer program product, and an electronic device.

[0026] Based on an embodiment of the present disclosure, referring to FIG. 1, the named entity recognition method can include the following steps S110-S140:

[0027] Step S110, encoding the target text to obtain text encoding information.

[0028] The target text is a text that needs to be subjected to named entity recognition, including N words, N can be any positive integer. Each word can be a Chinese character or an English word (such as a separator with spaces).

[0029] In an implementation, the target text can be encoded by an encoder to obtain text encoding information. For example, the encoder can adopt a BERT (Bidirectional Encoder Representations from Transformers)-BiLSTM (Bidirectional Long Short-Term Memory) architecture. After the target text is input into the encoder, the text encoding information is output through bidirectional encoding.

[0030] In an implementation, each word in the target text can be encoded, and the text encoding information can be a set of encoding information of N words. For example, the N words in the target text are respectively subjected to word embedding processing to obtain text encoding information H, as shown below:

[0031] wherein h1, h2, etc. represent the encoding information of each word (i.e., the embedding representation of the word), and d represents the encoding dimension of each word, which can be the hidden layer dimension of the encoder.

[0032] In step S120, the text encoding information is decoded by a first decoder to obtain first decoding information.

[0033] The first decoder can be a model based on any algorithm. For example, the first decoder can be a CRF decoder. The text encoding information is input into the first decoder, and the first decoding information is output after processing.

[0034] The first decoding information can be feature information obtained by further processing the text encoding information, or can be prediction information about named entity recognition, such as first-class prediction information, including probability values of each word in the text corresponding to each class.

[0035] In step S130, the text encoding information is decoded by a multi-head double-affine decoder to obtain second decoding information.

[0036] The multi-head biaffine decoder is another decoder set outside the first decoder, which is equivalent to a second decoder. The multi-head biaffine decoder has at least two heads, each of which can be regarded as an independent biaffine decoder and decodes by using the biaffine algorithm. Different heads have different weights, biases and other parameters, and can learn different feature relationships in the text. For example, input the text encoding information into the multi-head biaffine decoder, and some heads can learn the local dependency relationship between adjacent words, and some heads can learn the global dependency relationship of a wider or longer distance. Through the multi-head setting, the feature relationships in the text can be comprehensively and fully learned, providing strong support for the final named entity recognition result, which is conducive to improving the accuracy of named entity recognition.

[0037] In step S140, the named entity recognition result of the target text is determined according to the first decoding information and the second decoding information.

[0038] The named entity recognition result can include: which entity label category each word in the target text corresponds to, or the probability value corresponding to different entity label categories; the named entity in the target text and which entity category the named entity belongs to.

[0039] Based on the method of FIG. 1, on the one hand, the multi-head biaffine decoder is set, and different heads can learn different feature relationships in the text, so that the text information can be comprehensively and fully learned and mined, especially in the case where the entity boundary is not obvious, the complex relationship between labels can be flexibly captured, which is conducive to accurately identifying the entity boundary and improving the accuracy of the final named entity recognition result. On the other hand, through the combination of the two decoders, local features and global features in the text can be captured, the text structure and entity boundary can be more comprehensively understood, the generalization ability of the entire model can be improved to cope with different types of named entity recognition tasks, and it is conducive to being applied to more extensive language scenarios.

[0040] Based on an embodiment of the present disclosure, referring to FIG. 2, the named entity recognition method can include the following steps S210 to S230:

[0041] In step S210, the start boundary information and the end boundary information are extracted based on the text encoding information.

[0042] The start boundary information and the end boundary information are two feature information extracted from the text encoding information, which can express the feature information that each word in the target text is the start of an entity, and the feature information that each word is the end of an entity.

[0043] In an embodiment, the text encoding information can be processed by two hidden layers (e.g., two linear layers) respectively to obtain the start boundary information and the end boundary information.

[0044] Exemplarily, the start boundary information H s and the end boundary information H e are as follows: H s = LeakyReLU(HW s ); (1) H e = LeakyReLU(HW e ); (2)

[0045] wherein W s and W e respectively represent two linear layers, which can be learnable weight matrices. LeakyReLU represents a Leaky ReLU (Leaky Rectified Linear Unit) activation function.

[0046] Of course, the disclosure does not limit the specific calculation manner of the hidden layer, the specific form of the activation function, etc.

[0047] In step S220, the start boundary information and the end boundary information are respectively input into each head of the multi-head bi-affine decoder, and the bi-affine feature corresponding to each head is output.

[0048] Based on an embodiment of the disclosure, different heads can have the same structure and different hidden layer parameters. The start boundary information and the end boundary information are respectively input into each head, and the corresponding bi-affine feature is output by each head after calculation. Generally, the bi-affine features corresponding to different heads are also different.

[0049] Based on an embodiment of the disclosure, each head is provided with a bi-affine matrix, a bi-affine weight, and a bi-affine bias, which are all learnable parameters. In the training process, the parameters of different heads can be trained to different values.

[0050] Based on an embodiment of the disclosure, the named entity recognition method can include: in each head, adding a bi-affine bias to a result of multiplying a transpose matrix of the start boundary information with the bi-affine matrix and the end boundary information, and a result of multiplying the bi-affine weight with a concatenation matrix of the start boundary information and the end boundary information, to obtain a bi-affine feature according to a result of the addition. For example, the result of the addition can be taken as the bi-affine feature, or the result of the addition can be further processed, such as being activated by using an activation function, to obtain the bi-affine feature.

[0051] Exemplarily, the i-th head can output the bi-affine feature Ri :

[0052] wherein, U i denotes a bi-affine matrix in the i-th head, Wf i denotes a bi-affine weight in the i-th head, which can be a weight matrix, bf i denotes a bi-affine bias in the i-th head, all of which are learnable parameters. denotes a concatenation operation; d denotes a hidden layer dimension in the i-th head (the hidden layer dimensions of different heads can be the same), which can be equal to the hidden layer dimension of the above-mentioned encoder.

[0053] Step S230, fusing the bi-affine features corresponding to each head to obtain second decoding information.

[0054] For example, the bi-affine features corresponding to each head can be fused in any manner such as concatenation, addition, etc. to obtain the second decoding information.

[0055] Based on an embodiment of the present disclosure, referring to FIG. 3, the named entity recognition method can include the following steps S310 to S320:

[0056] Step S310, inputting the start boundary information and the end boundary information into a gating unit of a multi-head bi-affine decoder to output a contribution value of each head.

[0057] Step S320, fusing the bi-affine features corresponding to each head according to the contribution value of each head to obtain second decoding information.

[0058] In the multi-head bi-affine decoder, each head can learn different feature relationships, and the importance of each head is generally different. Therefore, a gating mechanism is introduced to dynamically adjust the importance of each head to determine its contribution value, and the bi-affine features corresponding to each head are fused according to the contribution value. The head with a larger contribution value has a larger proportion of its corresponding bi-affine features in the fusion. The second decoding information is obtained after the fusion. In this way, different context information can be processed more flexibly, and the performance of the model in processing information of different granularities can be enhanced.

[0059] Based on an embodiment of the present disclosure, the multi-head bi-affine decoder includes a plurality of gating units, each of which corresponds to a head. Each gating unit includes a first gating weight, a second gating weight, and a gating bias, all of which are learnable parameters. In the training process, the parameters of different gating units can be trained to different values.

[0060] Based on an embodiment of the present disclosure, the named entity recognition method can include: in each gating unit, adding a result of multiplying the start boundary information and the first gating weight, a result of multiplying the end boundary information and the second gating weight, and the gating bias, and obtaining a contribution value according to a result of the addition. For example, the result of the addition can be taken as the contribution value, or the result of the addition can be further processed, such as being activated by using an activation function, to obtain the contribution value.

[0061] Based on an embodiment of the present disclosure, FIG. 4 shows a schematic architecture of a multi-head bi-affine decoder, which includes three heads, denoted as bi-affine Head1, bi-affine Head2, and bi-affine Head3, respectively, each head corresponding to a gating unit, denoted as gating unit 1, gating unit 2, and gating unit 3, respectively. After obtaining the start boundary information and the end boundary information by using the linear layer 1 and the linear layer 2, respectively, the start boundary information and the end boundary information are input into each head and each gating unit.

[0062] Taking an arbitrary gating unit j as an example, the contribution value g j The contribution value g j may be calculated according to the following formula: s Mg j + H e Ng j + bg j ); (4)

[0063] wherein sigmoid represents a sigmoid activation function, Mg j , Ng j , and bg j represent the first gating weight, the second gating weight, and the gating bias of the gating unit j, respectively, and are all learnable parameters.

[0064] Based on an embodiment of the present disclosure, the contribution values can be normalized, and bi-affine features corresponding to each head are weighted and fused according to the normalized contribution values to obtain second decoding information.

[0065] For example, the following formula can be referred to:

[0066] wherein B represents the second decoding information, softmax represents a softmax activation function for normalization processing, and K represents the number of heads.

[0067] Based on an embodiment of the present disclosure, the multi-head dual-affine decoder includes a plurality of gating units, each of which corresponds to a head. Each gating unit includes a gating weight (only one gating weight is set for each gating unit, compared with the first gating weight and the second gating weight described above) and a gating bias, both of which are learnable parameters. During the training process, the parameters of different gating units can be trained to different values.

[0068] Based on an embodiment of the present disclosure, the named entity recognition method can include: in each gating unit, adding the result of multiplying the text encoding information and the gating weight to the gating bias, and obtaining a contribution value according to the added result. For example, the added result can be taken as the contribution value, or the added result can be further processed, such as being activated by an activation function, to obtain the contribution value.

[0069] Based on an embodiment of the present disclosure, the multi-head dual-affine decoder includes one gating unit, and the text encoding information and / or the start boundary information and the end boundary information can be input into the gating unit to calculate and output the contribution value of each head.

[0070] Based on an embodiment of the present disclosure, since the contribution values of the heads can be dynamically adjusted, the multi-head dual-affine decoder can be referred to as a dynamic multi-head dual-affine decoder.

[0071] Based on an embodiment of the present disclosure, the named entity recognition method can include: determining first category prediction information according to the first decoding information; determining second category prediction information according to the second decoding information; and fusing the first category prediction information and the second category prediction information to obtain the named entity recognition result of the target text.

[0072] The first category prediction information and the second category prediction information are both category predictions for the named entity of the target text, and can both include probability values of different categories corresponding to each word in the target text. The first category prediction information and the second category prediction information are prediction results based on different decoding information, and fusing the first category prediction information and the second category prediction information is equivalent to complementing the information of the first decoder and the multi-head dual-affine decoder, thereby obtaining a more comprehensive and accurate named entity recognition result.

[0073] Based on an embodiment of the present disclosure, the first decoding information can be taken as the first category prediction information.

[0074] Based on an embodiment of the present disclosure, the first decoding information can be further processed, such as being further processed by a first prediction unit to obtain the first category prediction information. The first prediction unit can include one or more hidden layers.

[0075] Exemplarily, the text encoding information is input into a conditional random field decoder, processed, and first decoding information, i.e., first category prediction information, is output M represents the number of categories or the number of categories plus one.

[0076] According to an embodiment of the present disclosure, the categories can be entity label categories such as B (Begin, representing the first character of an entity name), I (Inside, representing the middle or end character of an entity name), O (Outside, representing a character that is not an entity name), and the like, or entity categories such as a person name, a place name, an organization name, a time, and the like.

[0077] According to an embodiment of the present disclosure, as shown in FIG. 5, the named entity recognition method can include the following steps S510 to S530:

[0078] In step S510, the second decoding information is subjected to average pooling processing to obtain first pooling features.

[0079] In step S520, the second decoding information is subjected to maximum pooling processing to obtain second pooling features.

[0080] In step S530, the second category prediction information is obtained according to the first pooling features and the second pooling features.

[0081] The average pooling processing refers to calculating an average value in a pooling window as a feature value after pooling. The maximum pooling processing refers to taking a maximum value in a pooling window as a feature value after pooling. Through the two kinds of pooling processing, feature information can be fused from different levels, important feature information can be retained, and feature information of each word can be highlighted. The first pooling features and the second pooling features are comprehensively obtained to obtain the second category prediction information.

[0082] According to an embodiment of the present disclosure, the named entity recognition method can include: inputting the first pooling features and the second pooling features after fusion into a multi-layer perceptron for processing to obtain the second category prediction information.

[0083] The first pooling features and the second pooling features can be fused in a manner such as splicing, addition, or weighting, and the result after fusion is input into the multi-layer perceptron. The multi-layer perceptron can comprehensively integrate information between different dimensions, predict relationships between different words, and map the pooled features after fusion to a category space, thereby realizing category prediction for each word and obtaining the second category prediction information.

[0084] Based on an embodiment of the present disclosure, the named entity recognition method can include: processing the text encoding information by using a dynamic fusion unit to obtain a fusion weight; and fusing the first category prediction information and the second category prediction information according to the fusion weight to obtain a named entity recognition result of the target text. The dynamic fusion unit can include one or more hidden layers, such as a linear layer. The fusion weight can include a weight corresponding to one or more of the first category prediction information and the second category prediction information, indicating the proportion of the first category prediction information or the second category prediction information in the final named entity recognition result. For example, the dynamic fusion unit is used to process the text encoding information to obtain a fusion weight a corresponding to the first category prediction information, and the fusion weight corresponding to the first category prediction information is 1-a.

[0085] Referring to FIG. 6, the text encoding information is input into the multi-head bi-affine decoder, and second decoding information B is output after processing. In order to obtain global features, the average pooling layer and the maximum pooling layer are used to pool the second decoding information, and the window size of the two pooling operations can be set to N x 1 x X, X is a hyperparameter, which can be set or adjusted according to specific requirements. After the pooling operation, all dimensions with a size of 1 can be removed, and important features can be retained to obtain the fused pooling features B1, as follows:

[0086] wherein AvgPool(·) and MaxPool(·) represent average pooling and maximum pooling, respectively, W1 and W2 represent the fusion proportions of the first and second pooling features, respectively, and are learnable parameters. The information captured by the average pooling and the maximum pooling can be different, for example, the average pooling can capture global and average statistical information, while the maximum pooling can capture local and most prominent features. Fusing the first and second pooling features can increase the diversity of the features learned by the model, which helps the model to better generalize and provide a more comprehensive perspective.

[0087] Then, a multi-layer perceptron (MLP) is used to learn the relationship between different words and predict the category of each word, thereby obtaining the second category prediction information R B as follows.

[0088] The first decoder and the multi-head bi-affine decoder help the task differently for different named entity recognition cases. The fusion weight of each decoder can be dynamically adjusted according to the information degree of each decoder and the task demand. Exemplarily, the fusion weight corresponding to the first decoder, i.e., the fusion weight corresponding to the first category prediction information, is denoted as α, the fusion weight corresponding to the multi-head bi-affine decoder, i.e., the fusion weight corresponding to the second category prediction information, is denoted as 1-α, and the sum of the weights is ensured to be 1 by softmax, and the following relationship is obtained:

[0089] wherein softmax represents a Softmax activation function, W α is a weight matrix in the dynamic fusion unit, is a learnable parameter, and H represents text encoding information. The named entity recognition result of the target text is obtained by fusing the first category prediction information and the second category prediction information.

[0090] Based on an embodiment of the present disclosure, the first category prediction information and the second category prediction information are fused to obtain fusion prediction information; and the fusion prediction information is processed by an entity category fusion unit to obtain a final named entity recognition result.

[0091] Exemplarily, the fusion prediction information Q can satisfy the following relationship: Q = αR C +(1-α)R B ; (9)

[0092] Q is input into the entity category fusion unit, which can include one or more hidden layers, and after further processing, the named entity recognition result is output, which can include an entity category corresponding to each named entity in the target text.

[0093] Based on an embodiment of the present disclosure, any one or more of the machine learning models or units in the machine learning models can adopt a pre-trained model or can be trained by using certain training data on an initial model and then put into actual application.

[0094] The present exemplary embodiment realizes information complementation between different decoders by fusing the two decoders, for example, the conditional random field decoder can capture the dependency between labels, and the multi-head bi-affine decoder can capture the dependency between words, and the combination of the two can more comprehensively model the complex relationships in the named entity recognition task. At the same time, by fusing the two modules, the fine-grained feature modeling capability of the conditional random field and the global optimization capability of the multi-head bi-affine decoder can be utilized, thereby improving the accuracy of the named entity recognition task.

[0095] Based on an embodiment of the present disclosure, the named entity recognition technology can be integrated into intelligent systems, network management and maintenance systems, and the like. For example, an intelligent system equipped with the named entity recognition technology can understand natural language instructions from users, identify key entities in the instructions, and then intelligently perform corresponding control operations. For another example, a network management and maintenance system using the named entity recognition technology can automatically identify key technical entities and problem descriptions through analysis of technical documents and user feedback, helping technical personnel quickly locate problems and develop solutions. Based on the named entity recognition technology, complex information in scenarios can be deeply mined, thereby improving the intelligent level of related products and services, better meeting the individualized needs of users, enhancing user experience, and improving service efficiency and quality.

[0096] Based on an embodiment of the present disclosure, referring to FIG. 7, the named entity recognition apparatus 700 can include:

[0097] The encoding module 710 is configured to encode a target text to obtain text encoding information.

[0098] The first decoding module 720 is configured to decode the text encoding information by using a first decoder to obtain first decoding information.

[0099] The second decoding module 730 is configured to decode the text encoding information by using a multi-head bi-affine decoder to obtain second decoding information.

[0100] The result output module 740 is configured to determine a named entity recognition result of the target text according to the first decoding information and the second decoding information.

[0101] Based on an embodiment of the present disclosure, the decoding of the text encoding information by using the multi-head bi-affine decoder to obtain the second decoding information includes:

[0102] Extracting start boundary information and end boundary information based on the text encoding information;

[0103] Inputting the start boundary information and the end boundary information into each head of the multi-head bi-affine decoder respectively, and outputting bi-affine features corresponding to each head;

[0104] Fusing the bi-affine features corresponding to each head to obtain the second decoding information.

[0105] Based on an embodiment of the present disclosure, the fusing of the bi-affine features corresponding to each head to obtain the second decoding information includes:

[0106] input the start boundary information and the end boundary information into a gating unit of the multi-head bi-affine decoder, and output a contribution value of each head;

[0107] fuse a bi-affine feature corresponding to each head according to the contribution value of the head, to obtain the second decoding information.

[0108] According to an embodiment of the present disclosure, the multi-head bi-affine decoder comprises a plurality of gating units, each corresponding to one head; each gating unit comprises a first gating weight, a second gating weight, and a gating bias;

[0109] The inputting of the start boundary information and the end boundary information into the gating unit of the multi-head bi-affine decoder and the outputting of the contribution value of each head comprise:

[0110] In each gating unit, the result of multiplying the start boundary information by the first gating weight, the result of multiplying the end boundary information by the second gating weight, and the gating bias are added, and the contribution value is obtained according to the added result.

[0111] According to an embodiment of the present disclosure, each head is provided with a bi-affine matrix, a bi-affine weight, and a bi-affine bias;

[0112] The inputting of the start boundary information and the end boundary information into each head of the multi-head bi-affine decoder and the outputting of the bi-affine feature corresponding to each head comprise:

[0113] In each head, the result of multiplying the transpose matrix of the start boundary information by the bi-affine matrix and the end boundary information, the result of multiplying the bi-affine weight by the splicing matrix of the start boundary information and the end boundary information, and the bi-affine bias are added, and the bi-affine feature is obtained according to the added result.

[0114] According to an embodiment of the present disclosure, the determining of the named entity recognition result of the target text according to the first decoding information and the second decoding information comprises:

[0115] determining first category prediction information according to the first decoding information;

[0116] determining second category prediction information according to the second decoding information;

[0117] fusing the first category prediction information and the second category prediction information to obtain the named entity recognition result of the target text.

[0118] According to an embodiment of the present disclosure, the determining of the second category prediction information according to the second decoding information comprises:

[0119] performing average pooling processing on the second decoding information to obtain a first pooled feature;

[0120] performing maximum pooling processing on the second decoding information to obtain a second pooled feature;

[0121] obtaining the second category prediction information according to the first pooled feature and the second pooled feature.

[0122] According to an embodiment of the present disclosure, the obtaining the second category prediction information according to the first pooled feature and the second pooled feature comprises:

[0123] inputting the first pooled feature and the second pooled feature after fusion into a multi-layer perception machine for processing to obtain the second category prediction information.

[0124] According to an embodiment of the present disclosure, the fusing the first category prediction information and the second category prediction information to obtain the named entity recognition result of the target text comprises:

[0125] processing the text encoding information by using a dynamic fusion unit to obtain a fusion weight;

[0126] fusing the first category prediction information and the second category prediction information according to the fusion weight to obtain the named entity recognition result of the target text.

[0127] According to an embodiment of the present disclosure, the first decoder comprises a conditional random field decoder.

[0128] The specific details of each part of the above device have been described in detail in the method part embodiment, and the undisclosed details can be referred to the embodiment content of the method part, thus no longer be described.

[0129] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, such division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into embodied by multiple modules or units.

[0130] The exemplary embodiments of the present disclosure also provide a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the above named entity recognition method.

[0131] In an embodiment, the computer program product can be a tangible product including the computer program, such as a computer-readable storage medium storing the computer program. The computer-readable storage medium can be a storage medium based on electric, magnetic, optical, electromagnetic, infrared, etc. signals, including but not limited to random access memory (RAM), read only memory (ROM), magnetic tape, floppy disk, Flash memory (Flash), mechanical hard disk (HDD), solid state disk (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing the computer program, such as read only memory (ROM), Nand Flash, etc.

[0132] In an embodiment, the computer program product can be an intangible product including the computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, etc. digital file storing the computer program.

[0133] The code of the computer program can be written in one or more programming languages. Programming languages include, for example, C, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (for example, through an Internet connection provided by an operator).

[0134] The computer program can be carried or transmitted by electric, magnetic, optical, electromagnetic, infrared, etc. signals. The electronic device can convert the signals carrying the computer program into digital signals, and then run the computer program. When the computer program is running on the electronic device, its code is used to make the electronic device execute (more specifically, can make the processor of the electronic device execute) the method steps of various exemplary embodiments of the present disclosure, such as the method steps of the above-mentioned FIG. 1.

[0135] The exemplary embodiments of the present disclosure also provide an electronic device. The electronic device can include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions.

[0136] The electronic device is exemplarily illustrated in the form of a general computing device with reference to FIG. 8. It should be understood that the electronic device 800 shown in FIG. 8 is only an example, and should not limit the functions and use ranges of the embodiments of the present disclosure.

[0137] As shown in FIG. 8, the electronic device 800 can include a processor 810, a memory 820, a bus 830, an I / O (input / output) interface 840, and a network adapter 850.

[0138] The memory 820 can include a volatile memory, such as a RAM 821, a cache unit 822, and can also include a non-volatile memory, such as a ROM 823. The memory 820 can further include one or more program modules 824, which include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which can include implementation of a network environment. For example, the program modules 824 can include the various modules in the apparatus described above.

[0139] The processor 810 can include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or a NPU (Neural-Network Processing Unit), etc.

[0140] The processor 810 can be configured to execute executable instructions stored in the memory 820, which can include method steps of various exemplary embodiments of the present disclosure, such as the method steps of FIG. 1.

[0141] The bus 830 is configured to enable connection between different components of the electronic device 800, and can include a data bus, an address bus, and a control bus.

[0142] The electronic device 800 can communicate with one or more external devices 900 (such as a keyboard, a mouse, an external controller, etc.) through the I / O interface 840.

[0143] The electronic device 800 can communicate with one or more networks through the network adapter 850, such as a network adapter 850 that can provide a mobile communication solution, such as 3G / 4G / 5G, or a wireless communication solution, such as a wireless local area network, Bluetooth, near field communication, etc. The network adapter 850 can communicate with other modules of the electronic device 800 through the bus 830.

[0144] Although not shown in FIG. 8, other hardware and / or software modules can also be included in electronic device 800, including but not limited to: a display, microcode, device drivers, redundant processors, external disk drive arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems, etc.

[0145] It can be understood by those skilled in the art that the technical solutions of the present disclosure can be implemented as methods, devices, systems, computer program products, storage media, electronic devices, etc. Those skilled in the art can understand that various aspects of the present disclosure can be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, such as can be referred to as "circuitry", "module" or "system".

[0146] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art, based on the specific embodiments provided by the present disclosure, will easily think of other embodiments. Therefore, the specific embodiments provided by the present disclosure are only exemplary, the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or conventional technical means in the art not disclosed by the present disclosure should be covered.

Claims

1. A named entity recognition method, the method comprising: encoding a target text to obtain text encoding information; decoding the text encoding information using a first decoder to obtain first decoding information; decoding the text encoding information using a multi-head bi-affine decoder to obtain second decoding information; determining a named entity recognition result of the target text according to the first decoding information and the second decoding information.

2. The method of claim 1, wherein, The decoding of the text encoding information using the multi-head bi-affine decoder to obtain the second decoding information comprises: extracting start boundary information and end boundary information based on the text encoding information; inputting the start boundary information and the end boundary information into each head of the multi-head bi-affine decoder respectively to output bi-affine features corresponding to each head; fusing the bi-affine features corresponding to each head to obtain the second decoding information.

3. The method of claim 2, wherein, The fusing of the bi-affine features corresponding to each head to obtain the second decoding information comprises: inputting the start boundary information and the end boundary information into a gating unit of the multi-head bi-affine decoder to output a contribution value of each head; fusing the bi-affine features corresponding to each head according to the contribution value of each head to obtain the second decoding information.

4. The method of claim 2, wherein, The multi-head bi-affine decoder comprises a plurality of gating units, each of which corresponds to a head; each gating unit comprises a first gating weight, a second gating weight, and a gating bias; The inputting of the start boundary information and the end boundary information into the gating unit of the multi-head bi-affine decoder to output the contribution value of each head comprises: in each gating unit, adding a result of multiplying the start boundary information and the first gating weight, a result of multiplying the end boundary information and the second gating weight, and the gating bias according to a result of the addition to obtain the contribution value.

5. The method of claim 2, wherein, Each head is provided with a bi-affine matrix, a bi-affine weight, and a bi-affine bias; The inputting of the start boundary information and the end boundary information into each head of the multi-head bi-affine decoder to output the bi-affine features corresponding to each head comprises: in each head, adding a result of multiplying a transpose matrix of the start boundary information and the bi-affine matrix, the end boundary information, a result of multiplying the bi-affine weight and a concatenation matrix of the start boundary information and the end boundary information, and the bi-affine bias according to a result of the addition to obtain the bi-affine features.

6. The method of claim 1, wherein, The determination of the named entity recognition result of the target text according to the first decoding information and the second decoding information comprises: determining first class prediction information according to the first decoding information; determining second class prediction information according to the second decoding information; fusing the first class prediction information and the second class prediction information to obtain the named entity recognition result of the target text.

7. The method of claim 6, wherein, The determination of the second class prediction information according to the second decoding information comprises: performing average pooling processing on the second decoding information to obtain first pooled features; performing maximum pooling processing on the second decoding information to obtain second pooled features; According to the first pooled feature and the second pooled feature, the second category prediction information is obtained.

8. The method of claim 7, wherein, The second category prediction information is obtained according to the first pooled feature and the second pooled feature, including: The first pooled feature and the second pooled feature are fused and input into a multi-layer perception machine for processing to obtain the second category prediction information.

9. The method of claim 6, wherein, The first category prediction information and the second category prediction information are fused to obtain the named entity recognition result of the target text, including: The text encoding information is processed by using a dynamic fusion unit to obtain a fusion weight; The first category prediction information and the second category prediction information are fused according to the fusion weight to obtain the named entity recognition result of the target text.

10. The method according to any one of claims 1 to 9, wherein, The first decoder includes a conditional random field decoder.

11. A named entity recognition apparatus, the apparatus comprising: An encoding module configured to encode a target text to obtain text encoding information; A first decoding module configured to decode the text encoding information by using a first decoder to obtain first decoding information; A second decoding module configured to decode the text encoding information by using a multi-head double affine decoder to obtain second decoding information; A result output module configured to determine a named entity recognition result of the target text according to the first decoding information and the second decoding information.

12. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1 to 10.

13. An electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to implement the method of any one of claims 1 to 10 via execution of the executable instructions. ​

Citation Information

Patent Citations

  • Chinese legal text entity recognition method based on boundary detection and prompt learning

    CN114372470A

  • Chinese nested named entity recognition method integrated with word boundary information

    CN114386417A

  • Knowledge extraction method and system, terminal and storage medium

    CN116306654A

  • Chinese predicate recognition method based on POS fusion feature and entity boundary diagnosis

    CN117252199A

  • Nested named entity recognition method based on multi-head double-affine model and attention mechanism

    CN118446217A