Knowledge Graph Question Answering Question Entity Linking Method and Device

By generating empirical knowledge coding representations related to user questions and fusing them with the coded representations of entity descriptions to form background knowledge coding representations, the problem of poor physical disconnection effect in the prior art is solved and a more accurate entity linking effect is achieved.

CN114020931BActive Publication Date: 2025-06-13工银科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111305613.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-05
Publication Date
2025-06-13
Estimated Expiration
2041-11-05

AI Technical Summary

Technical Problem

The prior art has the problem of poor physical disconnection effect in question entity links, which mainly due to the difference in the information between the entity description and the user question, there is a semantic gap between the entity encoding representation and the question code representation.

Method used

By generating empirical knowledge coding representations related to user questions, and fusing the encoded representation of entity description with empirical knowledge coding representations, a background knowledge coding representation is obtained. Then, based on this background knowledge, the entity link for the user's question is encoded.

Benefits of technology

Effectively improve the effect of entity mention extraction and entity disconnection, and improve the accuracy of entity links by using background knowledge that is more homogeneous to user questions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020931B_ABST
    Figure CN114020931B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and apparatus for entity linking of knowledge graph Q&A questions, which can be used in the financial field or other technical fields. The method includes: generating an empirical knowledge encoding representation related to the user question for each entity in the knowledge graph according to the encoding representation of the user question and the encoding representation of the entity empirical knowledge corresponding to each entity in the knowledge graph; fusing the encoding representation of the entity description corresponding to each entity and the empirical knowledge encoding representation related to the user question to obtain a background knowledge encoding representation corresponding to each entity; generating a new encoding representation of the user question according to the background knowledge encoding representation corresponding to each entity and the encoding representation of the user question; and obtaining M entity mention prediction results of the user question according to the new encoding representation of the user question and a preset neural network. The present invention can effectively improve the effects of entity mention extraction and entity disambiguation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of entity linking, and in particular, to a method and device for entity linking of knowledge graph question-and-answer questions. Background Art

[0002] The knowledge graph represents knowledge in the form of entity-relationship-entity triples, and as a whole constitutes a graph structure with entities as nodes and the relationships between entities as edges. Knowledge graph question and answer is one of the typical application forms of the knowledge graph. Specifically, it performs semantic understanding on a natural language question input by the user, and then queries and infers corresponding answers from the knowledge graph to meet the user's needs.

[0003] Question entity linking is a fundamental task for realizing semantic understanding and intention recognition of knowledge graph questions and answers. This task identifies entity mentions from the question and links them to the correct entities in the knowledge graph. An example of the result of question entity linking is shown in Table 1. In the question "Which championships has A won?", "A" is identified as an entity mention and linked to the entity "Tennis player: A" in the knowledge graph, rather than the entity "Singer: A".

[0004] Table 1 Example of the result of question entity linking

[0005]

[0006] Question entity linking includes two subtasks: entity mention extraction and entity disambiguation. The former identifies the entity mentions contained in the question, and the latter matches the identified entity mentions with the entities in the knowledge graph to achieve linking. The technical solutions of the prior art can adopt a question entity linking method that integrates entity description texts. This type of method uses the description texts of entities (usually containing content that explains the entities) to expand the original descriptions of the entities in the knowledge graph, and then inputs the expanded entity descriptions, such as texts including entity names and entity descriptions, into an entity encoder such as a bert model to obtain entity encoding representations, and performs subsequent entity mention recognition and entity disambiguation steps.

[0007] The disadvantage of the question entity linking method that integrates entity description text lies in that there are certain differences between the description information of the entity and the question raised by the user about the knowledge graph in terms of information scope, type, form, etc. Specifically, the user's question is usually a very short question around a local fragment of the KB (related entities, relationships, attributes), while the entity description text usually contains a general introduction of the entity, such as descriptive texts like concept definitions, explanations, properties, etc. This difference creates a certain semantic gap between the entity encoding representation and the question encoding representation, which is not conducive to fully understanding the intention and context of the question. For example, for the question "What awards has A won?" and two entity descriptions "A, a tennis player, the women's singles champion of the 2011 and 2014 tennis open tournaments." and "A, a singer, has won the top ten film and television singer awards many times.", the question entity linking method that integrates entity description text may not be able to determine whether "A" in the question refers to "Tennis player: A" or "Singer: A".

[0008] It can be seen that the existing entity disambiguation effect of the question entity linking method that integrates entity description text is not ideal, and the existing technology lacks a solution that can effectively improve the entity disambiguation effect. Summary of the Invention

[0009] In order to solve at least one of the technical problems in the above background technology, the present invention proposes a knowledge graph question and answer question entity linking method and device.

[0010] To achieve the above object, according to one aspect of the present invention, there is provided a knowledge graph question and answer question entity linking method, the method comprising:

[0011] Encode the user's question to obtain an encoded representation of the user's question;

[0012] Obtain the encoded representation of the entity description corresponding to each entity in the knowledge graph and the encoded representation of the entity's empirical knowledge corresponding to each entity;

[0013] According to the encoded representation of the user's question and the encoded representation of the entity's empirical knowledge corresponding to each entity in the knowledge graph, generate an encoded representation of the empirical knowledge related to the user's question corresponding to each entity in the knowledge graph;

[0014] Fuse the encoded representation of the entity description corresponding to each entity and the encoded representation of the empirical knowledge related to the user's question to obtain an encoded representation of the background knowledge corresponding to each entity;

[0015] According to the encoded representation of the background knowledge corresponding to each entity and the encoded representation of the user's question, generate a new encoded representation of the user's question;

[0016] Obtain M entity mention prediction results of the user question according to the new encoded representation of the user question and a preset neural network, where each of the entity mention prediction results includes: consecutive constituent units in the user question and the probability that the consecutive constituent units are entity mentions, and M is an integer greater than 0;

[0017] For each of the consecutive constituent units, screen out the N entities with the highest matching degree from all entities in the knowledge graph through a matching algorithm, where N is an integer greater than 0;

[0018] For each of the consecutive constituent units, calculate the inner product of the encoded representation of the consecutive constituent unit and the encoded representation of the background knowledge of each of the N entities corresponding to the consecutive constituent unit, perform normalization processing on the calculated inner product to obtain the probability distribution of the N entities corresponding to the consecutive constituent unit, and determine the entity with the highest probability among the N entities corresponding to the consecutive constituent unit according to the probability distribution; According to the probability that each of the consecutive constituent units is an entity mention and the entity with the highest probability among the N entities, obtain the entity linking result of the user question.

[0019] To achieve the above object, according to another aspect of the present invention, there is provided a knowledge graph question-answering question entity linking device, which includes:

[0020] A user question encoding module, configured to encode a user question to obtain an encoded representation of the user question;

[0021] An encoded representation acquisition module, configured to acquire the encoded representation of the entity description corresponding to each entity in the knowledge graph and the encoded representation of the entity empirical knowledge corresponding to each entity;

[0022] An empirical knowledge encoded representation generation module related to the user question, configured to generate an empirical knowledge encoded representation related to the user question corresponding to each entity in the knowledge graph according to the encoded representation of the user question and the encoded representation of the entity empirical knowledge corresponding to each entity in the knowledge graph;

[0023] A background knowledge encoded representation generation module, configured to fuse the encoded representation of the entity description corresponding to each entity and the empirical knowledge encoded representation related to the user question to obtain the background knowledge encoded representation corresponding to each entity;

[0024] A new encoded representation generation module of the user question, configured to generate a new encoded representation of the user question according to the background knowledge encoded representation corresponding to each entity and the encoded representation of the user question;

[0025] An entity mention prediction result generation module, configured to obtain M entity mention prediction results of a user question according to the newly encoded representation of the user question and a preset neural network, where each of the entity mention prediction results includes: consecutive constituent units in the user question and the probability that the consecutive constituent units are entity mentions, and M is an integer greater than 0;

[0026] An entity matching module, configured to respectively screen out the N entities with the highest matching degree from all entities in the knowledge graph for each of the consecutive constituent units through a matching algorithm, where N is an integer greater than 0;

[0027] An entity linking result generation module, configured to, for each of the consecutive constituent units, calculate the inner product of the encoded representation of the consecutive constituent unit and the encoded representation of the background knowledge of each of the N entities corresponding to the consecutive constituent unit, perform normalization processing on the calculated inner product to obtain the probability distribution of the N entities corresponding to the consecutive constituent unit, and determine the entity with the highest probability among the N entities corresponding to the consecutive constituent unit according to the probability distribution; according to the probability that each of the consecutive constituent units is an entity mention and the entity with the highest probability among the N entities, obtain the entity linking result of the user question.

[0028] To achieve the above object, according to another aspect of the present invention, there is also provided a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, the steps in the above entity linking method for knowledge graph question and answer questions are implemented.

[0029] To achieve the above object, according to another aspect of the present invention, there is also provided a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed in a computer processor, the steps in the above entity linking method for knowledge graph question and answer questions are implemented.

[0030] The beneficial effects of the present invention are as follows:

[0031] The present invention first generates the encoded representation of the empirical knowledge related to the user question corresponding to each entity in the knowledge graph according to the encoded representation of the user question and the encoded representation of the entity empirical knowledge corresponding to each entity in the knowledge graph, and then fuses the encoded representation of the entity description corresponding to each entity in the knowledge graph and the encoded representation of the empirical knowledge related to the user question to obtain the encoded representation of the background knowledge corresponding to each entity, and further performs entity linking of the user question based on the encoded representation of the background knowledge. The present invention adopts background knowledge that is more homogeneous with the user question, which can effectively improve the effects of entity mention extraction and entity disambiguation. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings. In the accompanying drawings:

[0033] Figure 1 is a flowchart of the method for entity linking of knowledge graph question-and-answer questions in an embodiment of the present invention;

[0034] Figure 2 is a flowchart of generating an encoded representation of an entity description in an embodiment of the present invention;

[0035] Figure 3 is a flowchart of generating an encoded representation of entity empirical knowledge in an embodiment of the present invention;

[0036] Figure 4 is a flowchart of encoding a user question in an embodiment of the present invention;

[0037] Figure 5 is a flowchart of generating an encoded representation of empirical knowledge related to a user question in an embodiment of the present invention;

[0038] Figure 6 is a flowchart of generating a new encoded representation of a user question in an embodiment of the present invention;

[0039] Figure 7 is a flowchart of obtaining M entity mention prediction results of a user question in an embodiment of the present invention;

[0040] Figure 8 is a flowchart of determining the entity linking result of a user question in an embodiment of the present invention;

[0041] Figure 9 is a structural block diagram of a knowledge graph question-and-answer question entity linking device in an embodiment of the present invention;

[0042] Figure 10 is a schematic diagram of a computer device in an embodiment of the present invention. Detailed implementation manners

[0043] To enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0044] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.

[0045] It should be noted that the terms "including" and "having" in the specification and claims of the present invention and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0046] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0047] To introduce the present invention more clearly, some terms in the present invention will be explained below.

[0048] Knowledge graph: It is a structured semantic knowledge base that describes concepts, entities, and their relationships in the physical world in symbolic form. At the data level, the knowledge graph uses entities with types and attributes as nodes and the relationships between entities as edges to form a heterogeneous graph structure.

[0049] Entity: It refers to a specific object in the objective world, such as a person's name, a place name, an organization name. Category names such as "human", "animal", "plant" are not entities.

[0050] Entity mention: It refers to the same or different string expressions that represent the same entity.

[0051] Encoding: Using a deep learning network to convert natural language into a real number matrix. For example, converting "XX is the capital of country Y" into an 8×100 real number matrix. There are 8 characters in the sentence and each character corresponds to a 100-dimensional real number vector.

[0052] Bert: A natural language understanding encoder model. Input a natural language sentence, and after training, the encoded representations of each component unit in the sentence can be obtained.

[0053] Fully connected neural network: The most basic neural network that transforms an input Di-dimensional vector to obtain a Do-dimensional vector.

[0054] Sigmoid: A neural network activation function that maps a variable to a value between 0 and 1.

[0055] Fuzzy matching: A technique for approximately (rather than precisely) finding strings that match a pattern.

[0056] Softmax normalization: Compresses a K-dimensional vector z of arbitrary real numbers into another K-dimensional real vector σ(z) such that each element is in the range (0, 1) and the sum of all elements is 1.

[0057] Training: Learning (determining) the ideal values of all weights and biases through labeled samples / correct examples.

[0058] Loss function / loss: A function that maps the value of a random event or its associated random variable to a non-negative real number to represent the "risk" or "loss" of the random event.

[0059] Cross-entropy loss, Log-likelihood loss: Two loss functions that are a way to measure the deviation between the predicted value and the true value of a neural network. The formula is omitted.

[0060] Gradient backpropagation: A common method for training artificial neural networks. This method calculates the gradient of the loss function for all weights in the neural network and is used to update the weights to minimize the loss function.

[0061] The present invention provides a method for entity linking in knowledge graph question answering for question sentences based on empirical knowledge. This method takes user question sentences, entities in the knowledge graph, entity description knowledge, and entity empirical knowledge, i.e., the set of question sentences in which the entity has appeared, as inputs. First, an encoder is used to independently encode the entity description knowledge in the knowledge graph, the entity empirical knowledge in the knowledge graph, and the user question sentence. Among them, the encoding of entity description knowledge and the encoding of entity empirical knowledge are calculated offline in advance. Then, based on the attention mechanism, the entity empirical knowledge encoding related to the user question sentence is selected, and the entity empirical knowledge encoding is fused with the entity description knowledge encoding to form background knowledge. Then, entity mention prediction is performed under the guidance of the background knowledge. Finally, candidate entities are recalled, and the matching and sorting of entity mention encoding and candidate entity background knowledge encoding are carried out. The top 1 candidate entity is selected as the linked entity, and the entity mention and the entity in the knowledge graph linked to are returned as the result of entity linking. Compared with the prior art, the present invention uses background knowledge that is more homogeneous with the user question sentence, which can effectively improve the effects of entity mention extraction and entity disambiguation.

[0062] Figure 1 Is the flowchart of the method for entity linking in knowledge graph question answering for question sentences in the embodiment of the present invention, as Figure 1As shown in the figure, in an embodiment of the present invention, the method for entity linking of knowledge graph question-and-answer questions of the present invention includes steps S101 to S108.

[0063] Step S101: Encode the user question to obtain an encoded representation of the user question.

[0064] Step S102: Obtain the encoded representation of the entity description corresponding to each entity in the knowledge graph and the encoded representation of the entity empirical knowledge corresponding to each entity.

[0065] In an embodiment of the present invention, the entity empirical knowledge specifically includes: questions containing entities.

[0066] Step S103: Generate an encoded representation of the empirical knowledge related to the user question corresponding to each entity in the knowledge graph according to the encoded representation of the user question and the encoded representation of the entity empirical knowledge corresponding to each entity in the knowledge graph.

[0067] Step S104: Fuse the encoded representation of the entity description corresponding to each entity and the encoded representation of the empirical knowledge related to the user question to obtain the encoded representation of the background knowledge corresponding to each entity.

[0068] Step S105: Generate a new encoded representation of the user question according to the encoded representation of the background knowledge corresponding to each entity and the encoded representation of the user question.

[0069] Step S106: Obtain M entity mention prediction results of the user question according to the new encoded representation of the user question and a preset neural network, where each entity mention prediction result includes: continuous constituent units in the user question and the probability that the continuous constituent units are entity mentions, and M is an integer greater than 0.

[0070] Step S107: For each of the continuous constituent units, screen out the N entities with the highest matching degree from all entities in the knowledge graph through a matching algorithm, where N is an integer greater than 0.

[0071] Step S108: For each of the continuous constituent units, calculate the inner product of the encoded representation of the continuous constituent unit and the encoded representation of the background knowledge of each of the N entities corresponding to the continuous constituent unit, perform normalization processing on the calculated inner product to obtain the probability distribution of the N entities corresponding to the continuous constituent unit, and determine the entity with the highest probability among the N entities corresponding to the continuous constituent unit according to the probability distribution; according to the probability that each of the continuous constituent units is an entity mention and the entity with the highest probability among the N entities, obtain the entity linking result of the user question.

[0072] Figure 2 is a flowchart for generating an encoded representation of an entity description in an embodiment of the present invention. As Figure 2 shown, in an embodiment of the present invention, the encoded representations of the entity descriptions corresponding to each entity in step S102 are specifically generated by step S201 and step S202.

[0073] Step S201: Concatenate the entity name string and the entity description string corresponding to each entity in the knowledge graph to obtain a concatenated string.

[0074] Step S202: Perform vector encoding on the concatenated string corresponding to each entity to obtain the encoded representation of the entity description corresponding to each entity.

[0075] In a specific embodiment of the present invention, the specific process of encoding the entity descriptions corresponding to each entity can be as follows:

[0076] Input: The set of names of all entities in the knowledge graph, and the entity descriptions of each entity.

[0077] For example, the text description of the tennis player entity "A" is "A, tennis player, champion of the women's singles in the 2011 tennis open and the 2014 tennis open.", and the text description of the singer entity "A" is "A, singer, has won the top ten singer awards in film and television many times."

[0078] Output: The encoded representation of the entity description corresponding to each entity in the knowledge graph is a real vector of dimension h, where h is an integer greater than 0.

[0079] Encoding process: Offline, concatenate the entity name string and the entity description string into a single string, input it into an existing text encoder for vector encoding, and obtain the encoding of the entire string from the output as the encoding of the entity description knowledge.

[0080] For example, the process of using the Bert text encoder to encode entity description knowledge in the present invention is as follows:

[0081] 1) Concatenate the entity name and its entity description into a string: "[CLS] entity name [ENT] entity description [SEP]", where [CLS] represents the start symbol of the string, [ENT] represents the separator between the entity name and the entity description, and [SEP] represents the end symbol of the string;

[0082] 2) Input this string into Bert for vector encoding, and take the output encoding at the [CLS] position as the encoding of the entity, with a dimension of h. h usually takes 768 or 1024;

[0083] For example, the athlete entity "A" and its entity description are concatenated into a string "[CLS]A[ENT]A, a tennis player, the women's singles champion of the 2011 Tennis Open and the 2014 Tennis Open.[SEP]", which is input into Bert for vector encoding, and the output encoding at the [CLS] position is used as the encoding of the entity description knowledge.

[0084] Figure 3 It is a flowchart for generating the encoded representation of entity empirical knowledge in an embodiment of the present invention. As Figure 3 shown, in an embodiment of the present invention, the encoded representations of the entity empirical knowledge corresponding to each entity in the above step S102 are specifically generated by step S301 and step S302.

[0085] Step S301: Obtain all the questions containing the entity corresponding to each entity in the knowledge graph, as well as the start position and end position of the entity in each question containing the entity.

[0086] Step S302: For each question containing the entity, first perform vector encoding on the string of the question containing the entity to obtain the encoding vectors of each constituent unit in the string of the question containing the entity, then determine all the constituent units between the start position and the end position in the question containing the entity, and calculate the mean value of these constituent units' encoding vectors bit by bit to obtain the mean value result. The mean value result corresponding to each question containing the entity is an encoded representation of the entity empirical knowledge corresponding to the entity in the question containing the entity.

[0087] In a specific embodiment of the present invention, the specific process of encoding the entity empirical knowledge corresponding to each entity can be as follows:

[0088] Input: The set of the names of all entities in the knowledge graph, as well as n questions (i.e., questions containing entities) in which each entity appears, and the start position and end position of the entity in each question. Here, the n values corresponding to different entities may be different.

[0089] For example, the questions in which the tennis player entity "A" appears include:

[0090] -- "What championships has A won?", where the start position of the entity in the question is 0 and the end position of the entity in the question is 1;

[0091] -- "Is A the first one in country X to win a Grand Slam tennis championship?", where the start position of the entity in the question is 18 and the end position of the entity in the question is 19;

[0092] Output: The encoded representation of the entity empirical knowledge of each entity in the knowledge graph, that is, an n×h-dimensional real number matrix, where the encoded representation of the empirical knowledge of the i-th entity is denoted as Mei , where h and n are integers.

[0093] Encoding process: For each of the n questions:

[0094] 1) Input the question string into an existing text encoder for vector encoding, and obtain the h-dimensional vectors of each constituent unit in the string from the output;

[0095] 2) Extract all the constituent units between the starting position and the ending position of the entity in the question, and calculate the mean of the encoding vectors of these constituent units bit by bit to obtain an h-dimensional vector, which is used as the encoding representation of the entity's empirical knowledge based on this question. Here, the constituent units in the question can be characters;

[0096] For example, the process of encoding the entity's empirical knowledge using the Bert text encoder in the present invention is as follows:

[0097] 1) Concatenate the i-th question in which the entity appears into a string: "[CLS]Question i[SEP]";

[0098] 2) Input the string of Question i into Bert for vector encoding, and obtain the h-dimensional encoding of each character in the string from the output. The constituent units of the Chinese character string processed by the Bert encoder are characters;

[0099] 3) For Question i, extract all the question constituent units between the starting position + 1 and the ending position + 1 (because the [CLS] symbol is concatenated before the question, so the starting position and the ending position need to be incremented by 1 on the original value), and calculate the mean of the encoding vectors bit by bit to obtain an h-dimensional vector, which is used as one encoding representation of the entity's empirical knowledge;

[0100] For example, for the two questions "What championships has athlete A won?" and "Is A the first to win a Grand Slam championship in tennis?" where the entity "A" appears, a total of two h-dimensional encoding representations of the entity's empirical knowledge are obtained.

[0101] Figure 4 is the flowchart for encoding the user's question in an embodiment of the present invention. As Figure 4 shown, in an embodiment of the present invention, the above step S101 specifically includes step S401 and step S402.

[0102] Step S401: Input the string of the user's question into the encoder. The encoder splits the string of the user's question into multiple units and generates the corresponding encoding vectors for each unit.

[0103] Step S402: Vertically concatenate the encoding vectors corresponding to each unit to obtain the user's question encoding matrix.

[0104] In a specific embodiment of the present invention, the specific process of encoding the user's question can be as follows:

[0105] Input: The question string input by the user, such as "Which championships has A won?";

[0106] Output: The encoded representation of the user's question, which is a real number matrix M of q_len×h dimensions q , that is, the user's question encoding matrix, where q_len and h are integers, q_len is the length of the unit sequence obtained by splitting the question into constituent units according to the encoder, and h is the dimension of the vector corresponding to each unit.

[0107] Encoding process: Input the question string input by the user into a certain existing text encoder for vector encoding, and obtain the encodings of each constituent unit in the string from the output.

[0108] For example, the process of using the Bert text encoder to encode questions in the present invention is as follows:

[0109] 1) Concatenate the user input into a string: "[CLS]User's question[SEP]";

[0110] 2) Input the above string into Bert for vector encoding, and obtain the encoding vectors of each character in the string from the output. The constituent units of the Chinese character string processed by the Bert encoder are characters.

[0111] For example, for the question "Which awards has A won?", the user's question encoding matrix M q obtained using the Bert encoder is a real number matrix of 10×h dimensions.

[0112] Figure 5 is the flowchart for generating the encoded representation of empirical knowledge related to the user's question in an embodiment of the present invention. As Figure 5 shown, in an embodiment of the present invention, the above step S103 specifically includes step S501 and step S502.

[0113] Step S501: Vertically concatenate the encoded representations of all the entity empirical knowledge corresponding to each entity in the knowledge graph to obtain the entity empirical knowledge encoding matrix corresponding to each entity.

[0114] Step S502: For each entity in the knowledge graph, first calculate the product of the user's question encoding matrix and the transposed matrix of the entity empirical knowledge encoding matrix corresponding to the entity to obtain a first product matrix. Then, sum the rows of the first product matrix to obtain a first weight matrix. Finally, calculate the product of the first weight matrix and the entity empirical knowledge encoding matrix corresponding to the entity to obtain the encoded representation of the empirical knowledge related to the user's question corresponding to the entity.

[0115] In a specific embodiment of the present invention, the specific process of generating an empirical knowledge coding representation related to the user's question sentence may be as follows:

[0116] Input: User question sentence coding matrix M q , a real number matrix of q_len×h dimensions, and an encoding representation of the entity empirical knowledge corresponding to each entity in the knowledge graph, an n×h-dimensional real number matrix M ei ;

[0117] Output: The encoding representation of the empirical knowledge related to the user's question sentence corresponding to each entity in the knowledge graph, which is an h-dimensional vector.

[0118] Specific generation process:

[0119] Calculate M ei relative to M q weight matrix W eiq , specifically, first calculate the matrix product of M q and the transposed matrix of M ei to obtain a matrix of dimensions q_len×n (i.e., the first product matrix), and then calculate the matrix sum in the q_len dimension to obtain a weight matrix W of dimensions 1*n eiq (i.e., the first weight matrix);

[0120] Calculate the encoding representation M ei ' of the empirical knowledge related to the user's question sentence corresponding to the entity, specifically, calculate the matrix product of W eiq and M ei to obtain a matrix of dimensions 1×h, that is, an h-dimensional vector.

[0121] In a specific embodiment of the present invention, the above-mentioned step S104 of fusing the encoding representation of the entity description corresponding to each entity and the encoding representation of the empirical knowledge related to the user's question sentence to obtain the background knowledge encoding representation corresponding to each entity may be as follows:

[0122] Input: The encoding representation of the entity description corresponding to each entity in the knowledge graph, that is, an h-dimensional real number vector, and the encoding representation of the empirical knowledge related to the user's question sentence corresponding to each entity in the knowledge graph, that is, an h-dimensional real number vector;

[0123] Output: The background knowledge encoding representation of each entity in the knowledge graph, which is 1 h-dimensional vector;

[0124] Fusion process: Add the two input h-dimensional real number vectors bit by bit to obtain 1 h-dimensional vector.

[0125] Figure 6 This is the flowchart of generating a new encoding representation of the user's question sentence in the embodiment of the present invention, asFigure 6 As shown in Figure 6 , in an embodiment of the present invention, step S105 specifically includes step S601 and step S602.

[0126] Step S601: Vertically splice the background knowledge encoding representations of all entities in the knowledge graph to obtain a background knowledge encoding matrix.

[0127] Step S602: Calculate the product of the user question encoding matrix and the transposed matrix of the background knowledge encoding matrix to obtain a second product matrix, then perform column-wise normalization on the second product matrix to obtain a second weight matrix, calculate the product of the second weight matrix and the background knowledge encoding matrix, and add this product to the user question encoding matrix bit by bit to obtain a new encoding representation of the user question.

[0128] In a specific embodiment of the present invention, the specific process of generating a new encoding representation of the user question can be as follows:

[0129] Input: The encoding representation of the user question, a real number matrix M of dimension q_len×h q , and the background knowledge encoding representations of all entities in the knowledge graph. Suppose there are T entities in the knowledge graph, that is, a real number matrix M of dimension T×h e ;

[0130] Output: A new encoding representation of the user question, a real number matrix M of dimension q_len×h q ’.

[0131] Calculation process:

[0132] 1) Calculate the weight matrix W q with respect to M e . Specifically, first calculate the matrix product of M qe and the transposed matrix of M q to obtain a matrix of dimension q_len×T (i.e., the second product matrix), and then calculate the softmax normalization on the T dimension to obtain a weight matrix W e of dimension q_len×T (i.e., the second weight matrix); qe

[0133] 2) Calculate the new encoding representation M q ’ of the question based on the attention weight. Specifically, first calculate the matrix product of W qe and M e to obtain a matrix of dimension q_len×h, and then add it to M q matrix-wise to obtain a new encoding representation M q ’ of the question of dimension q_len×h.

[0134] Figure 7This is a flowchart for obtaining the predicted results of M entity mentions in the user's question in an embodiment of the present invention. As Figure 7 shown, in an embodiment of the present invention, the above step S106 specifically includes steps S701 to S703.

[0135] Step S701: According to the encoding vector corresponding to each constituent unit in the user's question in the newly encoded representation of the user's question and a preset neural network, respectively determine the probability that each constituent unit in the user's question serves as the starting unit of an entity mention, the probability that it serves as the ending unit of an entity mention, and the probability that it serves as a constituent unit of an entity mention.

[0136] Step S702: According to the probability that each constituent unit in the user's question serves as the starting unit of an entity mention, the probability that it serves as the ending unit of an entity mention, and the probability that it serves as a constituent unit of an entity mention, determine the probability that any consecutive constituent units in the user's question serve as an entity mention.

[0137] Step S703: Screen out M consecutive constituent units according to the probability that any consecutive constituent units in the user's question serve as an entity mention and generate M predicted results of entity mentions.

[0138] In a specific embodiment of the present invention, the specific process of obtaining the predicted results of M entity mentions in the user's question can be as follows:

[0139] Input: Newly encoded representation of the user's question, a q_len×h-dimensional real number M q ' matrix;

[0140] Output: M predicted results of entity mentions in the user's question (consecutive constituent units, probability values).

[0141] Processing process:

[0142] 1) For 0 <= i <= q_len - 1, calculate the probability p s (i) that the i-th constituent unit in the question (for example, the i-th character in the above example) serves as the starting unit of an entity mention. Specifically, through a preset neural network (which can be a fully connected neural network), the vector corresponding to each constituent unit is converted into a probability value, where the fully connected neural network is, for example, a 1-layer fully connected network M q '×W s +b s , where W s is an h×1 matrix and b s is a real number;

[0143] 2) For 0 <= i <= q_len - 1, calculate the probability p that the i-th constituent unit in the question (for example, the i-th character in the above example) serves as the ending unit of an entity mentione (i), specifically, through a preset neural network (which can be a fully connected neural network), the vector corresponding to each constituent unit is converted into a probability value, where the fully connected neural network is, for example, a 1-layer fully connected network M q ’×W e +b e , where W e is an h×1 matrix, and b e is a real number;

[0144] 3) For 0 <= i <= q_len - 1, calculate the probability p m (i) that the i-th constituent unit (such as the i-th character in the above example) in the question sentence is an entity mention constituent unit. Specifically, through a preset neural network (which can be a fully connected neural network), the vector corresponding to each constituent unit is converted into a probability value, where the fully connected neural network is, for example, a 1-layer fully connected network M q ’×W m +b m , where W m is an h×1 matrix, and b m is a real number;

[0145] 4) For 0 <= i <= j <= q_len - 1, calculate the probability p([i,j]) that any consecutive constituent units [i,j] (such as the interval between the i-th and j-th characters in the above example) in the question sentence are entity mentions. Specifically: this probability = sigmoid(p s (i)+p e (j)+sum i<=t<=j (p m (t)));

[0146] 5) Select the top M consecutive constituent units as entity mention candidates according to the probability p([i,j]);

[0147] For example, for the question sentence "What awards has A won?", calculate the probabilities for consecutive constituent units such as "A", "has won", "won", "which", "awards", etc., and select the M consecutive constituent units with the highest probabilities and their corresponding probability values, such as ("A", 0.6), ("awards", 0.3), etc.

[0148] In a specific embodiment of the present invention, the specific process of the above step S107 of respectively screening out the N entities with the highest matching degree from all entities in the knowledge graph for each of the consecutive constituent units through a matching algorithm can be as follows:

[0149] Input: M entity mention prediction results (consecutive constituent units, probability values) of the user's question sentence;

[0150] Output: For each entity mention prediction result in the user's question sentence, return N candidate entities in the knowledge graph.

[0151] Recall process:

[0152] For each consecutive constituent unit in the entity mention prediction result m, use a certain existing matching method to perform fuzzy matching with each entity in the knowledge graph respectively, and calculate the matching score f;

[0153] For example, when calculating f based on the edit distance between the entity mention string and the entity name string, the edit distance matching score f between the entity mention "A" and the entity "A" (tennis player or singer) in the knowledge graph is 0, and the edit distance matching score f between the entity mention "A" and the entity "C" (host) in the knowledge graph is 1;

[0154] According to the matching score f, select the N most matching candidate entities from the knowledge graph;

[0155] For example, when calculating the matching score f based on the edit distance between the entity mention string and the entity name string, the smaller f is, the more matching it is. Compared with entity "C", entity "A" in the knowledge graph is more matching with the entity mention "A".

[0156] In an embodiment of the present invention, the encoded representation of the consecutive constituent units in the above step S108 can be specifically generated by the following steps:

[0157] For each of the consecutive constituent units, calculate the mean value of the corresponding encoded vectors of each constituent unit in the consecutive constituent unit in the new encoded representation of the user's question sentence respectively, and obtain the encoded representation of each of the consecutive constituent units.

[0158] Figure 8 It is a flowchart for determining the entity linking result of the user's question sentence in an embodiment of the present invention. As Figure 8 shown, in an embodiment of the present invention, the above step S108 of obtaining the entity linking result of the user's question sentence according to the probability corresponding to each of the consecutive constituent units being an entity mention and the entity with the highest probability among the N entities specifically includes step S801 and step S802.

[0159] Step S801, for each of the consecutive constituent units, multiply the probability corresponding to the consecutive constituent unit being an entity mention by the probability value of the entity with the highest probability among the N entities corresponding to the consecutive constituent unit, and obtain the product result corresponding to the consecutive constituent unit.

[0160] Step S802, determine the entity linking result of the user's question sentence according to the product result corresponding to each of the consecutive constituent units.

[0161] In a specific embodiment of the present invention, in this step, it is specifically possible to first determine the largest product result among the product results corresponding to each of the continuous constituent units, and use the continuous constituent units corresponding to the largest product result and the entity with the highest probability as the entity linking result of the user's question sentence.

[0162] In a specific embodiment of the present invention, the specific process of the above step S108 may be as follows:

[0163] Input: The new encoded representation q_len×h-dimensional real number M of the user's question sentence q ’ matrix, the predicted results of M entity mentions of the user's question sentence, N knowledge graph candidate entities corresponding to each entity mention prediction result, and the background knowledge encoded representation of each entity in the knowledge graph, that is, the h-dimensional vector;

[0164] Output: The entity linking result (entity mention, candidate entity) corresponding to the user's question sentence;

[0165] Calculation process:

[0166] 1) For the continuous constituent units in each entity mention prediction result m, according to M q ’, calculate the encoded representation of the continuous constituent units corresponding to m, which is equal to the bitwise average of the encoded vectors of all the constituent units included in the continuous constituent units;

[0167] 2) For each entity mention result m, query the background knowledge encoded representation of each entity in the knowledge graph to obtain the background knowledge encoded representation of each entity among the N entities corresponding to m;

[0168] 3) For each entity mention result m and its N knowledge graph candidate entities, calculate the inner product of the encoded representation of m and the encoded representation of the candidate entity respectively, and calculate the softmax normalization to obtain the probability distribution of the N candidate entities, and select the top 1 candidate entity according to this probability to form M sets (continuous constituent units, top 1 entity);

[0169] 4) For each set in the M sets, calculate the product of the probability that the continuous constituent units correspond to the entity mention and the probability of its top 1 entity, and filter out the sets where the probability product <Theta, where Theta is the probability threshold, and the remaining sets are used as the output entity linking result. Among them, the continuous constituent units in the remaining sets are used as entity mentions, and the top 1 entity in the remaining sets is used as the candidate entity. Thus, the entity linking result is a set of (entity mention, candidate entity).

[0170] In an embodiment of the present invention, the training process of the neural network in the above step S106 is as follows:

[0171] A training set composed of the correct entity mentions of the given user questions and the corresponding correct linked entities;

[0172] Calculate the questions in which each correct linked entity has appeared, specifically equal to the set of questions where the correct entity mentions corresponding to the correct linked entity are located;

[0173] When performing the steps included in the above prediction, in the step S103 of knowledge graph entity empirical knowledge encoding selection, when processing a question in the training set, remove the question from the questions in which the candidate entity has appeared;

[0174] Calculate the loss value, which is equal to the sum of the cross-entropy loss of the correct entity mention prediction result and the log-likelihood loss of the correct linked entity;

[0175] Perform gradient backpropagation of the neural network based on the loss value to realize the training of the neural network.

[0176] As can be seen from the above embodiments, the present invention at least achieves the following beneficial effects:

[0177] The present invention uses the questions in which the entity has appeared to form the empirical knowledge of entity linking, with low acquisition cost, and at the same time is more homogeneous with the user questions, which can effectively improve the effect of entity mention extraction and entity disambiguation.

[0178] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0179] Based on the same inventive concept, the embodiment of the present invention also provides a knowledge graph question and answer question entity linking device, which can be used to implement the knowledge graph question and answer question entity linking method described in the above embodiments, as described in the following embodiments. Since the principle of solving problems by the knowledge graph question and answer question entity linking device is similar to that of the knowledge graph question and answer question entity linking method, the embodiments of the knowledge graph question and answer question entity linking device can refer to the embodiments of the knowledge graph question and answer question entity linking method, and the repeated parts will not be described again. As used below, the term "unit" or "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0180] Figure 9 is the structural block diagram of the knowledge graph question and answer question entity linking device according to the embodiment of the present invention, as Figure 9As shown in the figure, in an embodiment of the present invention, the knowledge graph question-answering question entity linking device of the present invention includes:

[0181] A user question encoding module 1, configured to encode a user question to obtain an encoded representation of the user question;

[0182] An encoded representation acquisition module 2, configured to obtain an encoded representation of the entity description corresponding to each entity in the knowledge graph and an encoded representation of the entity empirical knowledge corresponding to each entity;

[0183] An empirical knowledge encoded representation generation module 3 related to the user question, configured to generate an encoded representation of the empirical knowledge related to the user question corresponding to each entity in the knowledge graph according to the encoded representation of the user question and the encoded representation of the entity empirical knowledge corresponding to each entity in the knowledge graph;

[0184] A background knowledge encoded representation generation module 4, configured to fuse the encoded representation of the entity description corresponding to each entity and the encoded representation of the empirical knowledge related to the user question to obtain an encoded representation of the background knowledge corresponding to each entity;

[0185] A new user question encoded representation generation module 5, configured to generate a new encoded representation of the user question according to the encoded representation of the background knowledge corresponding to each entity and the encoded representation of the user question;

[0186] An entity mention prediction result generation module 6, configured to obtain M entity mention prediction results of the user question according to the new encoded representation of the user question and a preset neural network, where each of the entity mention prediction results includes: consecutive constituent units in the user question and the probability that the consecutive constituent units are entity mentions, and M is an integer greater than 0;

[0187] An entity matching module 7, configured to respectively screen out the N entities with the highest matching degree from all entities in the knowledge graph for each of the consecutive constituent units through a matching algorithm, where N is an integer greater than 0;

[0188] An entity linking result generation module 8, configured to respectively calculate the inner product of the encoded representation of each consecutive constituent unit and the encoded representation of the background knowledge of each of the N entities corresponding to the consecutive constituent unit, perform normalization processing on the calculated inner product to obtain a probability distribution of the N entities corresponding to the consecutive constituent unit, and determine the entity with the highest probability among the N entities corresponding to the consecutive constituent unit according to the probability distribution; according to the probability that each of the consecutive constituent units is an entity mention and the entity with the highest probability among the N entities, obtain the entity linking result of the user question.

[0189] In an embodiment of the present invention, the knowledge graph question-answering question entity linking device of the present invention further includes:

[0190] A string splicing module for splicing the entity name string and the entity description string corresponding to each entity in the knowledge graph to obtain a spliced string;

[0191] An encoding representation generation module for entity descriptions, which performs vector encoding on the spliced string corresponding to each entity to obtain the encoding representation of the entity description corresponding to each entity.

[0192] In an embodiment of the present invention, the entity empirical knowledge includes: questions containing entities; the knowledge graph question-answering question entity linking device of the present invention further includes:

[0193] A question information acquisition module for acquiring all questions containing entities corresponding to each entity in the knowledge graph and the start position and end position of the entity in each question containing the entity;

[0194] An encoding representation generation module for entity empirical knowledge, which, for each question containing an entity, first performs vector encoding on the string of the question containing the entity to obtain the encoding vectors of each constituent unit in the string of the question containing the entity, and then determines all constituent units between the start position and the end position in the question containing the entity, and calculates the mean value of the encoding vectors of these constituent units bit by bit to obtain the mean value result. The mean value result corresponding to each question containing the entity is an encoding representation of an entity empirical knowledge corresponding to the entity in the question containing the entity.

[0195] In an embodiment of the present invention, the user question encoding module 1 specifically includes:

[0196] An encoding unit for inputting the string of the user question into an encoder, and the encoder slices the string of the user question into multiple units and generates the encoding vector corresponding to each unit;

[0197] A user question encoding matrix generation unit for vertically splicing the encoding vectors corresponding to each unit to obtain a user question encoding matrix.

[0198] In an embodiment of the present invention, the empirical knowledge encoding representation generation module 3 related to the user question specifically includes:

[0199] An entity empirical knowledge encoding matrix generation unit for vertically splicing the encoding representations of all entity empirical knowledge corresponding to each entity in the knowledge graph to obtain an entity empirical knowledge encoding matrix corresponding to each entity;

[0200] The first calculation unit is configured to, for each entity in the knowledge graph, first calculate the product of the user question encoding matrix and the transposed matrix of the entity's empirical knowledge encoding matrix corresponding to the entity to obtain a first product matrix, then sum the rows of the first product matrix to obtain a first weight matrix, and finally calculate the product of the first weight matrix and the entity's empirical knowledge encoding matrix corresponding to the entity to obtain an empirical knowledge encoding representation related to the user question corresponding to the entity.

[0201] In an embodiment of the present invention, the user question new encoding representation generation module 5 specifically includes:

[0202] The background knowledge encoding matrix generation unit is configured to vertically splice the background knowledge encoding representations of all entities in the knowledge graph to obtain a background knowledge encoding matrix;

[0203] The second calculation unit is configured to calculate the product of the user question encoding matrix and the transposed matrix of the background knowledge encoding matrix to obtain a second product matrix, then perform column normalization on the second product matrix to obtain a second weight matrix, calculate the product of the second weight matrix and the background knowledge encoding matrix, and add the product to the user question encoding matrix bit by bit to obtain a new encoding representation of the user question.

[0204] In an embodiment of the present invention, the entity mention prediction result generation module 6 specifically includes:

[0205] The probability determination unit is configured to respectively determine the probability of each constituent unit in the user question as the starting unit of an entity mention, the probability of being the ending unit of an entity mention, and the probability of being a constituent unit of an entity mention according to the encoding vector corresponding to each constituent unit in the user question in the new encoding representation of the user question and a preset neural network;

[0206] The probability determination unit as an entity mention is configured to determine the probability of any continuous constituent units in the user question as an entity mention according to the probability of each constituent unit in the user question as the starting unit of an entity mention, the probability of being the ending unit of an entity mention, and the probability of being a constituent unit of an entity mention;

[0207] The screening unit is configured to screen out M continuous constituent units according to the probability of any continuous constituent units in the user question as an entity mention and generate M entity mention prediction results.

[0208] In an embodiment of the present invention, the knowledge graph question and answer question entity linking device of the present invention further includes:

[0209] The encoding representation generation module for consecutive constituent units is configured to, for each of the consecutive constituent units, calculate the bitwise mean of the encoding vectors corresponding to each constituent unit in the consecutive constituent units in the new encoding representation of the user question, respectively obtaining the encoding representation of each of the consecutive constituent units.

[0210] In an embodiment of the present invention, the entity link result generation module 8 specifically includes:

[0211] The third calculation unit is configured to, for each of the consecutive constituent units, multiply the probability corresponding to the consecutive constituent unit being an entity mention by the probability value of the entity with the highest probability among the N entities corresponding to the consecutive constituent unit, obtaining the product result corresponding to the consecutive constituent unit;

[0212] The result determination unit is configured to determine the entity link result of the user question according to the product result corresponding to each of the consecutive constituent units.

[0213] To achieve the above object, according to another aspect of the present application, a computer device is further provided. As Figure 10 shown, the computer device includes a memory, a processor, a communication interface, and a communication bus. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, the steps in the method of the above embodiment are implemented.

[0214] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or combinations of the above types of chips.

[0215] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and units, such as the program units corresponding to the above method embodiments of the present invention. The processor executes various functional applications and data processing of works by running the non-transitory software programs, instructions, and modules stored in the memory, that is, implementing the method in the above method embodiments.

[0216] The memory may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function. The data storage area may store data created by the processor and the like. In addition, the memory may include high-speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0217] The one or more units are stored in the memory and, when executed by the processor, perform the methods in the above embodiments.

[0218] Specific details of the above computer device may be understood by referring to the corresponding relevant descriptions and effects in the above embodiments, and will not be elaborated here.

[0219] To achieve the above object, according to another aspect of the present application, there is also provided a computer-readable storage medium storing a computer program, and when the computer program is executed in a computer processor, it implements the steps in the above knowledge graph question-answering question entity linking method. Those skilled in the art can understand that to implement all or part of the processes in the above method embodiments, it can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium, and when the program is executed, it may include the processes of the above method embodiments. Among them, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (abbreviation: HDD), or a solid-state drive (SSD), etc.; the storage medium may also include a combination of the above types of memories.

[0220] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program code executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.

[0221] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for entity linking of knowledge graph question-and-answer questions, characterized in that, it includes: Concatenate the entity name string and entity description string corresponding to each entity in the knowledge graph to obtain a concatenated string; Perform vector encoding on the concatenated string corresponding to each entity to obtain the encoded representation of the entity description corresponding to each entity; Obtain all questions containing entities corresponding to each entity in the knowledge graph, as well as the start position and end position of the entity in each question containing the entity; for each question containing the entity, first perform vector encoding on the string of the question containing the entity to obtain the encoded vectors of each constituent unit in the string of the question containing the entity, then determine all the constituent units between the start position and the end position in the question containing the entity, and calculate the mean value of these constituent unit encoded vectors bit by bit to obtain the mean value result. The mean value result corresponding to each question containing the entity is the encoded representation of an entity empirical knowledge corresponding to the entity in the question containing the entity; Encode the user question to obtain the encoded representation of the user question; Obtain the encoded representation of the entity description corresponding to each entity in the knowledge graph and the encoded representation of the entity empirical knowledge corresponding to each entity; Generate the encoded representation of the empirical knowledge related to the user question corresponding to each entity in the knowledge graph according to the encoded representation of the user question and the encoded representation of the entity empirical knowledge corresponding to each entity in the knowledge graph; Fuse the encoded representation of the entity description corresponding to each entity and the encoded representation of the empirical knowledge related to the user question to obtain the encoded representation of the background knowledge corresponding to each entity; Generate a new encoded representation of the user question according to the encoded representation of the background knowledge corresponding to each entity and the encoded representation of the user question; Obtain M entity mention prediction results of the user question according to the new encoded representation of the user question and a preset neural network, where each entity mention prediction result includes: consecutive constituent units in the user question and the probability that the consecutive constituent units are entity mentions, and M is an integer greater than 0; For each of the consecutive constituent units, screen out the N entities with the highest matching degree from all entities in the knowledge graph through a matching algorithm, where N is an integer greater than 0; For each of the consecutive constituent units, calculate the inner product of the encoded representation of the consecutive constituent unit and the background knowledge encoded representation of each of the N entities corresponding to the consecutive constituent unit, perform normalization processing on the calculated inner product to obtain the probability distribution of the N entities corresponding to the consecutive constituent unit, and determine the entity with the highest probability among the N entities corresponding to the consecutive constituent unit according to the probability distribution; according to the probability that each of the consecutive constituent units is an entity mention and the entity with the highest probability among the N entities, obtain the entity linking result of the user question.

2. The method for entity linking of knowledge graph question-and-answer questions according to claim 1, characterized in that, Encoding the user's question to obtain an encoded representation of the user's question, specifically including: Inputting the string of the user's question into an encoder, which splits the string of the user's question into multiple units and generates a corresponding encoded vector for each unit; Vertically concatenating the encoded vectors corresponding to each unit to obtain a user question encoding matrix.

3. The method for entity linking of knowledge graph question and answer questions according to claim 2, characterized in that generating an encoded representation of the empirical knowledge related to the user's question for each entity in the knowledge graph according to the encoded representation of the user's question and the encoded representation of the empirical knowledge of each entity in the knowledge graph, specifically including: Vertically concatenating the encoded representations of all the empirical knowledge of each entity in the knowledge graph to obtain an encoded matrix of the empirical knowledge of each entity; For each entity in the knowledge graph, first calculate the product of the user question encoding matrix and the transposed matrix of the encoded matrix of the empirical knowledge corresponding to the entity to obtain a first product matrix, then sum each row of the first product matrix to obtain a first weight matrix, and finally calculate the product of the first weight matrix and the encoded matrix of the empirical knowledge corresponding to the entity to obtain an encoded representation of the empirical knowledge related to the user's question corresponding to the entity.

4. The method for entity linking of knowledge graph question and answer questions according to claim 2, characterized in that generating a new encoded representation of the user's question according to the encoded representation of the background knowledge of each entity and the encoded representation of the user's question, specifically including: Vertically concatenating the encoded representations of the background knowledge of all entities in the knowledge graph to obtain a background knowledge encoding matrix; Calculating the product of the user question encoding matrix and the transposed matrix of the background knowledge encoding matrix to obtain a second product matrix, then normalizing each column of the second product matrix to obtain a second weight matrix, calculating the product of the second weight matrix and the background knowledge encoding matrix, and adding the product to the user question encoding matrix bit by bit to obtain a new encoded representation of the user's question.

5. The method for entity linking of knowledge graph question and answer questions according to claim 1, characterized in that obtaining M entity mention prediction results of the user's question according to the new encoded representation of the user's question and a preset neural network, specifically including: According to the encoded vector corresponding to each constituent unit in the user's question in the new encoded representation of the user's question and a preset neural network, respectively determining the probability of each constituent unit in the user's question as the starting unit of an entity mention, the probability of being the ending unit of an entity mention, and the probability of being a constituent unit of an entity mention; According to the probability of each constituent unit in the user's question as the starting unit of an entity mention, the probability of being the ending unit of an entity mention, and the probability of being a constituent unit of an entity mention, determining the probability of any continuous constituent units in the user's question as an entity mention; Filter out M consecutive constituent units according to the probability of any consecutive constituent units in the user's question being mentioned as entities, and generate M entity mention prediction results.

6. The method for entity linking of knowledge graph question and answer questions according to claim 1, wherein, it further includes: For each of the consecutive constituent units, calculate the mean value of the corresponding encoding vectors of each constituent unit in the consecutive constituent units in the new encoding representation of the user's question, respectively, to obtain the encoding representation of each of the consecutive constituent units.

7. The method for entity linking of knowledge graph question and answer questions according to claim 1, wherein, The step of obtaining the entity linking result of the user's question according to the probability of each of the consecutive constituent units being mentioned as an entity and the entity with the highest probability among the N entities specifically includes: For each of the consecutive constituent units, multiply the probability of the consecutive constituent unit being mentioned as an entity by the probability value of the entity with the highest probability among the N entities corresponding to the consecutive constituent unit, to obtain the product result corresponding to the consecutive constituent unit; Determine the entity linking result of the user's question according to the product result corresponding to each of the consecutive constituent units.

8. An entity linking device for knowledge graph question and answer questions, wherein, it includes: A string splicing module, configured to splice the entity name string and entity description string corresponding to each entity in the knowledge graph to obtain a spliced string; An encoding representation generation module for entity description, configured to perform vector encoding on the spliced string corresponding to each entity to obtain the encoding representation of the entity description corresponding to each entity; A question information acquisition module, configured to acquire all questions containing entities corresponding to each entity in the knowledge graph, and the start position and end position of the entity in each question containing the entity; An encoding representation generation module for entity empirical knowledge, configured to, for each question containing an entity, first perform vector encoding on the string of the question containing the entity to obtain the encoding vectors of each constituent unit in the string of the question containing the entity, then determine all constituent units between the start position and the end position in the question containing the entity, and calculate the mean value of these constituent unit encoding vectors to obtain the mean value result. The mean value result corresponding to each question containing an entity is an encoding representation of an entity empirical knowledge of the entity corresponding to the question containing the entity; A user question encoding module, configured to encode the user question to obtain the encoding representation of the user question; An encoding representation acquisition module, configured to acquire the encoding representation of the entity description corresponding to each entity in the knowledge graph and the encoding representation of the entity empirical knowledge corresponding to each entity; An empirical knowledge encoding representation generation module related to the user question, configured to generate the encoding representation of the empirical knowledge related to the user question corresponding to each entity in the knowledge graph according to the encoding representation of the user question and the encoding representation of the entity empirical knowledge corresponding to each entity in the knowledge graph. The background knowledge encoding representation generation module is used to fuse the encoding representations of the entity descriptions corresponding to each entity and the encoding representations of the empirical knowledge related to the user question, so as to obtain the background knowledge encoding representation corresponding to each entity; The user question new encoding representation generation module is used to generate a new encoding representation of the user question according to the background knowledge encoding representation corresponding to each entity and the encoding representation of the user question; The entity mention prediction result generation module is used to obtain M entity mention prediction results of the user question according to the new encoding representation of the user question and a preset neural network, where each entity mention prediction result includes: consecutive constituent units in the user question and the probability that the consecutive constituent units are entity mentions, and M is an integer greater than 0; The entity matching module is used to screen out the N entities with the highest matching degree from all entities in the knowledge graph for each of the consecutive constituent units through a matching algorithm, where N is an integer greater than 0; The entity linking result generation module is used to calculate the inner product of the encoding representation of each consecutive constituent unit and the background knowledge encoding representation of each of the N entities corresponding to the consecutive constituent unit, perform normalization processing on the calculated inner product to obtain the probability distribution of the N entities corresponding to the consecutive constituent unit, and determine the entity with the highest probability among the N entities corresponding to the consecutive constituent unit according to the probability distribution; according to the probability that each consecutive constituent unit is an entity mention and the entity with the highest probability among the N entities, obtain the entity linking result of the user question.

9. The knowledge graph question-answering question entity linking device according to claim 8, wherein, the user question encoding module specifically includes: The encoding unit is used to input the string of the user question into an encoder, and the encoder splits the string of the user question into multiple units and generates the encoding vector corresponding to each unit; The user question encoding matrix generation unit is used to vertically splice the encoding vectors corresponding to each unit to obtain a user question encoding matrix.

10. The knowledge graph question-answering question entity linking device according to claim 9, wherein, the empirical knowledge encoding representation generation module related to the user question specifically includes: The entity empirical knowledge encoding matrix generation unit is used to vertically splice the encoding representations of all entity empirical knowledge corresponding to each entity in the knowledge graph to obtain the entity empirical knowledge encoding matrix corresponding to each entity; The first calculation unit is used to calculate the product of the user question encoding matrix and the transposed matrix of the entity empirical knowledge encoding matrix corresponding to the entity for each entity in the knowledge graph respectively to obtain a first product matrix, then sum each row of the first product matrix to obtain a first weight matrix, and finally calculate the product of the first weight matrix and the entity empirical knowledge encoding matrix corresponding to the entity to obtain the empirical knowledge encoding representation related to the user question corresponding to the entity.

11. The knowledge graph question-answering question entity linking device according to claim 9, characterized in that, the user question new encoding representation generation module specifically includes: a background knowledge encoding matrix generation unit, configured to vertically splice the background knowledge encoding representations of all entities in the knowledge graph to obtain a background knowledge encoding matrix; a second calculation unit, configured to calculate the product of the user question encoding matrix and the transposed matrix of the background knowledge encoding matrix to obtain a second product matrix, then perform column-wise normalization processing on the second product matrix to obtain a second weight matrix, calculate the product of the second weight matrix and the background knowledge encoding matrix, and add the product to the user question encoding matrix bit by bit to obtain the new encoding representation of the user question.

12. The knowledge graph question-answering question entity linking device according to claim 8, characterized in that, the entity mention prediction result generation module specifically includes: a probability determination unit, configured to respectively determine the probability of each constituent unit in the user question as the starting unit of an entity mention, the probability of being the ending unit of an entity mention, and the probability of being a constituent unit of an entity mention according to the encoding vector corresponding to each constituent unit in the user question in the new encoding representation of the user question and a preset neural network; a probability determination unit for entity mention, configured to determine the probability of any continuous constituent units in the user question as an entity mention according to the probability of each constituent unit in the user question as the starting unit of an entity mention, the probability of being the ending unit of an entity mention, and the probability of being a constituent unit of an entity mention; a screening unit, configured to screen out M continuous constituent units according to the probability of any continuous constituent units in the user question as an entity mention and generate M entity mention prediction results.

13. The knowledge graph question-answering question entity linking device according to claim 8, characterized in that, it further includes: a continuous constituent unit encoding representation generation module, configured to, for each of the continuous constituent units, calculate the mean value bit by bit of the encoding vectors corresponding to each constituent unit in the continuous constituent units in the new encoding representation of the user question to obtain the encoding representation of each of the continuous constituent units respectively.

14. The knowledge graph question-answering question entity linking device according to claim 8, characterized in that, the entity linking result generation module specifically includes: a third calculation unit, configured to, for each of the continuous constituent units, multiply the probability of the continuous constituent unit being an entity mention by the probability value of the entity with the highest probability among the N entities corresponding to the continuous constituent unit to obtain a product result corresponding to the continuous constituent unit; a result determination unit, configured to determine the entity linking result of the user question according to the product result corresponding to each of the continuous constituent units respectively.

15. A computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

16. A computer-readable storage medium storing a computer program, wherein, when the computer program is executed in a computer processor, it implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for obtaining meteorological service knowledge

    CN113254473A

  • Named entity disambiguation using entity distance in a knowledge graph

    US20200342055A1