Alias ​​entity recognition method, device, computer equipment, medium and program product

By generating a hidden state transfer probability matrix and constraint probability matrix, the alias entity in the text is determined, and the problem of inaccurate identification of aliases in the existing technologies is solved, and accurate identification and matching of aliases are realized.

CN114372466BActive Publication Date: 2025-01-28SYST OVERALL RES INST INST OF SYST ENG ACAD OF MILITARY SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111683633.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-01-28
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify aliased entities in text, especially in the absence of obvious semantic hints, which leads to the inability to perform subsequent processing tasks correctly.

Method used

By entering the pre -training language module and physical identification module to be entered to be identified, generate a hidden state transfer probability matrix, determine the predictive aliases and named entities, and use the constraint probability matrix of the aliases between the aliases to determine whether the predicted entity is a predictive naming name Alias ​​of entity.

Benefits of technology

The accurate identification of aliases in the text, avoiding dependence on the aliases, can facilitate and effectively identify and match the aliases and named entities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114372466B_ABST
    Figure CN114372466B_ABST
Patent Text Reader

Abstract

Provided is an alias entity recognition method, comprising: inputting a text to be recognized into a pre-trained language module to obtain a feature vector of each character in the text to be recognized; inputting the feature vector of each character in the text to be recognized into an entity recognition module to obtain a hidden state transition probability matrix corresponding to the text to be recognized; determining a predicted alias entity existing in the text to be recognized according to the hidden state transition probability matrix; determining a predicted named entity in the text to be recognized that is located before the predicted alias entity and closest to the predicted alias entity; extracting a probability transfer matrix corresponding to an intermediate character string from the hidden state transition probability matrix; inputting the feature vector of each character in the intermediate character string into an alias entity constraint module to obtain a constraint probability matrix corresponding to the intermediate character string; and determining whether the predicted alias entity is an alias of the predicted named entity based on the probability transfer matrix and the constraint probability matrix.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to an alias entity recognition method, apparatus, computer equipment, medium and program product. Background Art

[0002] Named entity recognition is an important part of text intelligent processing. However, text often contains a large number of implicit semantic expressions, the most obvious of which is alias entities. Alias ​​entities can be considered as another way of expressing named entities, and usually appear in the text with named entities. The location of alias entities in the text is not fixed, and there is no obvious semantic hint for alias entities in the context, which makes it difficult to correctly identify alias entities in the text, and subsequent processing tasks cannot be performed correctly. Summary of the invention

[0003] The present disclosure provides an alias entity recognition method, apparatus, computer equipment, medium and program product.

[0004] According to one aspect of the present disclosure, an alias entity recognition method is provided, comprising: inputting a text to be recognized into a pre-trained language module to obtain a feature vector of each character in the text to be recognized; inputting the feature vector of each character in the text to be recognized into an entity recognition module to obtain a hidden state transition probability matrix corresponding to the text to be recognized; determining the predicted alias entity existing in the text to be recognized according to the hidden state transition probability matrix; determining the predicted named entity in the text to be recognized that is located before the predicted alias entity and closest to the predicted alias entity; extracting a probability transition matrix corresponding to an intermediate character string from the hidden state transition probability matrix, wherein the intermediate character string is a character string located between the predicted named entity and the predicted alias entity in the text to be recognized, and the probability transition matrix can be used to determine whether each character in the intermediate character string is a character located in any one of the named entity and the alias entity; inputting the feature vector of each character in the intermediate character string into an alias entity constraint module to obtain a constraint probability matrix corresponding to the intermediate character string, wherein the constraint probability matrix can be used to determine whether each character in the intermediate character string is a character used to connect the named entity and the alias entity; and determining whether the predicted alias entity is an alias of the predicted named entity based on the probability transition matrix and the constraint probability matrix.

[0005] According to another aspect of the present disclosure, an alias entity recognition device is provided, comprising: a first acquisition unit, configured to input a text to be recognized into a pre-trained language module to obtain a feature vector of each character in the text to be recognized; a second acquisition unit, configured to input the feature vector of each character in the text to be recognized into an entity recognition module to obtain a hidden state transition probability matrix corresponding to the text to be recognized; a first determination unit, configured to determine the predicted alias entity existing in the text to be recognized according to the hidden state transition probability matrix; a second determination unit, configured to determine the predicted named entity that is located before the predicted alias entity and closest to the predicted alias entity in the text to be recognized; an extraction unit, configured to extract the predicted named entity corresponding to the alias entity in the text to be recognized from the hidden state transition probability matrix. A probability transfer matrix of an intermediate character string, wherein the intermediate character string is a character string located between a predicted named entity and a predicted alias entity in the text to be recognized, and the probability transfer matrix can be used to determine whether each character in the intermediate character string is a character located between any one of the named entity and the alias entity; a third acquisition unit, configured to input the feature vector of each character in the intermediate character string into the alias entity constraint module to obtain a constraint probability matrix corresponding to the intermediate character string, wherein the constraint probability matrix can be used to determine whether each character in the intermediate character string is a character used to connect the named entity and the alias entity; and a third determination unit, configured to determine whether the predicted alias entity is an alias of the predicted named entity based on the probability transfer matrix and the constraint probability matrix.

[0006] According to another aspect of the present disclosure, a computer device is provided, comprising: at least one processor; and a memory on which a computer program is stored, wherein when the computer program is executed by the processor, the processor executes the above method.

[0007] According to yet another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the above method.

[0008] According to yet another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the processor is caused to execute the above method.

[0009] According to one or more embodiments of the present disclosure, alias entities in text can be accurately and effectively identified.

[0010] These and other aspects of the disclosure will be apparent from and elucidated with reference to the embodiments described hereinafter. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0012] Figure 1 is a schematic diagram illustrating an example system in which the various methods described herein may be implemented according to an exemplary embodiment;

[0013] Figure 2 is a flow chart illustrating a method for identifying aliased entities according to an exemplary embodiment;

[0014] Figure 3 is a schematic diagram illustrating a processing flow of an entity recognition module according to an exemplary embodiment;

[0015] Figure 4 is a schematic flow chart illustrating a method for alias entity recognition according to another exemplary embodiment;

[0016] Figure 5 is a schematic diagram illustrating the structure of an alias inter-entity constraint module according to an exemplary embodiment;

[0017] Figure 6 is a schematic flow chart illustrating a method for alias entity recognition according to another exemplary embodiment;

[0018] Figure 7 is a schematic block diagram illustrating an alias entity recognition apparatus according to an exemplary embodiment;

[0019] Figure 8 is a block diagram illustrating an exemplary computer device that can be applied to the exemplary embodiments. DETAILED DESCRIPTION

[0020] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0021] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. As used herein, the term "plurality" means two or more, and the term "based on" should be interpreted as "based at least in part on". In addition, the terms "and / or" and "at least one of..." cover any one of the listed items and all possible combinations.

[0022] In a text, in addition to the standard named entity, there are often one or more alias entities for the description of the same object. The alias entity can be the translation of the named entity in other languages, it can be the abbreviation of the named entity, or it can be a commonly accepted alias. In a text, the alias entity of an object usually appears after the named entity of the object. For example, in the text "Charles de Gaulle R91 is a nuclear-powered aircraft carrier belonging to the French Navy", the alias entity "Charles de Gaulle R91" is an alias of the named entity "Charles de Gaulle".

[0023] In the related art, in order to realize the recognition of alias entities, an alias entity dictionary is established to accurately match the alias entities in the text. However, since the same object can have multiple alias entities at the same time, it is necessary to build a sufficiently large dictionary to implement the recognition scheme, which consumes a lot of manpower and material resources to build the dictionary, and the robustness is not strong, and the subsequent maintenance is very troublesome.

[0024] Based on this, the present disclosure proposes an alias entity recognition method, which uses an entity recognition module to identify the predicted alias entity in the text and the predicted named entity before the predicted alias entity and closest to the predicted alias entity, so as to obtain a probability transfer matrix corresponding to the intermediate character string between the two. At the same time, the constraint module between alias entities is used to obtain a constraint probability matrix corresponding to the intermediate character string, and based on the probability transfer matrix and the constraint probability matrix, it is determined whether the predicted alias entity is an alias of the predicted named entity. In this way, it is possible to avoid dependence on the alias entity dictionary in the process of identifying the alias entity, and it is possible to conveniently and effectively identify the alias entities existing in the text, and at the same time, the identified alias entity can be correctly matched with the named entity in the text.

[0025] Exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0026] Figure 1 is a schematic diagram illustrating an example system 100 in which the various methods described herein may be implemented, according to an example embodiment.

[0027] refer to Figure 1 The system 100 includes a client device 110 , a server 120 , and a network 130 that communicatively couples the client device 110 and the server 120 .

[0028] The client device 110 includes a display 114 and a client application (APP) 112 that can be displayed via the display 114. The client application 112 can be an application that needs to be downloaded and installed before running or a small program (liteapp) as a lightweight application. In the case where the client application 112 is an application that needs to be downloaded and installed before running, the client application 112 can be pre-installed on the client device 110 and activated. In the case where the client application 112 is a small program, the user 102 can directly run the client application 112 on the client device 110 by searching for the client application 112 in the host application (for example, by the name of the client application 112, etc.) or scanning the graphic code of the client application 112 (for example, a bar code, a QR code, etc.), without installing the client application 112. In some embodiments, the client device 110 can be any type of mobile computer device, including a mobile computer, a mobile phone, a wearable computer device (for example, a smart watch, a head-mounted device, including smart glasses, etc.) or other types of mobile devices. In some embodiments, client device 110 may alternatively be a stationary computer device, such as a desktop computer, a server computer, or other type of stationary computer device.

[0029] The server 120 is typically a server deployed by an Internet Service Provider (ISP) or an Internet Content Provider (ICP). The server 120 may represent a single server, a cluster of multiple servers, a distributed system, or a cloud server that provides basic cloud services (such as cloud databases, cloud computing, cloud storage, and cloud communications). It will be understood that although Figure 1 The server 120 is shown in FIG. 1 in communicating with only one client device 110 , but the server 120 may provide background services for multiple client devices simultaneously.

[0030] Examples of network 130 include a local area network (LAN), a wide area network (WAN), a personal area network (PAN), and / or a combination of communication networks such as the Internet. Network 130 can be a wired or wireless network. In some embodiments, the data exchanged through network 130 is processed using technologies and / or formats including hypertext markup language (HTML), extensible markup language (XML), etc. In addition, encryption technologies such as secure socket layer (SSL), transport layer security (TLS), virtual private network (VPN), Internet protocol security (IPsec) can also be used to encrypt all or some links. In some embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above-mentioned data communication technologies.

[0031] For the purpose of the embodiments of this disclosure, Figure 1In the example of , the client application 112 may be a text application that can provide various text-based functions, such as reading, editing, searching, etc. Correspondingly, the server 120 may be a server used together with the text application. The server 120 may provide online text services to the client application 112 running in the client device 110. Alternatively, the client application 112 running in the client device 110 may also provide local text services. As a non-limiting example, the method described below may be performed by Figure 1 The system 100 is executed.

[0032] The text is processed and the processing result is fed back to the client device 110 .

[0033] Figure 2 2 is a flowchart illustrating an alias entity recognition method 200 according to an exemplary embodiment. The method 200 may be performed on a client device (e.g., Figure 1 The execution of each step of the method 200 may be performed at the client device 110 shown in FIG. Figure 1 In some embodiments, the method 200 may be performed on a server (e.g., Figure 1 In some embodiments, method 200 may be performed by a client device (eg, client device 110) and a server (eg, server 120) in combination.

[0034] refer to Figure 2The alias entity recognition method 200 includes: step S201, inputting the text to be recognized into a pre-trained language module to obtain a feature vector of each character in the text to be recognized; step S202, inputting the feature vector of each character in the text to be recognized into an entity recognition module to obtain a hidden state transition probability matrix corresponding to the text to be recognized; step S203, determining the predicted alias entity existing in the text to be recognized according to the hidden state transition probability matrix; step S204, determining the predicted named entity in the text to be recognized that is located before the predicted alias entity and closest to the predicted alias entity; step S205, extracting the probability transfer matrix corresponding to the intermediate character string from the hidden state transition probability matrix, In the step S206, the intermediate character string is a character string between the predicted named entity and the predicted alias entity in the text to be recognized, and the probability transfer matrix can be used to determine whether each character in the intermediate character string is a character located in any one of the named entity and the alias entity; step S206, inputting the feature vector of each character in the intermediate character string into the alias entity constraint module to obtain a constraint probability matrix corresponding to the intermediate character string, wherein the constraint probability matrix can be used to determine whether each character in the intermediate character string is a character used to connect the named entity and the alias entity; and step S207, based on the probability transfer matrix and the constraint probability matrix, determining whether the predicted alias entity is an alias of the predicted named entity. In this way, the dependence on the alias entity dictionary in the process of recognizing the alias entity can be avoided, and the alias entity existing in the text can be conveniently and effectively recognized, and the recognized alias entity can also be correctly matched with the named entity in the text.

[0035] In step 201, the pre-trained language module may be an underlying character / word embedding module constructed based on a masked language model, and is used to vectorize each character in the text to be recognized.

[0036] In one embodiment, the pre-trained language module can be constructed based on the Bert model, wherein the Bert model has 12 Transformer layers. The pre-trained parameters of the Transformer layer in a general field can make the semantic representation of the text to be recognized more effective during the character vectorization process.

[0037] In another embodiment, the pre-trained language module may also use a word2vec model or a BiLSTM model to implement vectorization for each character in the text to be recognized.

[0038] According to some embodiments, the entity recognition module may include a bidirectional cyclic long short-term memory submodule and a conditional random field submodule. And wherein, in step 202, inputting the feature vector of each character in the text to be recognized into the entity recognition module to obtain the hidden state transition probability matrix corresponding to the text to be recognized may include: inputting the feature vector of each character in the text to be recognized into the bidirectional cyclic long short-term memory submodule to obtain the observed state probability matrix corresponding to the text to be recognized; and inputting the observed state probability matrix into the conditional random field submodule to obtain the hidden state transition probability matrix corresponding to the text to be recognized.

[0039] Therefore, the feature vector of each character in the input text to be recognized can be bidirectionally cyclically parsed through the bidirectional cyclic long short-term memory sub-module, and the parsed data can be further sequence analyzed through the conditional random field sub-module, so that the obtained hidden state transition probability matrix can effectively represent the semantic features of the text to be recognized.

[0040] Figure 3 FIG. 4 is a schematic diagram of a processing flow of an exemplary entity recognition module. Figure 3 As shown, the feature vectors corresponding to the characters W0, W1, W2, W3, and W4 in the text to be recognized are respectively input into the bidirectional cyclic long short-term memory submodule 301 in the entity recognition module, and the observed state probability matrix corresponding to the text to be recognized can be obtained. The observed state probability matrix is ​​input into the conditional random field submodule 302, and the hidden state transition probability matrix output by the conditional random field submodule 302 can be obtained.

[0041] Return to reference Figure 2 According to some embodiments, in step 203, determining whether there is a predicted alias entity in the text to be recognized may include: determining a predicted label for each character in the text to be recognized based on a hidden state transition probability matrix, wherein the predicted label for each character can be used to indicate the positional relationship between the character and the alias entity; and determining whether there is a predicted alias entity in the text to be recognized in response to determining that the following conditions are met: there are multiple consecutive characters in the text to be recognized; the predicted label of the first character in the multiple consecutive characters indicates that the character is located at the beginning of the alias entity; the predicted label of the last character in the multiple consecutive characters indicates that the character is located at the end of the alias entity; and the predicted label of each of the other characters in the multiple consecutive characters except the first character and the last character indicates that the character is located in the middle of the alias entity, wherein the predicted alias entity is the multiple consecutive characters. Thus, by predicting the predicted label of each character, the alias entity in the text to be recognized can be conveniently and effectively identified.

[0042] After the predicted alias entity in the text to be recognized is identified in step 203 , a predicted named entity located before and closest to the predicted alias entity in the text to be recognized may be further determined in step 204 based on the identified predicted alias entity.

[0043] According to some embodiments, the predicted label of each character can also be used to indicate the positional relationship between the character and the named entity, and the predicted named entity is a continuous character that is different from a plurality of continuous characters in the text to be recognized. The predicted label of the first character in the continuous characters indicates that the character is located at the beginning of the named entity, the predicted label of the last character in the continuous characters indicates that the character is located at the end of the named entity, and the predicted label of each character in the continuous characters except the first character and the last character indicates that the character is located in the middle of the named entity. Thus, by predicting the predicted label of each character, the named entities in the text to be recognized can be conveniently and effectively identified.

[0044] In one implementation, the predicted label of each character is a BIOE label, and the BIOE label can be used to indicate the positional relationship between the character and the alias entity and the named entity.

[0045] For example, the predicted label "B1" indicates that the character is at the beginning of the named entity, the predicted label "I1" indicates that the character is in the middle of the named entity, the predicted label "E1" indicates that the character is at the end of the named entity, the predicted label "B2" indicates that the character is at the beginning of the alias entity, the predicted label "I2" indicates that the character is in the middle of the alias entity, the predicted label "E2" indicates that the character is at the end of the alias entity, and the predicted label "O" indicates that the character is neither in the named entity nor in the alias entity.

[0046] If there are multiple consecutive characters in the text to be recognized, and the predicted labels corresponding to the multiple consecutive characters are "B1 I1 I1 I1 I1 E1", it means that the multiple consecutive characters are a named entity consisting of 6 characters. If there are multiple consecutive characters in the text to be recognized, and the predicted labels corresponding to the multiple consecutive characters are "B2 I2 I2 E2", it means that the multiple consecutive characters are an alias entity consisting of 4 characters.

[0047] According to some embodiments, in order to obtain the predicted label corresponding to each character in the text to be recognized by the entity recognition module, the entity recognition module can be pre-trained using the corpus information marked with labels. In particular, the above-mentioned BIOE label can be used to annotate the characters in the training sample.

[0048] Based on the above steps S201-S204, using the pre-trained language module and the entity recognition module, the predicted label of each character in the text to be recognized can be predicted, and the named entities and alias entities in the text to be recognized can be recognized accordingly. Figure 4 A flowchart of an exemplary method for alias entity recognition based on the above steps S201-S204 is shown.

[0049] like Figure 4 As shown, first, obtain the string corresponding to the text to be recognized, that is, Figure 4 [CLS], Tok1, Tok2, ..., TokN in the string. Each character in the string is preprocessed to obtain the initial representation of the string corresponding to the text to be recognized, that is, Figure 4 E [CLS] , E1, E2, ..., E N Then, the initial representation of the string is input into the pre-trained language module Bert 401 to obtain the feature vector of each character in the text to be recognized output by the pre-trained language module Bert 401, that is, Figure 4 C, T1, T2, ..., T shown in N Next, the feature vector of each character in the text to be recognized is input into the entity recognition module 402. Using the bidirectional cyclic long short-term memory submodule in the entity recognition module 402, that is, Figure 4 The Bi-LSTM in the LSTM can obtain the observed state probability transfer matrix corresponding to the text to be recognized, that is, Figure 4 P e , P1, P2, ..., P N The conditional random field submodule in the entity recognition module 402, namely Figure 4 By further processing the observed state probability transfer matrix, the hidden state transfer probability matrix corresponding to the text to be recognized can be obtained. Finally, by parsing the hidden state transfer probability matrix, the predicted label of each character in the text to be recognized can be obtained.

[0050] Return to reference Figure 2 After the predicted alias entity and the predicted named entity are determined according to the hidden state transition probability matrix, step 205 is performed to extract the probability transition matrix corresponding to the intermediate string from the hidden state transition probability matrix. The probability transition matrix is ​​a submatrix of the hidden state transition probability matrix. The predicted label of each character in the intermediate string can be obtained by parsing the probability transition matrix.

[0051] In the example, when the BIOE tag is used, in response to the predicted tag of each character in the middle string being "O", it can be determined that the characters between the predicted named entity and the predicted alias entity are neither in the named entity nor in the alias entity.

[0052] Based on the predicted named entities and predicted alias entities identified in the text to be processed, the location information of the intermediate character string between the predicted named entities and the predicted alias entities in the text to be processed can be determined. Based on the location information, the feature vector of each character in the intermediate character string can be extracted from the output of the pre-trained language module.

[0053] In step 206, the feature vector of each character in the intermediate string is input into the alias entity constraint module to obtain a constraint probability matrix corresponding to the intermediate string, wherein the constraint probability matrix can be used to determine whether each character in the intermediate string is a character used to connect the named entity and the alias entity.

[0054] Among them, the characters used to connect the named entity and the alias entity, for example, can be "(", ":", "alias", "name", etc., which potentially indicate that there is a named entity before the character and an alias entity after the character. For example, in "BM-30 rocket launcher (tornado)", "(" is the character used to connect the named entity "BM-30 rocket launcher" and the alias entity "tornado", that is, it can exist as a character between the named entity "BM-30 rocket launcher" and the alias entity "tornado".

[0055] Figure 5 FIG. 4 shows an exemplary structural diagram of an alias entity constraint module. Figure 5 As shown, the alias entity constraint module includes an input layer, a hidden layer, and an output layer connected in sequence. After the feature vector of each character in the intermediate string is input into the input layer of the alias entity constraint module, the constraint probability matrix corresponding to the intermediate string can be output through the coordinated operation between the input layer, the hidden layer, and the output layer in the alias entity constraint module.

[0056] Among them, the hidden layer in the alias entity constraint module can adjust the weight of the vector according to the semantics of the character to achieve the effect of being able to identify the characters used to connect the named entity and the alias entity. The output layer can be a fully connected layer, which is used to output the probability that the character is a character used to connect the named entity and the alias entity.

[0057] In one embodiment, the constraint probability matrix may be an N×1 matrix, where N represents the number of characters in the intermediate string, and each element thereof corresponds in turn to each character in the intermediate string, and is used to indicate whether the character is a character used to connect the named entity and the alias entity.

[0058] Return to reference Figure 2 In step 207, after the probability transfer matrix and the constraint probability matrix are determined, it can be determined whether the predicted alias entity is an alias of the predicted named entity.

[0059] According to some embodiments, based on the probability transfer matrix and the constraint probability matrix, determining whether the predicted alias entity is an alias of the predicted named entity may include: for each character in the intermediate string: in response to the predicted label of the character indicating that the character is not a character located in any one of the named entity and the alias entity, determining the character as the first target character; in response to determining that the character is a character used to connect the named entity and the alias entity according to the constraint probability matrix, determining the character as the second target character; in response to the character being both the first target character and the second target character, determining the character as a spacing character in the intermediate string; and based on the proportion of spacing characters in the intermediate string, determining whether the predicted alias entity is an alias of the predicted named entity. Thus, the probability that the predicted alias entity is an alias of the predicted named entity can be quantified by the proportion of spacing characters in the intermediate string, thereby facilitating the automatic determination of whether the predicted alias entity is an alias of the predicted named entity.

[0060] In one embodiment, the probability transfer matrix is ​​first reduced in dimension to obtain the label index corresponding to each character. In the example, if the predicted label of a character is "O", that is, the predicted label of the character indicates that the character is not a character located in any of the named entities and alias entities, then the label index of the character is set to 1, that is, the character is determined to be the first target character, otherwise it is set to 0, that is, the character is not the first target character. In this way, an N×1 probability transfer matrix can be obtained, in which each element is the label index of each character in the intermediate string in turn.

[0061] At the same time, in the N×1 constraint probability matrix, an element that is 1 indicates that the character corresponding to the element is predicted as a character used to connect the named entity and the alias entity, that is, the character is determined to be the second target character; an element that is 0 indicates that the character corresponding to the element is not predicted as a character used to connect the named entity and the alias entity, that is, the character is not the second target character.

[0062] The probability transfer matrix and the constraint probability matrix are ANDed to obtain an N×1 result matrix. Each element in the result matrix corresponds to each character in the middle string in turn, and for each character in the middle string, if the corresponding element of the character in the result matrix is ​​1, it indicates that the character is a spacing character, otherwise, it indicates that the character is not a spacing character.

[0063] According to some embodiments, determining whether a predicted alias entity is an alias of a predicted named entity based on a proportion of spacing characters in an intermediate character string may include: determining that the predicted alias entity is an alias of the predicted named entity in response to a proportion of spacing characters in the intermediate character string being greater than a preset threshold.

[0064] Although the various operations are depicted in the drawings as being in a particular order, this should not be understood as requiring that these operations must be performed in the particular order shown or in a sequential order, nor should it be understood as requiring that all the operations shown must be performed to obtain the desired results. For example, step 206 may be performed before step 205, or concurrently with step 205.

[0065] Figure 6 The figure shows a flow chart of a method for alias entity recognition based on a pre-trained language module, an entity recognition module, an alias entity constraint module and a probability calculation module. Figure 6 As shown, first, a feature vector of each character in the text to be recognized is obtained through a pre-trained language module.

[0066] The feature vector of each character output by the pre-trained language module is used as the input of the entity recognition module to identify the predicted named entities and predicted alias entities in the text to be recognized. At the same time, based on the identified predicted named entities and predicted alias entities, the intermediate character strings between the predicted named entities and predicted alias entities in the text to be recognized are located, and the probability transfer matrix corresponding to the intermediate character strings is output.

[0067] The positioning information of the intermediate character string determined by the pre-trained language module is sent to the alias entity constraint module, so that the alias entity constraint module can extract the feature vector corresponding to each character in the intermediate character string from the feature vector of each character output by the pre-trained language module based on the positioning information, and output the constraint probability matrix corresponding to the intermediate character string by processing the feature vector corresponding to each character in the intermediate character string.

[0068] The probability transfer matrix output by the entity recognition module and the constraint probability matrix output by the alias entity constraint module are input into the probability calculation module, so that the probability calculation module can output indication information indicating whether the predicted alias entity is an alias of the predicted named entity based on both the probability transfer matrix and the constraint probability matrix.

[0069] Figure 7 FIG. 7 is a schematic block diagram illustrating an alias entity recognition apparatus 700 according to an exemplary embodiment. Figure 7As shown, the device 700 includes: a first acquisition unit 701, configured to input the text to be recognized into a pre-trained language module to obtain a feature vector of each character in the text to be recognized; a second acquisition unit 701, configured to input the feature vector of each character in the text to be recognized into an entity recognition module to obtain a hidden state transition probability matrix corresponding to the text to be recognized; a first determination unit 702, configured to determine the predicted alias entity existing in the text to be recognized according to the hidden state transition probability matrix; a second determination unit 704, configured to determine the predicted named entity in the text to be recognized that is located before the predicted alias entity and closest to the predicted alias entity; an extraction unit 705, configured to extract the corresponding intermediate character string from the hidden state transition probability matrix A probability transfer matrix, wherein the intermediate character string is a character string located between the predicted named entity and the predicted alias entity in the text to be recognized, and the probability transfer matrix can be used to determine whether each character in the intermediate character string is a character located between any one of the named entity and the alias entity; a third acquisition unit 706 is configured to input the feature vector of each character in the intermediate character string into the alias entity constraint module to obtain a constraint probability matrix corresponding to the intermediate character string, wherein the constraint probability matrix can be used to determine whether each character in the intermediate character string is a character used to connect the named entity and the alias entity; and a third determination unit 707 is configured to determine whether the predicted alias entity is an alias of the predicted named entity based on the probability transfer matrix and the constraint probability matrix.

[0070] It should be understood that Figure 7 The various modules of the apparatus 700 shown in FIG. Figure 2 The steps in the method 200 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 200 are also applicable to the apparatus 700 and the modules included therein. For the sake of brevity, some operations, features and advantages are not described in detail here.

[0071] Although specific functions are discussed above with reference to specific modules, it should be noted that the functions of the various modules discussed herein can be divided into multiple modules, and / or at least some functions of multiple modules can be combined into a single module. The specific module discussed herein performs an action including the specific module itself performing the action, or alternatively the specific module calls or otherwise accesses another component or module that performs the action (or performs the action together with the specific module). Therefore, the specific module that performs an action can include the specific module itself that performs the action and / or the specific module calls or otherwise accesses another module that performs the action. For example, the second acquisition unit 702, the first determination unit 703, the second determination unit 704, and the extraction unit 705 described above can be combined into a single module in some embodiments.

[0072] It should also be understood that various techniques may be described herein in the general context of software hardware elements or program modules. Figure 7 The modules described may be implemented in hardware or in hardware in combination with software and / or firmware. For example, these modules may be implemented as computer program codes / instructions configured to be executed in one or more processors and stored in a computer-readable storage medium. Alternatively, these modules may be implemented as hardware logic / circuits. For example, in some embodiments, one or more of the first acquisition unit 701, the second acquisition unit 702, the first determination unit 703, the second determination unit 704, the extraction unit 705, the third acquisition unit 706, and the third determination unit 707 may be implemented together in a system on chip (SoC). SoC may include an integrated circuit chip (which includes a processor (e.g., a central processing unit (CPU), a microcontroller, a microprocessor, a digital signal processor (DSP), etc.), a memory, one or more communication interfaces, and / or one or more components in other circuits), and may optionally execute the received program code and / or include embedded firmware to perform functions.

[0073] According to one aspect of the present disclosure, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory. The processor is configured to execute the computer program to implement the steps of any method embodiment described above.

[0074] According to one aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any method embodiment described above are implemented.

[0075] According to one aspect of the present disclosure, a computer program product is provided, which includes a computer program. When the computer program is executed by a processor, the steps of any method embodiment described above are implemented.

[0076] In the following, combined Figure 8 Illustrative examples of such a computer device, non-transitory computer-readable storage medium, and computer program product are described.

[0077] Figure 8 An example configuration of a computer device 800 that can be used to implement the methods described herein is shown. For example, Figure 1The server 120 and / or the client device 110 shown in FIG. 8 may include an architecture similar to the computer device 800. The above-mentioned alias entity recognition apparatus may also be implemented in whole or at least in part by the computer device 800 or a similar device or system.

[0078] Computer device 800 can be a variety of different types of devices. Examples of computer device 800 include, but are not limited to, desktop computers, server computers, laptop or netbook computers, mobile devices (e.g., tablet computers, cellular or other wireless phones (e.g., smart phones), notepad computers, mobile stations), wearable devices (e.g., glasses, watches), entertainment devices (e.g., entertainment appliances, set-top boxes communicatively coupled to display devices, game consoles), televisions or other display devices, automotive computers, and the like.

[0079] The computer device 800 may include at least one processor 802, memory 804, communication interface(s) 806, a display device 808, other input / output (I / O) devices 810, and one or more mass storage devices 812 that can communicate with each other, such as via a system bus 814 or other appropriate connection.

[0080] The processor 802 may be a single processing unit or multiple processing units, all of which may include a single or multiple computing units or multiple cores. The processor 802 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuits, and / or any device that manipulates signals based on operating instructions. Among other capabilities, the processor 802 may be configured to obtain and execute computer-readable instructions stored in the memory 804, mass storage device 812, or other computer-readable media, such as program codes of an operating system 816, program codes of an application program 818, program codes of other programs 820, and the like.

[0081] The memory 804 and the mass storage device 812 are examples of computer-readable storage media for storing instructions, which are executed by the processor 802 to implement the various functions described above. For example, the memory 804 can generally include both volatile memory and non-volatile memory (e.g., RAM, ROM, etc.). In addition, the mass storage device 812 can generally include a hard disk drive, a solid-state drive, a removable medium, including external and removable drives, memory cards, flash memory, a floppy disk, an optical disk (e.g., CD, DVD), a storage array, a network attached storage, a storage area network, etc. The memory 804 and the mass storage device 812 can all be collectively referred to as memory or computer-readable storage media in this article, and can be a non-transitory medium capable of storing computer-readable, processor-executable program instructions as computer program code, which can be executed by the processor 802 as a specific machine configured to implement the operations and functions described in the examples of this article. Multiple programs can be stored on the mass storage device 812. These programs include an operating system 816 , one or more application programs 818 , other programs 820 , and program data 822 , and they may be loaded into memory 804 for execution.

[0082] Although in Figure 8 800, but modules 816, 818, 820, and 822, or portions thereof, may be implemented using any form of computer-readable media accessible by the computer device 800. As used herein, "computer-readable media" includes at least two types of computer-readable media, namely, computer-readable storage media and communication media.

[0083] Computer-readable storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information, such as computer-readable instructions, data structures, program modules or other data. Computer-readable storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD), or other optical storage device, magnetic cassette, magnetic tape, magnetic disk storage device or other magnetic storage device, or any other non-transmission medium that can be used to store information for access by a computer device. In contrast, communication media can embody computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism. Computer-readable storage media as defined herein do not include communication media.

[0084] One or more communication interfaces 806 are used to exchange data with other devices, such as through a network, a direct connection, etc. Such communication interfaces can be one or more of the following: any type of network interface (e.g., a network interface card (NIC)), a wired or wireless (such as IEEE 802.11 wireless LAN (WLAN)) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a cellular network ... TM The communication interface 806 may facilitate communication within a variety of network and protocol types, including wired networks (e.g., LAN, cable, etc.) and wireless networks (e.g., WLAN, cellular, satellite, etc.), the Internet, etc. The communication interface 806 may also provide for communication with external storage devices (not shown) such as in a storage array, network attached storage, a storage area network, etc.

[0085] In some examples, a display device 808 such as a monitor may be included for displaying information and images to the user. Other I / O devices 810 may be devices that receive various inputs from the user and provide various outputs to the user, and may include touch input devices, gesture input devices, cameras, keyboards, remote controls, mice, printers, audio input / output devices, and the like.

[0086] The technology described herein can be supported by these various configurations of the computer device 800, and is not limited to the specific examples of the technology described herein. For example, the functionality can also be implemented in whole or in part on the "cloud" by using a distributed system. The cloud includes and / or represents a platform for resources. The platform abstracts the underlying functions of the hardware (e.g., server) and software resources of the cloud. Resources can include applications and / or data that can be used when performing computing processing on a server away from the computer device 800. Resources can also include services provided over the Internet and / or through a subscriber network such as a cellular or Wi-Fi network. The platform can abstract resources and functions to connect the computer device 800 to other computer devices. Therefore, the implementation of the functions described herein can be distributed throughout the cloud. For example, the functions can be implemented partially on the computer device 800 and partially through a platform that abstracts the functions of the cloud.

[0087] Although the present disclosure has been illustrated and described in detail in the drawings and the foregoing description, such illustration and description should be considered illustrative and schematic, not restrictive; the present disclosure is not limited to the disclosed embodiments. By studying the drawings, the disclosure and the appended claims, those skilled in the art will be able to understand and implement variations to the disclosed embodiments when practicing the claimed subject matter. In the claims, the word "comprising" does not exclude other elements or steps that are not listed, the indefinite article "a" or "an" does not exclude a plurality, the term "plurality" means two or more, and the term "based on" should be interpreted as "based at least in part on". The mere fact that certain measures are recorded in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.

Claims

1. A method for identifying an alias entity, comprising: Inputting the text to be recognized into the pre-trained language module to obtain a feature vector of each character in the text to be recognized; Inputting the feature vector of each character in the text to be recognized into the entity recognition module to obtain the hidden state transition probability matrix corresponding to the text to be recognized; Determining the predicted alias entity existing in the to-be-recognized text according to the hidden state transition probability matrix includes: Determining a predicted label of each character in the to-be-recognized text based on the hidden state transition probability matrix, wherein the predicted label of each character can be used to indicate a positional relationship between the character and the alias entity; and In response to determining that the following conditions are met, it is determined that there is a predicted alias entity in the to-be-recognized text: There are multiple consecutive characters in the text to be recognized; The predicted label of the first character of the plurality of consecutive characters indicates that the character is at the beginning of the alias entity; The predicted label of the last character in the plurality of consecutive characters indicates that the character is at the end of the alias entity; and The predicted label of each of the other characters of the plurality of consecutive characters except both the first character and the last character indicates that the character is located in the middle of an alias entity, Wherein, the predicted alias entity is the plurality of consecutive characters; Determine a predicted named entity in the text to be recognized that is located before the predicted alias entity and closest to the predicted alias entity, wherein the predicted label of each character can also be used to indicate the positional relationship between the character and the named entity, the predicted named entity is a continuous character in the text to be recognized that is different from the multiple continuous characters, the predicted label of the first character in the continuous characters indicates that the character is located at the beginning of the named entity, the predicted label of the last character in the continuous characters indicates that the character is located at the end of the named entity, and the predicted label of each character in the continuous characters except the first character and the last character indicates that the character is located in the middle of the named entity; Extracting a probability transfer matrix corresponding to an intermediate character string from the hidden state transfer probability matrix, wherein the intermediate character string is a character string located between the predicted named entity and the predicted alias entity in the text to be recognized, and the probability transfer matrix can be used to determine whether each character in the intermediate character string is a character located in any one of the named entity and the alias entity; Inputting the feature vector of each character in the intermediate string into an alias entity constraint module to obtain a constraint probability matrix corresponding to the intermediate string, wherein the constraint probability matrix can be used to determine whether each character in the intermediate string is a character used to connect a named entity and an alias entity; and Determining whether the predicted alias entity is an alias of the predicted named entity based on the probability transfer matrix and the constraint probability matrix includes: For each character in the middle string: In response to the predicted label of the character indicating that the character is not a character located in any of the named entity and the alias entity, determining the character as a first target character; In response to determining that the character is a character used to connect the named entity and the alias entity according to the constraint probability matrix, determining the character as a second target character; In response to the character being both the first target character and the second target character, determining the character as a space character in the middle character string; and Based on the proportion of the spacing characters in the middle character string, it is determined whether the predicted alias entity is an alias of the predicted named entity.

2. The method according to claim 1, wherein: The determining, based on the proportion of the spacing characters in the intermediate character string, whether the predicted alias entity is an alias of the predicted named entity comprises: In response to the proportion of the spacing characters in the middle character string being greater than a preset threshold, determining that the predicted alias entity is an alias of the predicted named entity.

3. The method according to any one of claims 1 to 2, wherein: The entity recognition module includes a bidirectional cyclic long short-term memory submodule and a conditional random field submodule, and wherein the step of inputting the feature vector of each character in the to-be-recognized text into the entity recognition module to obtain a hidden state transition probability matrix corresponding to the to-be-recognized text includes: Inputting the feature vector of each character in the text to be recognized into the bidirectional cyclic long short-term memory submodule to obtain an observation state probability matrix corresponding to the text to be recognized; and The observed state probability matrix is ​​input into the conditional random field submodule to obtain the hidden state transition probability matrix corresponding to the text to be recognized.

4. An alias entity recognition device, comprising: A first acquisition unit is configured to input the text to be recognized into the pre-trained language module to obtain a feature vector of each character in the text to be recognized; A second acquisition unit is configured to input the feature vector of each character in the text to be recognized into an entity recognition module to obtain a hidden state transition probability matrix corresponding to the text to be recognized; A first determination unit is configured to determine the predicted alias entity existing in the text to be recognized according to the hidden state transition probability matrix, including: determining the predicted label of each character in the text to be recognized based on the hidden state transition probability matrix, wherein the predicted label of each character can be used to indicate the positional relationship between the character and the alias entity; and determining that the predicted alias entity exists in the text to be recognized in response to determining that the following conditions are met: there are multiple consecutive characters in the text to be recognized; the predicted label of the first character of the multiple consecutive characters indicates that the character is located at the beginning of the alias entity; the predicted label of the last character of the multiple consecutive characters indicates that the character is located at the end of the alias entity; and the predicted label of each of the other characters in the multiple consecutive characters except the first character and the last character indicates that the character is located in the middle of the alias entity, wherein the predicted alias entity is the multiple consecutive characters; a second determining unit configured to determine a predicted named entity in the to-be-recognized text that is located before the predicted alias entity and closest to the predicted alias entity, wherein the predicted label of each character can also be used to indicate a positional relationship between the character and the named entity, the predicted named entity is a continuous character in the to-be-recognized text that is different from the multiple continuous characters, the predicted label of the first character in the continuous characters indicates that the character is located at the beginning of the named entity, the predicted label of the last character in the continuous characters indicates that the character is located at the end of the named entity, and the predicted label of each character in the continuous characters except the first character and the last character indicates that the character is located in the middle of the named entity; an extracting unit configured to extract a probability transfer matrix corresponding to an intermediate character string from the hidden state transfer probability matrix, wherein the intermediate character string is a character string located between the predicted named entity and the predicted alias entity in the text to be recognized, and the probability transfer matrix can be used to determine whether each character in the intermediate character string is a character located in any one of the named entity and the alias entity; a third acquisition unit configured to input the feature vector of each character in the intermediate string into an alias entity constraint module to obtain a constraint probability matrix corresponding to the intermediate string, wherein the constraint probability matrix can be used to determine whether each character in the intermediate string is a character used to connect a named entity and an alias entity; and A third determination unit is configured to determine whether the predicted alias entity is an alias of the predicted named entity based on the probability transfer matrix and the constraint probability matrix, including: for each character in the intermediate character string: in response to the predicted label of the character indicating that the character is not a character located in any one of the named entity and the alias entity, determining the character as a first target character; in response to determining that the character is a character used to connect the named entity and the alias entity according to the constraint probability matrix, determining the character as a second target character; in response to the character being both the first target character and the second target character, determining the character as a spacing character in the intermediate character string; and determining whether the predicted alias entity is an alias of the predicted named entity based on the proportion of the spacing characters in the intermediate character string.

5. A computer device comprising: at least one processor; as well as a memory having a computer program stored thereon, When the computer program is executed by the processor, the processor is caused to perform the method according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 3.

7. A computer program product, comprising a computer program, which, when executed by a processor, causes the processor to perform the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Man-machine multi-round dialogue method oriented to travel field

    CN109063035A

  • Named entity recognition method and device thereof, named entity training method and device thereof, equipment and medium

    CN113515941A