A method and device for determining entity chaining results

By extracting features from the target text and the context text of the candidate entity and inputting them into the perceptron, the problem of inaccurate entity linking results is solved, the accuracy of the entity linking is improved, and the accuracy and reliability of the entity linking results are ensured.

CN112732917BActive Publication Date: 2024-08-30SHANGHAI MININGLAMP ARTIFICIAL INTELLIGENCE GRP CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202110043192.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-13
Publication Date
2024-08-30
Estimated Expiration
2041-01-13

AI Technical Summary

Technical Problem

Existing entity chaining methods fail to fully consider the context of entities, resulting in inaccurate results.

Method used

By extracting multiple candidate features from the target text and the context text of the candidate entity, input the perceptron to obtain the feature value of each candidate entity, and determine the entity chain index result according to the maximum feature value, considering the type, matching, loss and Co-occurrence features, combined with language representation model and classification recognition model, improve the accuracy of entity linking.

Benefits of technology

The accuracy of the entity linking results is improved. By considering the context of the entity, the entity meaning is expressed more accurately and the reliability of the linking results is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112732917B
    Figure CN112732917B
Patent Text Reader

Abstract

The present application provides a method and device for determining entity chaining results, which belongs to the field of entity chaining technology. The method includes: determining a target entity in a target text, and obtaining a candidate entity corresponding to the target entity from a knowledge base; obtaining a plurality of candidate features according to the target text and the candidate text where the candidate entity is located, wherein the candidate text is the context text where the candidate entity is located; inputting the plurality of candidate features into a perceptron to obtain a feature value of each candidate entity output by the perceptron; when the maximum feature value among the plurality of feature values ​​is not less than a preset threshold, taking the candidate entity corresponding to the maximum feature value as the entity chaining result of the target entity. The present application improves the accuracy of the chaining results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of entity linking technology, and in particular to a method and device for determining entity linking results. Background Art

[0002] In recent years, with the development of deep learning technology and the rapid improvement of data and computing power, the field of natural language processing has ushered in a booming development. As an important technology in the field of NLP, knowledge graphs have also become the focus of attention in industry and academia. In the process of building knowledge graphs, as the data becomes larger and larger, the scale of the graph continues to expand. At present, the largest Chinese knowledge graph already has hundreds of millions of entities and hundreds of billions of facts, with rich knowledge annotation and association capabilities. The problem of entity linking in graph construction has also become the key to the quality of commission graphs. Entity linking, referred to as EL (Entity Linking), is to associate the entities in a given Chinese short text (such as search queries, Weibo, conversation content, article / video / picture titles, etc.) with the corresponding entities in a given knowledge base.

[0003] The current entity chaining only focuses on the entity itself in the Chinese short text, and does not take into account the context in which the entity is located, that is, the context in which the entity is located, which will lead to inaccurate results of entity chaining. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method and device for determining entity linking results to solve the problem of inaccurate entity linking results. The specific technical solution is as follows:

[0005] In a first aspect, a method for determining an entity link result is provided, the method comprising:

[0006] Determine a target entity in a target text, and obtain candidate entities corresponding to the target entity from a knowledge base;

[0007] According to the target text and the candidate text where the candidate entity is located, a plurality of candidate features are obtained, wherein the candidate text is the context text where the candidate entity is located;

[0008] Inputting the plurality of candidate features into a perceptron to obtain a feature value of each candidate entity output by the perceptron;

[0009] When the maximum eigenvalue among the plurality of eigenvalues ​​is not less than a preset threshold, the candidate entity corresponding to the maximum eigenvalue is used as the entity linking result of the target entity.

[0010] Optionally, the candidate features include type features, and the multiple candidate features obtained according to the target text include:

[0011] Input the target text into a language representation model, and obtain a start vector corresponding to a start position of the target entity in the target text, an end vector corresponding to an end position, and a first meaning vector corresponding to a meaning of the target entity in the target text output by the language representation model;

[0012] Performing vector connection on the starting vector, the ending vector and the first meaning vector to obtain a first vector;

[0013] The first vector is input into a classification recognition model to obtain a type feature corresponding to the target entity.

[0014] Optionally, the candidate features include matching features, and the plurality of candidate features obtained according to the target text and the candidate text where the candidate entity is located include:

[0015] Inputting the target text and the candidate text into a language representation model, obtaining a start vector corresponding to a start position of the target entity in the target text, an end vector corresponding to an end position, and a second meaning vector corresponding to a meaning of the target entity in the target text output by the language representation model;

[0016] Performing vector connection on the starting vector, the ending vector and the second meaning vector to obtain a second vector;

[0017] The second vector is input into a matching model to obtain matching features between the target entity and the candidate entity.

[0018] Optionally, the candidate feature includes loss, and the plurality of candidate features obtained according to the target text and the candidate text where the candidate entity is located include:

[0019] Inputting the target text and the candidate text into a language representation model respectively, and obtaining a target text vector corresponding to the target text and a candidate text vector corresponding to the candidate text output by the language representation model;

[0020] Selecting a target vector corresponding to the target entity from the target text vector, and selecting a candidate vector corresponding to the candidate entity from the candidate text vector;

[0021] Determining a cosine distance loss value between the target vector and the candidate vector;

[0022] The cosine distance loss value is used as a loss feature.

[0023] Optionally, the candidate features include co-occurrence features, and the multiple candidate features obtained according to the target text and the candidate text where the candidate entity is located include:

[0024] Determine a first entity other than the target entity in the target text and a second entity other than the candidate entity in the candidate text;

[0025] If the first entity and the second entity have an intersection, determining that the co-occurrence feature is a value of 1;

[0026] If there is no intersection between the first entity and the second entity, it is determined that the co-occurrence feature value is a value of 0.

[0027] Optionally, after obtaining the feature value of each candidate entity output by the perceptron, the method further includes:

[0028] When the maximum eigenvalue among the plurality of eigenvalues ​​is less than the preset threshold, determining that the entity link result is empty;

[0029] Determine a target type corresponding to the target entity;

[0030] The target entity and the target type are added to the knowledge base.

[0031] Optionally, the candidate features also include independent features of the target entity, wherein the independent features include the frequency of occurrence of the target entity in the knowledge base, the access frequency of the target entity, and the number of interpretation items of the target entity.

[0032] In a second aspect, a device for determining an entity link result is provided, the device comprising:

[0033] A determination module is used to determine a target entity in a target text and obtain a candidate entity corresponding to the target entity from a knowledge base;

[0034] An obtaining module, used for obtaining a plurality of candidate features according to the target text and the candidate text where the candidate entity is located, wherein the candidate text is the context text where the candidate entity is located;

[0035] An input-output module, used for inputting the plurality of candidate features into a perceptron to obtain a feature value of each candidate entity output by the perceptron;

[0036] As a module, it is used to use the candidate entity corresponding to the maximum eigenvalue as the entity chaining result of the target entity when the maximum eigenvalue among the multiple eigenvalues ​​is not less than a preset threshold.

[0037] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0038] Memory, used to store computer programs;

[0039] The processor is used to implement any of the method steps described above when executing a program stored in the memory.

[0040] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the method steps described above is implemented.

[0041] Beneficial effects of the embodiments of the present application:

[0042] The embodiment of the present application provides a method for determining an entity chain result, the method comprising: the server determines a target entity in a target text, and obtains a candidate entity corresponding to the target entity from a knowledge base, and then obtains a plurality of candidate features based on the target text and the candidate text where the candidate entity is located, and then inputs the plurality of candidate features into a sensor to obtain a feature value of each candidate entity output by the sensor, and finally, when the maximum feature value among the plurality of feature values ​​is not less than a preset threshold, the candidate entity corresponding to the maximum feature value is used as the entity chain result of the target entity. In the present application, the server uses the target text where the target entity is located and the candidate text where the candidate entity is located, and takes into account the context of the entity, so that the entity meaning is expressed more accurately, and the accuracy of the chain result is improved.

[0043] Of course, implementing any product or method of the present application does not necessarily require achieving all of the above advantages at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] Figure 1 A schematic diagram of the hardware environment of a method for determining an entity link result provided in an embodiment of the present application;

[0046] Figure 2 A flow chart of a method for determining an entity link result provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of a process for obtaining type characteristics provided in an embodiment of the present application;

[0048] Figure 4 A schematic diagram of a process for obtaining matching features provided in an embodiment of the present application;

[0049] Figure 5A schematic diagram of a process for obtaining loss characteristics provided in an embodiment of the present application;

[0050] Figure 6 A processing flow chart for determining an entity link result provided in an embodiment of the present application;

[0051] Figure 7 A schematic diagram of the structure of a device for determining an entity link result provided in an embodiment of the present application;

[0052] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0054] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.

[0055] In order to solve the problem mentioned in the background technology, according to one aspect of the embodiments of the present application, an embodiment of a method for determining an entity linking result is provided.

[0056] Optionally, in the embodiment of the present application, the above-mentioned method for determining the entity link result can be applied to: Figure 1 In the hardware environment composed of the terminal 101 and the server 103 shown in FIG. Figure 1 As shown, the server 103 is connected to the terminal 101 via a network, and can be used to provide services for the terminal or a client installed on the terminal. A database 105 can be set on the server or independently of the server to provide data storage services for the server 103. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 includes but is not limited to a PC, a mobile phone, a tablet computer, etc.

[0057] A method for determining an entity linking result in an embodiment of the present application may be executed by the server 103 , or may be executed jointly by the server 103 and the terminal 101 .

[0058] The embodiment of the present application provides a method for determining an entity link result, which can be applied to a server to improve the accuracy of entity linking.

[0059] The following will describe in detail a method for determining an entity link result provided by an embodiment of the present application in conjunction with a specific implementation manner. Figure 2 As shown, the specific steps are as follows:

[0060] Step 201: Determine a target entity in a target text, and obtain candidate entities corresponding to the target entity from a knowledge base.

[0061] In the embodiment of the present application, the server first determines the target text, which may be a short text, for example, the target text may be microblog content, article or video title, conversation content, etc. The target entity is a phrase or word in the target text, which may be called a mention entity.

[0062] The server selects candidate entities with the same or similar meanings as the target entity from the knowledge base according to the target entity, wherein the candidate entity may be an abbreviation, synonym, alias or synonym of the target entity. For example, the target entity represents the character SpongeBob SquarePants, and the synonym candidate entity represents the cartoon SpongeBob SquarePants. The target entity and the candidate entity have the same name but different meanings; the target entity is lotus, and the alias candidate entity is Fuqu. The target entity and the candidate entity have the same meaning but completely different names; the target entity is Inner Mongolia, and the synonym candidate entity is Inner Mongolia Autonomous Region. The target entity and the candidate entity have the same meaning but partially different names.

[0063] Step 202: Obtain multiple candidate features based on the target text and the candidate text where the candidate entity is located.

[0064] The candidate text is the context text where the candidate entity is located.

[0065] A target entity may correspond to multiple candidate entities in the knowledge base. Candidate entities with long tails or low richness will introduce noise, affecting the accuracy and processing performance of the chaining results. Therefore, it is necessary to determine the candidate features of the candidate entities and filter the noise of the candidate features.

[0066] The candidate features include context-related features of the target entity, wherein the related features include type features obtained by the DeepType algorithm, matching features obtained by the DeepMatch algorithm, loss features obtained by the DeepCosine algorithm, collinear features, and collaborative reasoning features.

[0067] The server obtains the type feature of the target entity based on the target text and the target entity; obtains the matching feature of the target entity and the candidate entity based on the target text and the candidate text; obtains the loss feature based on the target entity and the candidate entity; obtains the co-occurrence feature based on the first entity other than the target entity in the target text and the second entity other than the candidate entity in the candidate text; and obtains the collaborative reasoning feature based on the target text and the candidate text.

[0068] Step 203: Input multiple candidate features into the perceptron to obtain the feature value of each candidate entity output by the perceptron.

[0069] The server inputs multiple candidate features of the candidate entity into the perceptron to obtain the feature value of each candidate entity output by the perceptron. The perceptron may be an MLP (Multilayer Perceptron).

[0070] Step 204: When the maximum eigenvalue among the multiple eigenvalues ​​is not less than a preset threshold, the candidate entity corresponding to the maximum eigenvalue is used as the entity link result of the target entity.

[0071] The server ranks the feature values ​​of multiple candidate entities from large to small, and determines the maximum feature value ranked first. If the server determines that the maximum feature value is not less than the preset threshold, the candidate entity corresponding to the maximum feature value is used as the entity chain result of the target entity, and the link is to the candidate entity corresponding to the maximum feature value.

[0072] If the server determines that the maximum eigenvalue is less than the preset threshold, the entity link result is determined to be empty, and the link entity is a NULL entity. The server uses DeepType to determine the target type corresponding to the target entity, and then adds the target entity and target type to the knowledge base, so that all entities in the knowledge base contain the corresponding entity type.

[0073] In the present application, the server uses the target text where the target entity is located and the candidate text where the candidate entity is located, taking into account the context of the entity, making the entity meaning more accurately expressed and improving the accuracy of the chaining result. The candidate features can be used as training set data to improve the accuracy of model training. In addition, the present application adds NULL entities without chaining results to the knowledge base, adds NULL entities and entity types to the knowledge base, expands the knowledge base data, facilitates the use of the knowledge base for subsequent model training, and improves the accuracy of model training.

[0074] As an optional implementation, Figure 3As shown, the candidate features include type features, and obtaining multiple candidate features according to the target text includes: inputting the target text into a language representation model to obtain a starting vector corresponding to the starting position of the target entity in the target text, an ending vector corresponding to the ending position, and a first meaning vector corresponding to the meaning of the target entity in the target text output by the language representation model; connecting the starting vector, the ending vector and the first meaning vector to obtain a first vector; and inputting the first vector into a classification recognition model to obtain a type feature corresponding to the target entity.

[0075] In the embodiment of the present application, the language representation model may be a BERT model, such as Figure 3 As shown in the figure, the large box represents the BERT model, and the boxes outside the large box represent multiple word segments in the target text. The target text is input into the BERT model, and the BERT model encodes and decodes the target text to obtain the boxes in the first row of the box. Each box represents the vector of each word segment, and the entity span represents the target text. The BERT model outputs the starting vector corresponding to the starting position of the target entity in the target text, the ending vector corresponding to the ending position of the target entity in the target text, and the first meaning vector corresponding to the meaning of the target entity in the target text. The first meaning vector is the vector of the CRF (conditional random field) position.

[0076] The server connects the start vector, the end vector and the first meaning vector to obtain the first vector, and then inputs the first vector into the classification recognition model, obtains the score of the target entity in each type through softmax, and then selects the type with the highest score as the type feature corresponding to the target entity.

[0077] In this application, the DeepType algorithm uses type features as an indicator of entity chaining, takes the relationship between the target entity and the context into consideration, and improves the accuracy of entity chaining.

[0078] As an optional implementation, the candidate features include matching features, such as Figure 4 As shown, based on the target text and the candidate text where the candidate entity is located, multiple candidate features are obtained, including: inputting the target text and the candidate text into a language representation model to obtain a starting vector corresponding to the starting position of the target entity in the target text, an ending vector corresponding to the ending position, and a second meaning vector corresponding to the meaning of the target entity in the target text output by the language representation model; connecting the starting vector, the ending vector, and the second meaning vector to obtain a second vector; inputting the second vector into a matching model to obtain matching features of the target entity and the candidate entity.

[0079] In the embodiment of the present application, the language representation model may be a BERT model, such as Figure 4As shown in the figure, the large box represents the BERT model, and the boxes outside the large box represent each sentence in the target text and candidate text. The target text and candidate text are input into the BERT model, and the BERT model encodes and decodes the target text and candidate text to obtain the boxes in the first row of the figure. Each box represents each sentence in the target text and candidate text after encoding and decoding. The BERT model is used to calculate the relevance between the target text and the candidate text.

[0080] The BERT model outputs a start vector corresponding to the start position of the target entity in the target text, an end vector corresponding to the end position of the target entity in the target text, and a second meaning vector corresponding to the meaning of the target entity in the target text. Figure 4 The input and Figure 3 The input of the BERT model in is different, so the first meaning vector and the second meaning vector are also different, and the second meaning vector also takes into account the candidate text.

[0081] exist Figure 4 In the above code, CLS represents the second meaning vector, start represents the starting vector, and end represents the ending vector. The server concatenates the starting vector, the ending vector, and the second meaning vector to obtain the second vector, and then inputs the second vector into the matching model to obtain the matching features of the target entity and the candidate entity. Among them, CONCAT(str1, str2, ...) returns the string generated by the connection parameters. If any parameter is NULL, the return value is NULL. The matching model uses a dense fully connected layer neural network and a Sigmoid activation function. The dense network can effectively solve the gradient disappearance problem, strengthen feature propagation, support feature reuse, and greatly reduce the number of parameters. The sigmoid function is simple to implement and the derivative is easy to obtain. In addition, its output is in [0, 1], so it can be used as an output layer to represent probability. It has a maximum entropy model and is less affected by noise data. Dropout can prevent overfitting.

[0082] Optionally, the candidate text in the knowledge base is an SPO triple, namely, subject Subject+predicate Predicate+object Object, wherein the candidate entity is the subject.

[0083] In this application, the DeepMatch algorithm is used to convert entity chaining into a matching problem between entity text and candidate text, determine the relevance of entity text and candidate text, and effectively improve the accuracy of entity chaining.

[0084] As an optional implementation, Figure 5As shown, based on the target text and the candidate text where the candidate entity is located, multiple candidate features are obtained, including: inputting the target text and the candidate text into the language representation model respectively, obtaining a target text vector corresponding to the target text and a candidate text vector corresponding to the candidate text output by the language representation model; selecting a target vector corresponding to the target entity in the target text vector, and selecting a candidate vector corresponding to the candidate entity in the candidate text vector; determining a cosine distance loss value between the target vector and the candidate vector; and using the cosine distance loss value as a loss feature.

[0085] In the embodiment of the present application, the language representation model may be a BERT model, such as Figure 5 As shown in the figure, the large box represents the BERT model, and the boxes outside the large box represent each sentence in the target text and candidate text. The target text and candidate text are input into the BERT model, and the BERT model encodes and decodes the target text and candidate text to obtain the boxes in the first row of the figure. Each box represents the vector of each entity in the target text or the vector of each entity in the candidate text. The server determines the target vector corresponding to the target entity and the candidate vector corresponding to the candidate entity, and then calculates the cosine distance loss value between the target vector and the candidate vector, and uses the cosine distance loss value as the loss feature.

[0086] In this application, the DeepCosine algorithm is used to calculate the cosine distance loss value between the target vector and the candidate vector, and the correlation between entities is constructed for training.

[0087] As an optional implementation, the candidate features include co-occurrence features. Based on the target text and the candidate text where the candidate entity is located, multiple candidate features are obtained, including: determining a first entity other than the target entity in the target text and a second entity other than the candidate entity in the candidate text; if there is an intersection between the first entity and the second entity, determining that the co-occurrence feature is a value of 1; if there is no intersection between the first entity and the second entity, determining that the co-occurrence feature value is a value of 0.

[0088] After the server determines the target entity of the target text, it takes other entities in the target text as the first entity. After the server determines the candidate entity in the candidate text, it takes other entities in the candidate text as the second entity. The server determines whether there is an intersection between the first entity and the second entity. If the server determines that the first entity and the second entity have an intersection, it indicates that the first entity and the second entity are of the same type, and the target entity and the candidate entity are likely to be of the same type, and the co-occurrence feature is 1; if the server determines that there is no intersection between the first entity and the second entity, it indicates that the first entity and the second entity may be of different types, and the target entity and the candidate entity are unlikely to be of the same type, and the co-occurrence feature is 0.

[0089] For example, the target text is "A and B are both my favorite characters", where "A" is the target entity and "B" is the first entity; the candidate text is "A and C are both my favorite cartoons", where "A" is the candidate entity and "C" is the second entity. The intersection of "B" and "C" is 0, indicating that "B" and "C" belong to different types, and the co-occurrence feature is 0.

[0090] As an optional implementation, the candidate features also include collaborative reasoning features. If multiple candidate entities correspond to the same target entity, the system reasoning feature is 1; if only one candidate entity corresponds to the same target entity, the system reasoning feature is 0.

[0091] As an optional implementation, the candidate features also include independent features of the target entity, where the independent features include the frequency of occurrence of the target entity in the knowledge base (popularity), the access frequency of the target entity (heat), and the number of interpretation items of the target entity (richness). The candidate features are used to eliminate entity ambiguity based on the context, so that the meaning of the target entity and the candidate entity is the same, and the accuracy of the chaining results is improved.

[0092] In this application, the server constructs context-related features through the BERT pre-training model, realizes type features, matching features, and loss features, and cooperates with context-independent features to participate in the training process, thereby improving the accuracy of entity chaining results.

[0093] As an optional implementation, determining a target entity in a target text includes: performing word segmentation processing on the target text through an open source tool to obtain multiple word segments; merging multiple word segments through a named entity recognition scheme to obtain a list containing multiple word segments; and selecting a target entity from the list, wherein the target entity is one of the multiple word segments.

[0094] The server uses open source tools, the dictionary obtained by integrating the existing entry names in the knowledge graph and open text, and the Viterbi algorithm to segment the target text to obtain multiple segmented words. Then BERT+CRF is used for named entity recognition, multiple segmented words are merged, a list containing multiple segmented words is obtained, and the target entity is finally selected from the list. The named entity recognition solution can solve the problem that the target text has multiple entity words but only a part of them is recognized, improve the recognition rate of entity words, and prevent entity word recognition omissions. Among them, the open source tool can be jieba segmentation.

[0095] Optionally, the embodiment of the present application also provides a processing flow chart for determining the entity linking result, such as Figure 6 As shown, the specific steps are as follows.

[0096] 1. Obtain the target entity in the target text through word segmentation tools and named entity recognition.

[0097] 2. Select candidate entities corresponding to the target entity from the knowledge base.

[0098] 3. Construct candidate features, which include context-independent features and context-related features. Context-independent features include entity heat and entity richness. Context-related features include type features obtained by the DeepType algorithm, matching features obtained by the DeepMatch algorithm, and loss features obtained by the DeepCosine algorithm.

[0099] 4. Input multiple candidate features into MLP to obtain the feature value of each candidate entity.

[0100] 5. Sort the eigenvalues ​​of multiple candidate entities by rank from large to small, and select the largest eigenvalue.

[0101] 6. Determine whether the characteristic value is not less than the preset threshold. If so, execute step 7. If not,

[0102] Then proceed to step 8.

[0103] 7. The chain points to the candidate entity corresponding to the maximum eigenvalue.

[0104] 8. Determine that the linked entity is a NULL entity, and add the target entity and the corresponding target type to the knowledge base.

[0105] Based on the same technical concept, the embodiment of the present application also provides a device for determining an entity link result, such as Figure 7 As shown, the device comprises:

[0106] The first determination module 701 is used to determine the target entity in the target text and obtain the candidate entity corresponding to the target entity from the knowledge base;

[0107] An obtaining module 702 is used to obtain a plurality of candidate features according to the target text and the candidate text where the candidate entity is located, wherein the candidate text is the context where the candidate entity is located;

[0108] An input-output module 703, used to input multiple candidate features into the perceptron to obtain a feature value of each candidate entity output by the perceptron;

[0109] As module 704, when the maximum eigenvalue among the multiple eigenvalues ​​is not less than a preset threshold, the candidate entity corresponding to the maximum eigenvalue is used as the entity chaining result of the target entity.

[0110] Optionally, the candidate features include type features, and the obtaining module 702 includes:

[0111] A first input-output unit is used to input the target text into the language representation model, and obtain a start vector corresponding to the start position of the target entity in the target text, an end vector corresponding to the end position, and a first meaning vector corresponding to the meaning of the target entity in the target text output by the language representation model;

[0112] A first connection unit, used for performing vector connection on the start vector, the end vector and the first meaning vector to obtain a first vector;

[0113] The second input-output unit is used to input the first vector into the classification recognition model to obtain the type feature corresponding to the target entity.

[0114] Optionally, the candidate features include matching features, and the obtaining module 702 includes:

[0115] A third input-output unit is used to input the target text and the candidate text into the language representation model, and obtain the start vector corresponding to the start position of the target entity in the target text, the end vector corresponding to the end position, and the second meaning vector corresponding to the meaning of the target entity in the target text output by the language representation model;

[0116] A second connection unit is used to perform vector connection on the start vector, the end vector and the second meaning vector to obtain a second vector;

[0117] The fourth input-output unit is used to input the second vector into the matching model to obtain matching features of the target entity and the candidate entity.

[0118] Optionally, the candidate feature includes loss, and module 702 includes:

[0119] A fifth input-output unit, used to input the target text and the candidate text into the language representation model respectively, and obtain a target text vector corresponding to the target text and a candidate text vector corresponding to the candidate text output by the language representation model;

[0120] A selection unit, used to select a target vector corresponding to a target entity in the target text vector, and select a candidate vector corresponding to a candidate entity in the candidate text vector;

[0121] A first determining unit, configured to determine a cosine distance loss value between a target vector and a candidate vector;

[0122] As a unit, it is used to take the cosine distance loss value as the loss feature.

[0123] Optionally, the candidate features include co-occurrence features, and the obtaining module 702 includes:

[0124] A second determination unit, used to determine a first entity other than the target entity in the target text and a second entity other than the candidate entity in the candidate text;

[0125] A third determining unit, configured to determine that the co-occurrence feature is a value of 1 if there is an intersection between the first entity and the second entity;

[0126] The fourth determining unit is configured to determine that the co-occurrence feature value is a value of 0 if there is no intersection between the first entity and the second entity.

[0127] Optionally, the device further comprises:

[0128] A second determination module, configured to determine that the entity link result is empty when the maximum eigenvalue among the multiple eigenvalues ​​is less than a preset threshold;

[0129] A third determination module is used to determine the target type corresponding to the target entity;

[0130] The adding module is used to add the target entity and target type into the knowledge base.

[0131] Optionally, the candidate features also include independent features of the target entity, wherein the independent features include the frequency of occurrence of the target entity in the knowledge base, the access frequency of the target entity, and the number of explanation items of the target entity.

[0132] According to another aspect of the embodiments of the present application, the present application provides an electronic device, such as Figure 8 As shown, it includes a memory 803, a processor 801, a communication interface 802 and a communication bus 804. The memory 803 stores a computer program that can be run on the processor 801. The memory 803 and the processor 801 communicate through the communication interface 802 and the communication bus 804. When the processor 801 executes the computer program, the steps of the above method are implemented.

[0133] The memory and processor in the above electronic device communicate via a communication bus and a communication interface. The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc.

[0134] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0135] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0136] According to another aspect of the embodiments of the present application, a computer-readable medium having a non-volatile program code executable by a processor is provided.

[0137] Optionally, in an embodiment of the present application, a computer-readable medium is configured to store program code for the processor to execute the above method steps.

[0138] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0139] When the embodiments of the present application are specifically implemented, reference may be made to the above-mentioned embodiments, which have corresponding technical effects.

[0140] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0141] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0142] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0144] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0146] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0147] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk. It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.

[0148] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A method for determining entity chaining results, It is characterized in that The method comprises: Determine a target entity in a target text, and obtain candidate entities corresponding to the target entity from a knowledge base; According to the target text and the candidate text where the candidate entity is located, a plurality of candidate features are obtained, wherein the candidate text is the context text where the candidate entity is located; Inputting the plurality of candidate features into a perceptron to obtain a feature value of each candidate entity output by the perceptron; When the maximum eigenvalue among the plurality of eigenvalues ​​is not less than a preset threshold, taking the candidate entity corresponding to the maximum eigenvalue as the entity chaining result of the target entity; Among them, according to the target text and the candidate text where the candidate entity is located, a plurality of candidate features are obtained, including: According to the target text and the target entity, a DeepType algorithm is used to obtain a type feature of the target entity; According to the target text and the candidate text, a DeepMatch algorithm is used to obtain matching features of the target entity and the candidate entity; According to the target entity and the candidate entity, a loss feature is obtained by using a DeepCosine algorithm; The DeepCosine algorithm is used to obtain co-occurrence features according to a first entity other than the target entity in the target text and a second entity other than the candidate entity in the candidate text.

2. The method according to claim 1, It is characterized in that The candidate features include type features, According to the target text, multiple candidate features are obtained, including: Input the target text into a language representation model, and obtain a start vector corresponding to a start position of the target entity in the target text, an end vector corresponding to an end position, and a first meaning vector corresponding to a meaning of the target entity in the target text output by the language representation model; Performing vector connection on the starting vector, the ending vector and the first meaning vector to obtain a first vector; The first vector is input into a classification recognition model to obtain a type feature corresponding to the target entity.

3. The method according to claim 1, It is characterized in that The candidate features include matching features. According to the target text and the candidate text where the candidate entity is located, a plurality of candidate features are obtained, including: Inputting the target text and the candidate text into a language representation model, obtaining a start vector corresponding to a start position of the target entity in the target text, an end vector corresponding to an end position, and a second meaning vector corresponding to a meaning of the target entity in the target text output by the language representation model; Performing vector connection on the starting vector, the ending vector and the second meaning vector to obtain a second vector; The second vector is input into a matching model to obtain matching features between the target entity and the candidate entity.

4. The method according to claim 1, It is characterized in that The candidate features include loss features, According to the target text and the candidate text where the candidate entity is located, a plurality of candidate features are obtained, including: Inputting the target text and the candidate text into a language representation model respectively, and obtaining a target text vector corresponding to the target text and a candidate text vector corresponding to the candidate text output by the language representation model; Selecting a target vector corresponding to the target entity from the target text vector, and selecting a candidate vector corresponding to the candidate entity from the candidate text vector; Determining a cosine distance loss value between the target vector and the candidate vector; The cosine distance loss value is used as a loss feature.

5. The method according to claim 1, It is characterized in that The candidate features include co-occurrence features, The obtaining of multiple candidate features according to the target text and the candidate text where the candidate entity is located includes: Determine a first entity other than the target entity in the target text and a second entity other than the candidate entity in the candidate text; If the first entity and the second entity have an intersection, determining that the co-occurrence feature is a value of 1; If there is no intersection between the first entity and the second entity, it is determined that the co-occurrence feature value is a value of 0.

6. The method according to claim 1, It is characterized in that After obtaining the feature value of each candidate entity output by the perceptron, the method further includes: When the maximum eigenvalue among the plurality of eigenvalues ​​is less than the preset threshold, determining that the entity link result is empty; Determine a target type corresponding to the target entity; The target entity and the target type are added to the knowledge base.

7. The method according to claim 1, It is characterized in that The candidate features also include independent features of the target entity, wherein the independent features include the occurrence frequency of the target entity in the knowledge base, the access frequency of the target entity, and the number of interpretation items of the target entity.

8. A device for determining entity chaining results, It is characterized in that The device comprises: A determination module is used to determine a target entity in a target text and obtain a candidate entity corresponding to the target entity from a knowledge base; An obtaining module, used for obtaining a plurality of candidate features according to the target text and the candidate text where the candidate entity is located, wherein the candidate text is the context text where the candidate entity is located; An input-output module, used for inputting the plurality of candidate features into a perceptron to obtain a feature value of each candidate entity output by the perceptron; As a module, when the maximum eigenvalue among the plurality of eigenvalues ​​is not less than a preset threshold, the candidate entity corresponding to the maximum eigenvalue is used as the entity chaining result of the target entity; Wherein, the obtaining module is used for: According to the target text and the target entity, a DeepType algorithm is used to obtain a type feature of the target entity; According to the target text and the candidate text, a DeepMatch algorithm is used to obtain matching features of the target entity and the candidate entity; According to the target entity and the candidate entity, a loss feature is obtained by using a DeepCosine algorithm; The DeepCosine algorithm is used to obtain co-occurrence features according to a first entity other than the target entity in the target text and a second entity other than the candidate entity in the candidate text.

9. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Named entity linking method and apparatus

    CN107608960A

  • Entity linking method and device and storage medium

    CN110569496A

  • Entity linking method, entity linking device, electronic equipment and medium

    CN110991187A

  • Entity linking method and device

    CN111401049A

  • Entity chain pointing method, device and equipment and storage medium

    CN111428507A