Question-answering method and system

By identifying and forming a list of entity pairs and a set of alternative relationships, and calculating the probability distribution similarity, the problem that existing question-answering systems are unable to answer multiple entities and missing relationships is solved, and the answering ability of question-answering systems is improved, especially in the application of gaming.

CN115129834BActive Publication Date: 2025-09-16NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210549895.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2025-09-16
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

Existing knowledge graph-based question-answering systems cannot effectively answer multi-entity questions and missing relationship questions, especially in the gaming field, they cannot provide effective answers for new game players.

Method used

By identifying the entities in the input question, obtaining a list of entity pairs, and forming an alternative relationship set, the probability distribution similarity between the input question and the known question on the alternative relationship set is calculated to determine the output answer.

Benefits of technology

It can effectively answer questions about multiple entities and missing entity relationships, improve the comprehensiveness of the question-answering system, and especially provide players with accurate answers in the gaming field to reduce churn.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115129834B_ABST
    Figure CN115129834B_ABST
Patent Text Reader

Abstract

The present invention discloses a question-answering method, comprising: identifying entities in an input question and obtaining a list of entity pairs; obtaining alternative relationships for each entity pair in the entity pair list to form an alternative relationship set corresponding to the entity pair list; obtaining a probability distribution of the input question on the alternative relationship set based on the input question and the alternative relationship set; obtaining a probability distribution of known questions containing any entity pair in the entity pair list on the alternative relationship set; calculating the similarity of the probability distributions of the input question and the known questions on the alternative relationship set, and determining an output answer corresponding to the input question based on the similarity of the probability distributions. This method is a question-answering method based on probability distribution and probability distribution similarity, which solves the technical problem in the prior art of being unable to answer multi-entity questions and missing relationship questions, and improves the comprehensiveness of question-answering technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a question-answering method, system, electronic device, and computer-readable storage medium. Background Art

[0002] Question answering (QA) systems are an advanced form of information retrieval systems. With the rapid development of artificial intelligence (AI), QA systems are able to provide more accurate and concise responses to user questions in natural language. They are widely used in a variety of fields, including gaming, navigation, and online teaching.

[0003] Knowledge Graph Based Question Answering (KGQA) is currently the mainstream question-answering system. However, knowledge graph (KG)-based question-answering systems have the following problems in practical applications: First, they can only answer questions involving a single entity and cannot answer questions involving multiple entities. Second, they can only answer questions involving entities that have relationships in the knowledge graph and cannot answer questions involving missing relationships. Summary of the Invention

[0004] The present invention provides a question-answering method and system to solve the technical problem that existing question-answering methods are unable to answer multi-entity questions and missing relationship questions.

[0005] An embodiment of the present invention provides a question-answering method, including:

[0006] Identify entities in the input question and obtain a list of entity pairs;

[0007] Obtaining candidate relationships for each entity pair in the entity pair list to form a candidate relationship set corresponding to the entity pair list;

[0008] According to the input question and the candidate relationship set, obtaining a probability distribution of the input question on the candidate relationship set;

[0009] Obtaining a probability distribution of a known problem containing any entity pair in the entity pair list on the candidate relationship set;

[0010] The similarity between the probability distributions of the input question and the known question on the candidate relationship set is calculated, and the output answer corresponding to the input question is determined according to the similarity of the probability distributions.

[0011] Optionally, identifying entities in the input question and obtaining a list of entity pairs includes:

[0012] Identify entities in the input question using an entity recognition model;

[0013] The entities in the input question are grouped into pairs to form the entity pair list.

[0014] Optionally, the method for obtaining the entity recognition model includes:

[0015] The entities in the knowledge graph are used as training data and provided to the initial entity recognition model for training;

[0016] The entity recognition model that meets the predetermined standard after training is used as the entity recognition model for actual use.

[0017] Optionally, obtaining the alternative relationship of each entity pair in the entity pair list includes: taking the relationship between the entity pairs in the knowledge graph as the alternative relationship.

[0018] Optionally, obtaining the alternative relationship of each entity pair in the entity pair list further includes: taking the relationship between the type pairs corresponding to the entity pairs in the knowledge graph as the alternative relationship.

[0019] Optionally, obtaining, based on the input question and the candidate relationship set, a probability distribution of the input question on the candidate relationship set includes:

[0020] Obtaining a score of the input question on each candidate relation in the candidate relation set through a relation extraction model;

[0021] According to the score of the input question on each candidate relation in the candidate relation set, a probability distribution of the input question on the candidate relation set is formed.

[0022] Optionally, the method for obtaining the relationship extraction model includes:

[0023] The known questions in the question-answer database and the relationship descriptions corresponding to the entity pairs in the known questions are used as training data and provided to the initial relationship extraction model for training;

[0024] The relation extraction model that meets the predetermined standard after training is used as the relation extraction model for actual use.

[0025] Optionally, obtaining the score of the input question on each candidate relation in the candidate relation set through the relation extraction model includes:

[0026] Mapping each candidate relationship in the candidate relationship set into a relationship description;

[0027] Obtaining, by means of the relation extraction model, a probability that the input question is correct in the relation description of each candidate relation;

[0028] The probability that the input question is correct in the relation description of each candidate relation is used as the score of the input question in each candidate relation.

[0029] Optionally, mapping each candidate relationship in the candidate relationship set to a relationship description includes: obtaining a relationship description of each candidate relationship in the candidate relationship set according to a relationship and relationship description list.

[0030] Optionally, obtaining a probability distribution of known issues involving any one entity pair in the entity pair list on the candidate relationship set includes:

[0031] Obtain all known questions containing any entity pair in the entity pair list from the question-answer database;

[0032] The probability distribution of each known question on the candidate relationship set is obtained through the relationship extraction model.

[0033] Optionally, calculating the similarity between the probability distributions of the input question and the known question on the candidate relationship set, and determining the output answer corresponding to the input question based on the similarity includes:

[0034] Calculate the JS divergence value of the probability distribution of the input question on the candidate relation set and the probability distribution of the known question on the candidate relation set;

[0035] Determine the similarity between the input question and the known question according to the JS divergence value;

[0036] An output answer corresponding to the input question is determined based on the similarity between the input question and the known question.

[0037] Optionally, determining the similarity between the input question and the known question according to the JS divergence value includes:

[0038] Comparing whether the JS divergence value is less than a preset similarity threshold;

[0039] According to the comparison result, it is determined whether the input question is similar to the known question, including: if so, the input question is similar to the known question; if not, the input question is not similar to the known question.

[0040] Optionally, the determining the similarity between the input question and the known question according to the JS divergence value further includes:

[0041] Comparing the sizes of the multiple JS divergence values;

[0042] Determining the known problem with the highest similarity to the input problem based on the comparison result includes: the smaller the JS divergence value, the higher the similarity between the input problem and the known problem.

[0043] Optionally, determining the output response corresponding to the input question based on the similarity between the input question and the known question includes: using the answer to the known question with the highest similarity to the input question as the output response corresponding to the input question.

[0044] The embodiment of the present invention further provides a question-answering system, comprising: an entity recognition unit, an alternative relationship acquisition unit, an input question probability distribution acquisition unit, a known question probability distribution acquisition unit, and a similarity calculation unit;

[0045] The entity recognition unit is used to identify entities in the input question and obtain an entity pair list;

[0046] The candidate relationship acquisition unit is configured to acquire a candidate relationship for each entity pair in the entity pair list to form a candidate relationship set corresponding to the entity pair list;

[0047] The input question probability distribution acquisition unit is configured to acquire a probability distribution of the input question on the candidate relationship set based on the input question and the candidate relationship set;

[0048] The known problem probability distribution acquisition unit is used to obtain the probability distribution of the known problem containing any one entity pair in the entity pair list on the candidate relationship set;

[0049] The similarity calculation unit is used to calculate the similarity between the probability distribution of the input question and the known question on the set of candidate relations, and determine the output answer corresponding to the input question based on the similarity of the probability distribution.

[0050] An embodiment of the present invention further provides an electronic device, comprising: a memory, a processor;

[0051] The memory is used to store one or more computer instructions;

[0052] The processor is configured to execute the one or more computer instructions to implement the above method.

[0053] An embodiment of the present invention further provides a computer-readable storage medium on which one or more computer instructions are stored. When the instructions are executed by a processor, the above method is executed.

[0054] Compared with the prior art, the question-answering method provided by the present invention includes: identifying entities in an input question and obtaining an entity pair list; obtaining alternative relationships for each entity pair in the entity pair list to form an alternative relationship set corresponding to the entity pair list; obtaining a probability distribution of the input question on the alternative relationship set based on the input question and the alternative relationship set; obtaining a probability distribution of a known question containing any entity pair in the entity pair list on the alternative relationship set; calculating the similarity between the probability distributions of the input question and the known question on the alternative relationship set, and determining the output answer corresponding to the input question based on the similarity of the probability distributions. This method obtains the entity pair list of the input question and the alternative relationship set corresponding to the entity pair list, obtains the probability distribution of the input question on the alternative relationship set, and the probability distribution of the known question on the alternative relationship set, further calculates the similarity between the probability distribution of the input question and the probability distribution of the known question, and determines the output answer to the input question based on the similarity. The question-answering method provided by this invention is based on probability distribution and probability distribution similarity calculation. It can obtain an output answer corresponding to the input question based on the similarity between the probability distribution of the input question and known questions on a set of candidate relationships. This solves the technical problem of the existing technology that cannot answer multi-entity questions and missing relationship questions, and improves the comprehensiveness of question-answering technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 This is an application system diagram of a question-answering method provided by an embodiment of the present invention;

[0056] Figure 2 This is an application system diagram of another question-answering method provided by an embodiment of the present invention;

[0057] Figure 3 is a flowchart of the question-answering method provided by the first embodiment of the present invention;

[0058] Figure 4 is a flowchart of a probability distribution acquisition method provided by the first embodiment of the present invention;

[0059] Figure 5 This is a flowchart of obtaining the probability distribution of a known question on a candidate relationship set provided by the first embodiment of the present invention;

[0060] Figure 6 This is a flowchart of determining an output response based on probability distribution similarity provided by the first embodiment of the present invention;

[0061] Figure 7 is a schematic structural diagram of a question-answering system provided by a second embodiment of the present invention;

[0062] Figure 8It is a schematic structural diagram of an electronic device provided by the third embodiment of the present invention. DETAILED DESCRIPTION

[0063] The following description sets forth numerous specific details to facilitate a thorough understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without departing from the scope of the present invention. Therefore, the present invention is not limited to the specific implementations disclosed below.

[0064] The following is an introduction to the terms involved in the embodiments of the present invention:

[0065] The question and answer refers to the technical process of using artificial intelligence technology to analyze and answer questions raised by users in natural language, and output the answers to the questions in natural language.

[0066] Question answering (QA) systems are systems used for question answering (QA), an advanced form of information retrieval system. They provide accurate and concise responses to natural language questions posed by users. They are widely used in various fields. For example, in gaming, different players have varying levels of familiarity with the game. As players become familiar with the game, they often raise many questions about gameplay. Using QA systems, players can quickly and accurately obtain answers to their questions, which is crucial for improving game retention.

[0067] The knowledge graph (KG) is a form of knowledge representation. It is a network formed by connecting knowledge. It is a graph that uses visualization technology to describe the knowledge development process and structural relationships. Knowledge is usually stored in triples, and the relationships between entities are modeled in the form of head entity-relationship-tail entity, where one triple represents a piece of knowledge.

[0068] The Knowledge Graph Based Question Answering (KGQA) system is a question-answering system that answers user questions based on the structured information of the knowledge graph. When a user enters a question, the system can obtain relevant information of the question and answer it through reasoning in the knowledge graph.

[0069] Artificial Intelligence (AI) is a branch of computer science that can generate intelligent machines that approach human intelligence. Research in this field primarily involves technologies such as robotics, speech recognition, and image recognition. AI analyzes and simulates human consciousness and thought processes to design AI robots that behave like humans. In individual areas of intelligence, such as computing, AI can even surpass human intelligence.

[0070] Knowledge graph-based question answering systems are the mainstream question answering methods available today. They utilize the structured information in knowledge graphs to infer and obtain relevant information and answers to questions. Knowledge graph-based question answering methods typically include the following steps:

[0071] First, entity recognition, identifies entities from the input question and determines the number of hops of question type data in the knowledge graph.

[0072] Second, relationship identification: Based on the structured information of the knowledge graph, the candidate relationships of the above entities are identified, and the candidate relationships are sorted to select the most likely relationship.

[0073] Third, subgraph recall, based on the identified entities and relationships mentioned above, outputs all subgraphs of entities and relationships.

[0074] Fourth, answer sorting: sort all subgraphs according to their candidate scores, select the subgraph with the highest score, and use its corresponding answer as the answer to the question.

[0075] Therefore, the question-answering method based on the knowledge graph is actually based on the input question. In the triple of the knowledge graph (head entity s-relation r-tail entity o), the head entity s is predicted first, and then the relationship r is predicted. If the head entity s and the relationship r both exist in the knowledge graph, the tail entity o is predicted based on the subgraph output by the head entity s and the relationship r, and the prediction result is used as the answer to the question.

[0076] The above-mentioned question-answering method based on knowledge graph can predict the answer to the question well, but there are two problems:

[0077] First, existing knowledge graph-based question-answering methods can only handle situations where one entity appears in the question and cannot make predictions for multi-entity questions.

[0078] Second, existing knowledge graph-based question-answering methods can only handle questions where entities have relationships in the knowledge graph, and cannot reason about answers to questions where relationships are missing.

[0079] However, in reality, a single question often contains multiple entities. Furthermore, since knowledge graphs are constantly evolving, missing entity relationships may occur. In such cases, the question-answering system often automatically responds with, "That's a great question! I'll research it." This fails to provide users with effective information or resolve their issues. This is especially true in the gaming sector, where players frequently ask numerous questions about new games. Existing question-answering methods are unable to effectively address questions involving multiple entities or missing entity relationships, hindering their understanding of the new game and potentially leading to player loss.

[0080] In response to the problems with the above-mentioned existing question-answering methods, this application provides a question-answering method that uses the probability distribution of the question in the relational space as a starting point, calculates the similarity between the probability distribution of the input question and the known questions, and obtains the output answer corresponding to the input question. It can effectively answer questions with multiple entities or missing entity relationships in the question, thereby improving the comprehensiveness of question-answering technology. The question-answering method provided by the present invention is applicable to any field requiring a question-answering system, and is particularly suitable for question-answering systems in the gaming field.

[0081] The question-answering method, system, electronic device, and computer-readable storage medium of the present invention are further described in detail below with reference to specific embodiments and accompanying drawings.

[0082] Figure 1 This is an application system diagram of a question-answering method provided by an embodiment of the present invention. Figure 1 As shown, the system includes a user terminal 101 and a server terminal 102. The user terminal 101 and the server terminal 102 are communicatively connected via a network. The user terminal 101 can be a touch terminal, such as a smart phone, tablet computer, personal digital assistant (PDA) and other devices; it can also be a computer terminal, such as a laptop computer, desktop computer and other devices, and can be one or more. The server terminal 102 is used to deploy the question-answering system provided by the present invention. The user inputs a question through the user terminal 101, and the question is transmitted to the server terminal 102 via the network. The server terminal 102 analyzes and answers the question, and transmits the answer to the question back to the user terminal 101 via the network. The user receives the answer to the question through the user terminal 101. The server terminal 102 can be a question-answering device for the user terminal 101. The user terminal 101 can be merged with the server terminal 102. The user directly inputs the question through the server terminal 102, and the server terminal 102 analyzes and answers the question. The user receives the answer to the question through the server terminal 102.

[0083] Figure 2This is an application system diagram of another question-answering method provided by an embodiment of the present invention. Figure 2 As shown, the application system includes a user terminal 201 and a server 202. The user terminal 201 can be a touch terminal, such as a smartphone, tablet computer, or personal digital assistant (PDA); it can also be a computer terminal, such as a laptop computer or desktop computer; or it can be any other device with voice or text transmission capabilities, and can be one or more. The server 202 is used to deploy the question-answering method provided by the present invention. A user enters a question through the user terminal 201, which is transmitted via the network to the server 202. The server 202 analyzes and answers the question and transmits the answer back to the user terminal 201 via the network. The user receives the answer to the question through the user terminal 201. The server 202 can be a standalone server that deploys the method provided by the present invention, or it can be a server cluster consisting of multiple servers, each of which deploys a module of the method provided by the present invention, such as an identification server or a computing server. Of course, the server 202 can also be a cloud server, on which the question-answering method provided by the present invention is deployed. The server 202 provides answers to questions for all users.

[0084] A first embodiment of the present invention provides a question-answering method.

[0085] Figure 3 This is a flow chart of the question-answering method provided in this embodiment. Figure 3 The question-answering method provided in this embodiment is described in detail. The embodiments described below are used to explain the technical solution of the present invention and are not intended to limit its actual use.

[0086] like Figure 3 As shown, the question-answering method provided in this embodiment includes the following steps:

[0087] Step S301: Identify entities in the input question and obtain a list of entity pairs.

[0088] The purpose of this step is to identify multiple entities in the user's input question and organize the identified entities into a list in the form of entity pairs.

[0089] An input question may include one entity or multiple entities. The entities in the input question may be identified by an entity recognition model.

[0090] The entity recognition model is a neural network model that can identify entities in the input problem. The neural network (NNs) is composed of a number of neurons and their parameters. It is a system that performs tasks by "learning" through a large number of examples and is usually not programmed using task-specific rules. For example, in image recognition, a neural network can learn the characteristics of a cat by analyzing example images labeled "cat" or "not cat", and use the learning results to identify whether other images contain cats. In the learning of the neural network, the characteristics of the cat are not directly input to the neural network. Instead, the example image labeled as a cat is input. Through iterative learning, the neural network will automatically generate characteristic information representing the cat based on the example image.

[0091] The entity recognition model provided in this embodiment uses entities existing in the knowledge graph as training data, which is provided to the initial entity recognition model for training; the entity recognition model that meets the predetermined standards after training is used as the entity recognition model for actual use.

[0092] That is to say, to obtain an entity recognition model, it is necessary to use the entities existing in the knowledge graph as training data for learning and training, and it is also necessary to test the recognition ability of the trained entity recognition model. Only entity recognition models that meet the predetermined standards can be used as the entity recognition model used in the question-answering method provided in this embodiment.

[0093] The predetermined standard provided in this embodiment is to be able to obtain valid entities in the input question, that is, entities existing in the knowledge graph.

[0094] After identifying the entities in the input question, they need to be grouped into pairs to form the entity pair list. For example, if the input question contains three entities (entity a, entity b, and entity c), pairing entities a, b, and c into pairs will yield entity pairs ab, ac, and bc. These pairs ab, ac, and bc will form the entity pair list corresponding to the input question.

[0095] If the relationship between these entity pairs in the knowledge graph is directional, the entity pair list includes the following entity pairs: entity pair ab, entity pair ba, entity pair ac, entity pair ca, entity pair bc, and entity pair cb.

[0096] Step S302 : obtaining candidate relationships of each entity pair in the entity pair list to form a candidate relationship set corresponding to the entity pair list.

[0097] The purpose of this step is to obtain the alternative relationship or alternative relationship group corresponding to each entity pair in the entity pair list, and combine the alternative relationship or alternative relationship group corresponding to each entity pair to form an alternative relationship set corresponding to the entity pair list.

[0098] The method provided in this embodiment for obtaining an alternative relationship or an alternative relationship group corresponding to an entity pair includes: using the relationship existing in the knowledge graph of the entity pair as an alternative relationship.

[0099] When a relationship exists between an entity pair in the knowledge graph, that relationship is used as an alternative relationship for the entity pair. For example, when a user plays a game, the input question contains the entity pair "game character" and "Ootengu." In the knowledge graph for that game, the relationship between "game character" and "Ootengu" is "example." Since the entity pair "game character-Ootengu" exists in the knowledge graph, "example" is used as an alternative relationship for that entity pair.

[0100] The method for obtaining alternative relationships or alternative relationship groups corresponding to entity pairs provided in this embodiment also includes: using the relationships existing in the knowledge graph of the type pairs corresponding to the entity pairs as alternative relationships.

[0101] When there is no relationship between an entity pair in the knowledge graph, the entity pair is expanded into a corresponding type pair, and the relationship group of the type pair in the knowledge graph is used as the alternative relationship group of the entity pair. For example: when a user plays a certain game, the input question contains the entity pair of "Deer Man" and "Lucky Cat", but in the knowledge graph of the game, there is no relationship between "Deer Man" and "Lucky Cat", so the entity pair of "Deer Man-Lucky Cat" is expanded to the type pair of "Character-Prop" (where "Deer Man" belongs to the character type and "Lucky Cat" belongs to the prop type). The relationships of the type pair "Character-Prop" in the knowledge graph are: "Applicable to", "Suitable for Carrying", and "Recommended Souls", so the alternative relationship group corresponding to the entity pair "Deer Man-Lucky Cat" is: "Applicable to", "Suitable for Carrying", and "Recommended Souls".

[0102] The entity pairs are expanded into type pairs, and the alternative relationship groups corresponding to the type pairs are used as the alternative relationship groups corresponding to the entity pairs. This solves the technical problem of being unable to answer questions when the entities are missing relationships.

[0103] Through the above method, one or more candidate relationships corresponding to each entity pair in the entity pair list are obtained, and these candidate relationships are combined to form a candidate relationship set corresponding to the entity pair list.

[0104] Step S303: Obtain the probability distribution of the input question on the candidate relationship set according to the input question and the candidate relationship set.

[0105] The purpose of this step is to obtain the probability distribution of the input question on the set of candidate relations obtained above.

[0106] The probability distribution is the correct probability distribution of the question on each candidate relation in the candidate relation set. First, the score of the input question on each candidate relation in the candidate relation set is obtained through the relation extraction model. Second, the scores of the input question on each candidate relation in the candidate relation set are combined to form the probability distribution of the input question on the candidate relation set.

[0107] The relation extraction model is a neural network model that can score the correctness probability of an input question on each candidate relation in a set of candidate relations.

[0108] The relationship extraction model provided in this embodiment uses known questions in the question and answer database and the relationship descriptions corresponding to the entities in the known questions as training data, which are provided to the initial relationship extraction model for training; the relationship extraction model that meets the predetermined standards after training is used as the relationship extraction model for actual use.

[0109] The question-and-answer database is a database that collects known questions and their answers, including known questions and corresponding relationship descriptions of entity pairs in the questions.

[0110] The relationship description is a language for describing the relationship between entity pairs, and the entity pair relationship and the entity pair relationship description have a one-to-one correspondence.

[0111] The relationship extraction model provided in this embodiment actually uses the known questions in the question-and-answer database and the relationship descriptions corresponding to the entity pairs in the known questions as training data in the input format of "[CLS] question [SEP] relationship description [SEP]" to train the initial relationship extraction model. The resulting neural network model can evaluate and score the correctness probability of questions and relationship descriptions. Therefore, in the actual use of the relationship extraction model, the data to be evaluated also needs to be in the input format of "[CLS] question [SEP] relationship description [SEP]".

[0112] Figure 4 This is a flow chart of the probability distribution acquisition method provided by this embodiment.

[0113] like Figure 4 As shown, the probability distribution acquisition method provided in this embodiment includes the following steps:

[0114] Step S303 - 1 : Map each candidate relationship in the candidate relationship set into a relationship description.

[0115] The candidate relation set is a set of candidate relations or candidate relation groups corresponding to all entity pairs in the input problem. Before performing a correct probability assessment, each candidate relation in the candidate relation set must first be mapped to a relation description.

[0116] An optional implementation provided by this embodiment is: according to the relationship and relationship description list, correspondingly obtaining the relationship description of each candidate relationship in the candidate relationship set.

[0117] The relationship and relationship description list is a data set that collects relationships and relationship descriptions. From the relationship and relationship description list, relationships can be mapped to relationship descriptions.

[0118] For example: When a user plays a game, he inputs the question "Can a deer boy bring a lucky cat?". From step S301, it can be seen that there is an entity pair in the input question, that is, the entity pair "deer boy-lucky cat". From step S302, it can be seen that the alternative relationship group corresponding to the entity pair is: "applicable to", "suitable for carrying", and "recommended Onmyoji". Since the input question only includes one entity pair, the alternative relationship set corresponding to the entity pair list of the input question is: "applicable to", "suitable for carrying", and "recommended Onmyoji". Each alternative relationship in the above alternative relationship set is mapped to the corresponding relationship description using the relationship and relationship description list. The mapped alternative relationship set is shown in Table 1:

[0119] Table 1 Alternative relationship set table after mapping

[0120]

[0121] Step S303 - 2 : obtaining the correct probability of the input question in the relation description of each candidate relation through the relation extraction model.

[0122] The input question and each relation description in Table 1 are combined into the input data format of the relation extraction model, as shown in Table 2:

[0123] Table 2 Input data format of relation extraction model

[0124]

[0125] The input question is input into the relation extraction model in the data format shown in Table 2, corresponding to each relation description. The relation extraction model will evaluate the correct probability of the input question in each candidate relation description based on the training results. The correct probability evaluation results are shown in Table 3:

[0126] Table 3 Correct probability evaluation results

[0127]

[0128]

[0129] Table 3 shows that for the question "Can a deer boy bring a maneki neko?", the correct probability for the relation "Props / equipment / items suitable for a character or scene" is 68.9%, which is rated as medium accuracy. For the question "Can a deer boy bring a maneki neko?", the correct probability for the relation "Equipment / props / items suitable for a character" is 88.7%, which is rated as excellent accuracy. For the question "Can a deer boy bring a maneki neko?", the correct probability for the relation "Recommended Onmyoji" is 12.5%, which is rated as poor accuracy. In other words, it is essentially impossible for the question "Can a deer boy bring a maneki neko?" to have the relation "Recommended Onmyoji."

[0130] Step S303 - 3 : Using the probability of the input question being correct in the relationship description of each candidate relationship as the score of the input question in each candidate relationship.

[0131] In the mapped candidate relationship set, there is a one-to-one correspondence between candidate relationships and relationship descriptions. Therefore, the probability of the input question being correct for each candidate relationship description can be used as the score for the input question on each candidate relationship. In other words, the probability of the input question being correct for the relationship description is mapped to the score for the input question on the candidate relationship. The scores for the input question on the candidate relationships are shown in Table 4:

[0132] Table 4. Scoring results of input questions on alternative relations

[0133]

[0134] Step S303 - 4 : forming a probability distribution of the input question on the candidate relationship set according to the score of the input question on each candidate relationship in the candidate relationship set.

[0135] The candidate relation set includes multiple candidate relations. The score of the input question on each candidate relation constitutes the probability distribution of the input question on the candidate relation set. Based on the scores of the input question on the candidate relations shown in Table 4, we can obtain that the probability distribution of the input question "Can a deer boy bring a fortune cat?" on the candidate relation set is [0.689, 0.887, 0.125].

[0136] The candidate relation set can be thought of as a relational space. For the input question, "Can a deer boy bring a fortune cat?", the candidate relation set corresponding to the input question contains three candidate relations. Therefore, the relational space corresponding to the input question, "Can a deer boy bring a fortune cat?", is a three-dimensional relational space. The relational space can be multidimensional, depending on the candidate relation set corresponding to the input question.

[0137] The above example uses an input question containing two entities as an example to describe the probability distribution of the input question over the candidate relationship set. The method provided in this embodiment is also applicable to input questions containing more entities. For example, if the input question Q contains entity a, entity b, and entity c, obtaining the probability distribution of the input question Q over the candidate relationship set includes the following steps:

[0138] First, get a list of entity pairs: ab, ac, bc.

[0139] Second, obtain the set of candidate relations: the candidate relations for entity pair ab are α, the candidate relations for entity pair ac are β, γ, δ, and the candidate relations for entity pair bc are η and θ. Therefore, the candidate relation set corresponding to the entity pair list in the input question is α, β, γ, δ, η, θ.

[0140] Third, obtain the mapped candidate relationship set: map each candidate relationship in the candidate relationship set into a relationship description, where the relationship descriptions of the candidate relationships are α', β', γ', δ', η', and θ'.

[0141] Fourth, obtain the correct probability of the input question for each candidate relation description: The input question Q and each relation description are combined into the input data format of the relation extraction model. This is input into the relation extraction model, and the correct probability of the input question for each relation description is evaluated. For example, the correct probability distribution of the input question Q for the relation descriptions α', β', γ', δ', η', and θ' is u%, v%, w%, x%, y%, and z%.

[0142] Fifth, obtain the probability distribution of the input question over the set of candidate relations: The correct probability of the input question's description in the candidate relations is used as the score of the input question over the candidate relations. Based on this score, a probability distribution of the input question over the set of candidate relations is formed. For example, the probability distribution of the input question Q over the set of candidate relations is [u%, v%, w%, x%, y%, z%].

[0143] Step S304: Obtain the probability distribution of known issues involving any entity pair in the entity pair list on the candidate relationship set.

[0144] The purpose of this step is to obtain the probability distribution of the known problem on the set of alternative relations obtained above.

[0145] The known questions are from a question-and-answer database that collects known questions and their corresponding answers.

[0146] Figure 5 This is a flowchart of obtaining the probability distribution of known questions on the candidate relationship set provided by this embodiment. Figure 5 As shown, the method for obtaining the probability distribution of known questions on the candidate relationship set provided in this embodiment includes:

[0147] Step S304-1: Obtain all known questions containing any entity pair in the entity pair list from the question and answer database.

[0148] Based on the entity pair list obtained in step S301, all known questions that include any entity pair in the entity pair list are filtered from the Q&A database. For example, if the entity pair list includes three entity pairs: ab, ac, and bc, then the known questions filtered from the Q&A database are those that include the entity pair ab, the entity pair ac, or the entity pair bc.

[0149] For example, the input question "Can a deer man bring a fortune cat?" contains an entity pair "deer man - fortune cat" in the entity pair list. The question-answer database contains all known questions containing the entity pair "deer man - fortune cat," including the following: the first known question "Is there a deer man suitable for a fortune cat?" and the second known question "How can a fortune cat be paired with a deer man's four-piece set?"

[0150] Step S304-2: Obtain the probability distribution of each of the known questions on the candidate relationship set through the relationship extraction model.

[0151] The relationship description of the known question and each alternative relationship in the alternative relationship set obtained in step S302 is combined into the input data format of the relationship extraction model, and input into the relationship extraction model to obtain the score of the known question on each alternative concern in the alternative relationship set, and further obtain the distribution probability of the known question on the alternative relationship set.

[0152] For example, let's take the input question "Can a deer boy bring a lucky cat?" and obtain the first and second known questions from the question-answer database. The relationship extraction model is used to obtain the distribution probabilities of the first and second known questions on the candidate relationship set. The steps for obtaining the probabilities are as follows:

[0153] First, the relationship descriptions of the first known question, the second known question distribution, and each candidate relationship in the candidate relationship set are combined into the input data format of the relationship extraction model. As shown in Table 5:

[0154] Table 5 Input data format of relation extraction model

[0155]

[0156]

[0157] Second, the relationship descriptions of the known question and the candidate relations are input into the relation extraction model in the data format of Table 5. The relation extraction model will evaluate the correct probability of the input question in the relationship description of each candidate relation. The correct probability evaluation results are shown in Table 6:

[0158] Table 6 Correct probability evaluation results

[0159]

[0160] Third, the correct probability of the known problem in the relationship description of each alternative relationship is used as the score of the known problem on each alternative relationship. The score results of the known problem on the alternative relationship are shown in Table 7:

[0161] Table 7 Scoring results of known problems on alternative relations

[0162]

[0163]

[0164] Fourth, based on the score of each known problem on each alternative relationship, a probability distribution of each known problem on the set of alternative relationships is formed.

[0165] According to the scoring results of the known questions on the alternative relations shown in Table 7, we can obtain: the probability distribution of the first known question "Is there a deer-like shikigami suitable for the Maneki Neko?" on the alternative relation set is [0.589, 0.789, 0.305]; the probability distribution of the second known question "How to match the Maneki Neko with the deer-like 4-piece set?" on the alternative relation set is [0.653, 0.485, 0.323].

[0166] Step S305 , calculating the similarity between the probability distributions of the input question and the known question on the candidate relationship set, and determining the output answer corresponding to the input question according to the similarity of the probability distributions.

[0167] The purpose of this step is to calculate the similarity between the probability distribution of the input question and the known questions, determine the known question that is most similar to the input question, and output the answer to the known question as the answer to the input question.

[0168] This embodiment provides a method for measuring the similarity of two probability distributions, that is, using the LS divergence value to measure the similarity of the probability distributions of the input question and the known question on the candidate relationship set.

[0169] The JS divergence (Jensen-Shannon divergence) is a method for measuring the similarity between two probability distributions, which solves the problem of KL divergence asymmetry. The JS divergence is symmetrical and takes a value between 0 and 1. If the two probability distributions are the same, it is 0, and if they are opposite, it is 1. The intermediate value between 0 and 1 can represent the similarity between the two probabilities.

[0170] Figure 6 This is a flowchart of determining an output response based on probability distribution similarity provided by this embodiment.

[0171] like Figure 6 As shown, the method provided in this embodiment for calculating the similarity between the probability distribution of an input question and a known question on a set of candidate relations, and determining the output answer corresponding to the input question based on the similarity, includes the following steps:

[0172] Step S305 - 1 , calculating the JS divergence value between the probability distribution of the input question on the candidate relationship set and the probability distribution of the known question on the candidate relationship set.

[0173] To calculate the JS divergence value of the probability distribution of the input problem and the known problem, the probability distribution must first be normalized. Specifically, the Softmax formula (normalized exponential function) is used for processing, and then the JS formula is used to calculate the similarity of the normalized probability distribution.

[0174] The Softmax formula is:

[0175] Among them, z i Represents the i-th data in the probability distribution, z C Represents the cth data in the probability distribution, and C represents the total number of data in the probability distribution.

[0176] The JS formula is:

[0177]

[0178] Wherein, p represents the first probability distribution, q represents the second probability distribution, p(x) represents the x-th data in the first probability distribution, and q(x) represents the x-th data in the second probability distribution.

[0179] Taking the above-mentioned input question "Can a deer man bring a fortune cat?" as an example, through steps S303 and S304, the probability distribution of the input question "Can a deer man bring a fortune cat?" on the alternative relationship set is obtained [0.689, 0.887, 0.125], the probability distribution of the first known question "Is there a deer man suitable for a fortune cat?" on the alternative relationship set is [0.589, 0.789, 0.305], and the probability distribution of the second known question "How to match the fortune cat with the deer man's 4-piece set?" on the alternative relationship set is [0.653, 0.485, 0.323]. P0, P1, and P2 are used to represent the probability distribution of the input question, the first known question, and the second known question on the alternative relationship respectively. The probability distribution of the input question, the first known question, and the second known question on the alternative relationship is summarized as shown in Table 8:

[0180] Table 8 Probability distribution summary

[0181] Representative symbols question Probability distribution <![CDATA[P0]]> Can a deer boy bring a lucky cat? [0.689,0.887,0.125] <![CDATA[P1]]> Is there any deer-man suitable as a shikigami for the Maneki Neko? [0.589,0.789,0.305] <![CDATA[P2]]> How to match the Lucky Cat with the Deer Man 4-piece set? [0.653,0.485,0.323]

[0182] Calculate the JS divergence value of the probability distribution of the input question on the candidate relationship set and the probability distribution of the known question on the candidate relationship set. The specific steps are as follows:

[0183] First, the probability distribution is normalized to obtain a normalized probability distribution.

[0184] Taking P0[0.689, 0.887, 0.125] as an example, the calculation process is as follows:

[0185]

[0186]

[0187]

[0188] After normalization, the probability distribution of the input question on the candidate relationship [0.689, 0.887, 0.125] is transformed into [0.36, 0.44, 0.20]. The sum of the values ​​in the normalized probability distribution is 1. Therefore, the normalized probability distribution can be regarded as the probability distribution of the problem in different dimensions. For example, the normalized probability distribution [0.36, 0.44, 0.20] can be regarded as the probability distribution of the input question in three dimensions.

[0189] Using the same calculation method, the probability distributions of the first known problem and the second known problem on the alternative relationship are normalized. The normalization results are shown in Table 9:

[0190] Table 9 Normalized probability distribution results

[0191] Representative symbols question Probability distribution Normalized probability distribution <![CDATA[P0]]> Can a deer boy bring a lucky cat? [0.689,0.887,0.125] [0.36,0.44,0.20] <![CDATA[P1]]> Is there any deer-man suitable as a shikigami for the Maneki Neko? [0.589,0.789,0.305] [0.34,0.41,0.25] <![CDATA[P2]]> How to match the Lucky Cat with the Deer Man 4-piece set? [0.653,0.485,0.323] [0.39,0.33,0.28]

[0192] Second, calculate the JS divergence value of the probability distribution of the input problem and the known problem on the alternative relationship set.

[0193] The JS divergence value is calculated using the normalized probability distribution. Taking the calculation of the JS divergence value of the probability distribution P0 of the input question on the alternative relationship set and the probability distribution P1 of the first known question on the alternative relationship set as an example, the calculation process is as follows:

[0194]

[0195]

[0196]

[0197] JS(P0||P1)=0.5×0.002664+0.5×0.002528=0.002596

[0198] Therefore, the JS divergence value of the probability distribution of the input question and the first known question on the alternative relation set is 0.002528.

[0199] The same method is used to calculate the JS divergence value of the probability distribution P0 of the input question on the alternative relationship set and the probability distribution P2 of the second known question on the alternative relationship set. The calculation result is:

[0200] JS(P0||P2)=0.01095

[0201] Therefore, the JS divergence value of the probability distribution of the input question and the second known question on the alternative relation set is 0.01095.

[0202] Step S305-2: Determine the similarity between the input question and the known question based on the JS divergence value.

[0203] The JS divergence value measures the similarity between two probability distributions. Its value range is [0, 1], where it is 0 if the two are the same and 1 if they are opposite. The similarity between the input question and the known question can be determined based on the JS divergence value of the probability distribution of the input question and the known question on the set of alternative relations.

[0204] The present embodiment provides a method of judging the similarity between the input question and the known question based on the JS divergence value, including: comparing whether the JS divergence value is less than a preset similarity threshold; judging whether the input question is similar to the known question based on the comparison result, including: if so, the input question is similar to the known question; if not, the input question is not similar to the known question.

[0205] The preset similarity threshold refers to a pre-set JS divergence threshold. If the calculated JS divergence value of the probability distribution of the input question and the known question on the candidate relationship set is less than the preset similarity threshold, it indicates that the input question and the known question are similar. If the calculated JS divergence value of the probability distribution of the input question and the known question on the candidate relationship set is greater than or equal to the preset similarity threshold, it indicates that the input question and the known question are not similar. The preset similarity threshold can be adjusted based on specific application scenarios and accumulated experience.

[0206] Taking the input question "Can a deer man bring a fortune cat?" as an example, the preset similarity threshold is set to 0.01. The calculation result in step S305-1 shows that the JS divergence value of the probability distribution of the input question "Can a deer man bring a fortune cat?" and the first known question "Is there a deer man suitable for a fortune cat?" on the candidate relationship set is 0.002528. Because 0.002528 < 0.01, it can be determined that the input question "Can a deer man bring a fortune cat?" is similar to the first known question "Is there a deer man suitable for a fortune cat?"

[0207] Similarly, the calculation result in step S305-1 shows that the JS divergence value of the probability distribution of the input question "Can a deer man bring a fortune cat?" and the second known question "How to match the fortune cat with the deer man's 4-piece suit?" on the candidate relationship set is 0.01095. Because 0.01095>0.01, it can be determined that the input question "Can a deer man bring a fortune cat?" and the second known question "How to match the fortune cat with the deer man's 4-piece suit?" are not similar.

[0208] The present embodiment provides for determining the similarity between the input problem and the known problem based on the JS divergence value, further comprising: comparing the sizes of a plurality of the JS divergence values; and determining the known problem with the highest similarity to the input problem based on the comparison result, including: the smaller the JS divergence value, the higher the similarity between the input problem and the known problem.

[0209] When the input problem corresponds to multiple known problems, the JS divergence value of the probability distribution of the input problem and each known problem on the alternative relationship set can be compared. The smaller the JS divergence value, the higher the similarity between the input problem and the known problem.

[0210] Taking the input question "Can a deer man bring a fortune cat?" as an example, the calculation results in step S305-1 show that the JS divergence value of the probability distribution between the input question "Can a deer man bring a fortune cat?" and the first known question "Are there any deer men who are suitable shikigami for fortune cats?" on the candidate relationship set is 0.002528. The JS divergence value of the probability distribution between the input question "Can a deer man bring a fortune cat?" and the second known question "How do I match a deer man's 4-piece set with a fortune cat?" on the candidate relationship set is 0.01095. Because 0.002528<0.01095, it can be determined that the input question "Can a deer man bring a fortune cat?" and the first known question "Are there any deer men who are suitable shikigami for fortune cats?" have the highest similarity.

[0211] Step S305-3: Determine an output answer corresponding to the input question based on the similarity between the input question and the known question.

[0212] This embodiment provides for determining an output response corresponding to the input question based on the similarity between the input question and the known question, including: using answers to the known questions similar to the input question as the output response corresponding to the input question.

[0213] Taking the input question "Can a deer man bring a fortune cat?" as an example, if the preset similarity threshold is set to 0.01, steps S305-1 and S305-2 show that the input question "Can a deer man bring a fortune cat?" is similar to the first known question "Are there any deer men who are suitable shikigami for fortune cats?", while the input question "Can a deer man bring a fortune cat?" is not similar to the second known question "How do I pair a deer man's four-piece set with a fortune cat?" Therefore, the answer to the first known question "Are there any deer men who are suitable shikigami for fortune cats?" can be used as the answer to the input question "Can a deer man bring a fortune cat?" for outputting the answer.

[0214] This embodiment provides for determining an output response corresponding to the input question based on the similarity between the input question and the known question, and further includes: using the answer to the known question with the highest similarity to the input question as the output response corresponding to the input question.

[0215] For the case where the input question corresponds to multiple known questions, and the JS divergence values ​​of the distribution probabilities of the input question and the multiple known questions on the alternative relationship set are all less than the preset similarity threshold, the answer to the known question with the smallest JS divergence value, that is, the answer to the known question that is most similar to the input question, can be used as the output response corresponding to the input question.

[0216] Taking the input question "Can a deer-boy bring a maneki-neko?" as an example, steps S305-1 and S305-2 show that the input question "Can a deer-boy bring a maneki-neko?" has the highest similarity to the first known question "Are there any deer-boy shikigami suitable for maneki-neko?" Therefore, the answer to the first known question "Are there any deer-boy shikigami suitable for maneki-neko?" can be used as the answer to the input question "Can a deer-boy bring a maneki-neko?" for outputting the answer.

[0217] The above first embodiment describes in detail the question-answering method provided by the present invention in an optional implementation manner. The question-answering method provided by the present invention includes but is not limited to the implementation manner given in the first embodiment.

[0218] A second embodiment of the present invention provides a question-answering system. Figure 7 Schematic diagram of the structure of the question-answering system provided in this embodiment.

[0219] like Figure 7 As shown, the question-answering system provided in this embodiment includes: an entity recognition unit 701, an alternative relationship acquisition unit 702, an input question probability distribution acquisition unit 703, a known question probability distribution acquisition unit 704, and a similarity calculation unit 705.

[0220] The entity recognition unit 701 is used to recognize entities in the input question and obtain an entity pair list.

[0221] Optionally, identifying entities in the input question and obtaining a list of entity pairs includes:

[0222] Identify entities in the input question using an entity recognition model;

[0223] The entities in the input question are grouped into pairs to form the entity pair list.

[0224] Optionally, the method for obtaining the entity recognition model includes:

[0225] The entities in the knowledge graph are used as training data and provided to the initial entity recognition model for training;

[0226] The entity recognition model that meets the predetermined standard after training is used as the entity recognition model for actual use.

[0227] The candidate relationship acquisition unit 702 is configured to acquire the candidate relationship of each entity pair in the entity pair list to form a candidate relationship set corresponding to the entity pair list.

[0228] Optionally, obtaining the alternative relationship of each entity pair in the entity pair list includes: taking the relationship between the entity pairs in the knowledge graph as the alternative relationship.

[0229] Optionally, obtaining the alternative relationship of each entity pair in the entity pair list further includes: taking the relationship between the type pairs corresponding to the entity pairs in the knowledge graph as the alternative relationship.

[0230] The input question probability distribution acquisition unit 703 is configured to acquire the probability distribution of the input question on the candidate relationship set based on the input question and the candidate relationship set.

[0231] Optionally, obtaining, based on the input question and the candidate relationship set, a probability distribution of the input question on the candidate relationship set includes:

[0232] Obtaining a score of the input question on each candidate relation in the candidate relation set through a relation extraction model;

[0233] According to the score of the input question on each candidate relation in the candidate relation set, a probability distribution of the input question on the candidate relation set is formed.

[0234] Optionally, the method for obtaining the relationship extraction model includes:

[0235] The known questions in the question-answer database and the relationship descriptions corresponding to the entity pairs in the known questions are used as training data and provided to the initial relationship extraction model for training;

[0236] The relation extraction model that meets the predetermined standard after training is used as the relation extraction model for actual use.

[0237] Optionally, obtaining the score of the input question on each candidate relation in the candidate relation set through the relation extraction model includes:

[0238] Mapping each candidate relationship in the candidate relationship set into a relationship description;

[0239] Obtaining, by means of the relation extraction model, a probability that the input question is correct in the relation description of each candidate relation;

[0240] The probability that the input question is correct in the relation description of each candidate relation is used as the score of the input question in each candidate relation.

[0241] Optionally, mapping each candidate relationship in the candidate relationship set to a relationship description includes: obtaining a relationship description of each candidate relationship in the candidate relationship set according to a relationship and relationship description list.

[0242] The known problem probability distribution acquisition unit 704 is configured to acquire a probability distribution of the known problem containing any one entity pair in the entity pair list on the candidate relationship set.

[0243] Optionally, obtaining a probability distribution of known issues involving any one entity pair in the entity pair list on the candidate relationship set includes:

[0244] Obtain all known questions containing any entity pair in the entity pair list from the question-answer database;

[0245] The probability distribution of each known question on the candidate relationship set is obtained through the relationship extraction model.

[0246] The similarity calculation unit 705 is used to calculate the similarity between the probability distribution of the input question and the known question on the candidate relationship set, and determine the output answer corresponding to the input question according to the similarity of the probability distribution.

[0247] Optionally, calculating the similarity between the probability distributions of the input question and the known question on the candidate relationship set, and determining the output answer corresponding to the input question based on the similarity includes:

[0248] Calculate the JS divergence value of the probability distribution of the input question on the candidate relation set and the probability distribution of the known question on the candidate relation set;

[0249] Determine the similarity between the input question and the known question according to the JS divergence value;

[0250] An output answer corresponding to the input question is determined based on the similarity between the input question and the known question.

[0251] Optionally, determining the similarity between the input question and the known question according to the JS divergence value includes:

[0252] Comparing whether the JS divergence value is less than a preset similarity threshold;

[0253] According to the comparison result, it is determined whether the input question is similar to the known question, including: if so, the input question is similar to the known question; if not, the input question is not similar to the known question.

[0254] Optionally, the determining the similarity between the input question and the known question according to the JS divergence value further includes:

[0255] Comparing the sizes of the multiple JS divergence values;

[0256] Determining the known problem with the highest similarity to the input problem based on the comparison result includes: the smaller the JS divergence value, the higher the similarity between the input problem and the known problem.

[0257] Optionally, determining the output response corresponding to the input question based on the similarity between the input question and the known question includes: using the answer to the known question with the highest similarity to the input question as the output response corresponding to the input question.

[0258] A third embodiment of the present invention provides an electronic device. Figure 8 Schematic diagram of the structure of the electronic device provided in this embodiment.

[0259] like Figure 8 As shown, the electronic device provided by this embodiment includes: a memory 801 and a processor 802.

[0260] The memory 801 is used to store computer instructions for executing the question-answering method.

[0261] The processor 802 is configured to execute computer instructions stored in the memory 801 to perform the following operations:

[0262] Identify entities in the input question and obtain a list of entity pairs;

[0263] Obtaining candidate relationships for each entity pair in the entity pair list to form a candidate relationship set corresponding to the entity pair list;

[0264] According to the input question and the candidate relationship set, obtaining a probability distribution of the input question on the candidate relationship set;

[0265] Obtaining a probability distribution of a known problem containing any entity pair in the entity pair list on the candidate relationship set;

[0266] The similarity between the probability distributions of the input question and the known question on the candidate relationship set is calculated, and the output answer corresponding to the input question is determined according to the similarity of the probability distributions.

[0267] Optionally, identifying entities in the input question and obtaining a list of entity pairs includes:

[0268] Identify entities in the input question using an entity recognition model;

[0269] The entities in the input question are grouped into pairs to form the entity pair list.

[0270] Optionally, the method for obtaining the entity recognition model includes:

[0271] The entities in the knowledge graph are used as training data and provided to the initial entity recognition model for training;

[0272] The entity recognition model that meets the predetermined standard after training is used as the entity recognition model for actual use.

[0273] Optionally, obtaining the alternative relationship of each entity pair in the entity pair list includes: taking the relationship between the entity pairs in the knowledge graph as the alternative relationship.

[0274] Optionally, obtaining the alternative relationship of each entity pair in the entity pair list further includes: taking the relationship between the type pairs corresponding to the entity pairs in the knowledge graph as the alternative relationship.

[0275] Optionally, obtaining, based on the input question and the candidate relationship set, a probability distribution of the input question on the candidate relationship set includes:

[0276] Obtaining a score of the input question on each candidate relation in the candidate relation set through a relation extraction model;

[0277] According to the score of the input question on each candidate relation in the candidate relation set, a probability distribution of the input question on the candidate relation set is formed.

[0278] Optionally, the method for obtaining the relationship extraction model includes:

[0279] The known questions in the question-answer database and the relationship descriptions corresponding to the entity pairs in the known questions are used as training data and provided to the initial relationship extraction model for training;

[0280] The relation extraction model that meets the predetermined standard after training is used as the relation extraction model for actual use.

[0281] Optionally, obtaining the score of the input question on each candidate relation in the candidate relation set through the relation extraction model includes:

[0282] Mapping each candidate relationship in the candidate relationship set into a relationship description;

[0283] Obtaining, by means of the relation extraction model, a probability that the input question is correct in the relation description of each candidate relation;

[0284] The probability that the input question is correct in the relation description of each candidate relation is used as the score of the input question in each candidate relation.

[0285] Optionally, mapping each candidate relationship in the candidate relationship set to a relationship description includes: obtaining a relationship description of each candidate relationship in the candidate relationship set according to a relationship and relationship description list.

[0286] Optionally, obtaining a probability distribution of known issues involving any one entity pair in the entity pair list on the candidate relationship set includes:

[0287] Obtain all known questions containing any entity pair in the entity pair list from the question-answer database;

[0288] The probability distribution of each known question on the candidate relationship set is obtained through the relationship extraction model.

[0289] Optionally, calculating the similarity between the probability distributions of the input question and the known question on the candidate relationship set, and determining the output answer corresponding to the input question based on the similarity includes:

[0290] Calculate the JS divergence value of the probability distribution of the input question on the candidate relation set and the probability distribution of the known question on the candidate relation set;

[0291] Determine the similarity between the input question and the known question according to the JS divergence value;

[0292] An output answer corresponding to the input question is determined based on the similarity between the input question and the known question.

[0293] Optionally, determining the similarity between the input question and the known question according to the JS divergence value includes:

[0294] Comparing whether the JS divergence value is less than a preset similarity threshold;

[0295] According to the comparison result, it is determined whether the input question is similar to the known question, including: if so, the input question is similar to the known question; if not, the input question is not similar to the known question.

[0296] Optionally, the determining the similarity between the input question and the known question according to the JS divergence value further includes:

[0297] Comparing the sizes of the multiple JS divergence values;

[0298] Determining the known problem with the highest similarity to the input problem based on the comparison result includes: the smaller the JS divergence value, the higher the similarity between the input problem and the known problem.

[0299] Optionally, determining the output response corresponding to the input question based on the similarity between the input question and the known question includes: using the answer to the known question with the highest similarity to the input question as the output response corresponding to the input question.

[0300] A fourth embodiment of the present invention provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed by a processor, they are used to implement the technical solution described in the first embodiment of the present invention.

[0301] It should be noted that relational terms such as "first" and "second" in this document are used only to distinguish one entity or operation from another entity or operation, and do not require or imply any actual relationship or order between these entities or operations. In addition, the words "include," "have," "include," and "includes" and other similar forms are synonymous in meaning, and the ending of any one or more items following any of the above words is open-ended, and none of the above terms indicates that the one or more items are exhaustive or limited to the one or more items listed.

[0302] As used herein, unless expressly stated otherwise, the term "or" includes all possible combinations, except those that are infeasible. For example, if a statement states that a database may include A or B, then unless otherwise specified or infeasible, it may include databases A, B, or A and B. As a second example, if a statement states that a database may include A, B, or C, then unless otherwise specified or infeasible, it may include databases A, B, or C, or A and B, or A and C, or B and C, or A, B, and C.

[0303] It is worth noting that the above embodiments can be implemented by hardware or software (program code), or a combination of hardware and software. If implemented by software, it can be stored in the above-mentioned computer-readable medium. When the software is executed by a processor, it can execute the above-mentioned disclosed method. The computing unit and other functional units described in this disclosure can be implemented by hardware or software, or a combination of hardware and software. Those of ordinary skill in the art will also understand that the above-mentioned multiple modules / units can be combined into one module / unit, and each of the above-mentioned modules / units can be further divided into multiple sub-modules / sub-units.

[0304] In the above detailed description, the embodiments have been described with reference to many specific details, which may vary from implementation to implementation. Certain adaptations and modifications may be made to the embodiments. For those skilled in the art, other embodiments will be readily apparent from the specific embodiments disclosed herein. This description and examples are for illustrative purposes only, and the true scope and nature of the invention are described in the claims. The order of steps shown in the figures is also for illustrative purposes only and is not intended to be limiting to any particular steps or order. Therefore, those skilled in the art will appreciate that these steps may be performed in a different order when implementing the same method.

[0305] In the drawings and detailed description of this application, exemplary embodiments are disclosed. However, many variations and modifications may be made to these embodiments. Accordingly, although specific terms are used, these terms are used in a general and descriptive sense only and not for purposes of limitation.

Claims

1. A question-answering method, characterized in that: include: Identify entities in the input question and obtain a list of entity pairs; Obtaining candidate relationships for each entity pair in the entity pair list to form a candidate relationship set corresponding to the entity pair list; Obtaining, based on the input question and the set of candidate relations, a probability distribution of the input question on the set of candidate relations, including: obtaining a score of the input question on each candidate relation in the set of candidate relations; forming a probability distribution of the input question on the set of candidate relations based on the score of the input question on each candidate relation in the set of candidate relations; Obtaining a probability distribution of a known problem containing any entity pair in the entity pair list on the candidate relationship set; The similarity between the probability distributions of the input question and the known question on the candidate relationship set is calculated, and the output answer corresponding to the input question is determined according to the similarity of the probability distributions.

2. The method according to claim 1, characterized in that The identifying of entities in the input question and obtaining a list of entity pairs includes: Identify entities in the input question using an entity recognition model; The entities in the input question are grouped into pairs to form the entity pair list.

3. The method according to claim 2, characterized in that The method for obtaining the entity recognition model includes: The entities in the knowledge graph are used as training data and provided to the initial entity recognition model for training; The entity recognition model that meets the predetermined standard after training is used as the entity recognition model for actual use.

4. The method according to claim 1, wherein The obtaining of the candidate relationship of each entity pair in the entity pair list includes: taking the relationship of the entity pair existing in the knowledge graph as the candidate relationship.

5. The method according to claim 1, wherein The obtaining of the candidate relationship for each entity pair in the entity pair list further includes: taking the relationship between the type pairs corresponding to the entity pairs in the knowledge graph as the candidate relationship.

6. The method according to claim 1, wherein The obtaining of the score of the input question on each candidate relation in the candidate relation set includes: The score of the input question on each candidate relation in the candidate relation set is obtained through a relation extraction model.

7. The method according to claim 6, characterized in that The method for obtaining the relationship extraction model includes: The known questions in the question-answer database and the relationship descriptions corresponding to the entity pairs in the known questions are used as training data and provided to the initial relationship extraction model for training; The relation extraction model that meets the predetermined standard after training is used as the relation extraction model for actual use.

8. The method according to claim 6, characterized in that The step of obtaining a score of the input question on each candidate relation in the candidate relation set by using a relation extraction model includes: Mapping each candidate relationship in the candidate relationship set into a relationship description; Obtaining, by means of the relation extraction model, a probability that the input question is correct in the relation description of each candidate relation; The probability that the input question is correct in the relation description of each candidate relation is used as the score of the input question in each candidate relation.

9. The method according to claim 8, characterized in that Mapping each candidate relationship in the candidate relationship set to a relationship description includes: obtaining a relationship description of each candidate relationship in the candidate relationship set according to a relationship and relationship description list.

10. The method according to claim 1, characterized in that The obtaining of a probability distribution of a known problem containing any one entity pair in the entity pair list on the candidate relationship set includes: Obtain all known questions containing any entity pair in the entity pair list from the question-answer database; The probability distribution of each known question on the candidate relationship set is obtained through the relationship extraction model.

11. The method according to claim 1, wherein The calculating the similarity between the probability distributions of the input question and the known question on the candidate relationship set, and determining the output answer corresponding to the input question according to the similarity, includes: Calculate the JS divergence value of the probability distribution of the input question on the candidate relation set and the probability distribution of the known question on the candidate relation set; Determine the similarity between the input question and the known question according to the JS divergence value; An output answer corresponding to the input question is determined based on the similarity between the input question and the known question.

12. The method according to claim 11, characterized in that The determining, based on the JS divergence value, the similarity between the input question and the known question includes: Comparing whether the JS divergence value is less than a preset similarity threshold; According to the comparison result, it is determined whether the input question is similar to the known question, including: if so, the input question is similar to the known question; if not, the input question is not similar to the known question.

13. The method according to claim 11, characterized in that The determining the similarity between the input question and the known question according to the JS divergence value further includes: Comparing the sizes of the multiple JS divergence values; Determining the known problem with the highest similarity to the input problem based on the comparison result includes: the smaller the JS divergence value, the higher the similarity between the input problem and the known problem.

14. The method according to claim 11, characterized in that The determining, based on the similarity between the input question and the known question, an output response corresponding to the input question includes: using the answer to the known question having the highest similarity to the input question as the output response corresponding to the input question.

15. A question-answering system, characterized in that: include: Entity recognition unit, alternative relationship acquisition unit, input question probability distribution acquisition unit, known question probability distribution acquisition unit, similarity calculation unit; The entity recognition unit is used to identify entities in the input question and obtain an entity pair list; The candidate relationship acquisition unit is configured to acquire a candidate relationship for each entity pair in the entity pair list to form a candidate relationship set corresponding to the entity pair list; The input question probability distribution acquisition unit is configured to acquire, based on the input question and the candidate relationship set, a probability distribution of the input question on the candidate relationship set, including: acquiring a score of the input question on each candidate relationship in the candidate relationship set; and forming a probability distribution of the input question on the candidate relationship set based on the score of the input question on each candidate relationship in the candidate relationship set; The known problem probability distribution acquisition unit is used to obtain the probability distribution of the known problem containing any one entity pair in the entity pair list on the candidate relationship set; The similarity calculation unit is used to calculate the similarity between the probability distribution of the input question and the known question on the set of candidate relations, and determine the output answer corresponding to the input question based on the similarity of the probability distribution.

16. An electronic device, characterized in that: include: Memory, processor; The memory is used to store one or more computer instructions; The processor is configured to execute the one or more computer instructions to implement the method according to any one of claims 1 to 14.

17. A computer-readable storage medium having one or more computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the method according to any one of claims 1 to 14 is performed.

Citation Information

Patent Citations

  • Systems and methods for human inspired simple question answering (HISQA)

    CN106649514A

  • Knowledge graph query method, electronic device, and storage medium

    WO2021129515A1