Question and answer method, apparatus and device

By introducing knowledge graphs and entity relationships into the question-answering system, the problem of response accuracy under fuzzy questions is solved, and higher response accuracy is achieved.

CN112988988BActive Publication Date: 2026-08-04HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
Filing Date
2019-12-18
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing question-answering systems struggle to determine the most appropriate answer when faced with ambiguous questions, leading to reduced response accuracy.

Method used

By leveraging the relationships between entities and question-answer pairs in a knowledge graph, multiple rounds of interaction are used to generate follow-up questions to clarify user intent and improve response accuracy.

Benefits of technology

Even if the user's question is somewhat vague, the knowledge graph's relationships and multiple rounds of interaction can accurately return the most suitable answer to the user.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112988988B_ABST
    Figure CN112988988B_ABST
Patent Text Reader

Abstract

The application provides a question and answer method, device and equipment, the method comprises: obtaining a target question input by a user, and obtaining a response corresponding to the target question according to stored content in a knowledge base, wherein the stored content in the knowledge base comprises a knowledge graph, a plurality of question and answer pairs, and an association relationship between entities in the knowledge graph and the plurality of question and answer pairs; the embodiment can improve the accuracy of the response returned to the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a question-answering method, apparatus, and device. Background Technology

[0002] Question-answering systems have been widely adopted, and many intelligent customer service systems use question-answering robots. For example, users can ask questions to the question-answering robot, and the robot will return appropriate answers based on the user's questions.

[0003] In retrieval-based question-answering methods, pre-written question-answer pairs (QA pairs) need to be stored in a knowledge base. When a user inputs a question, the similarity between the user's question and the questions in the knowledge base is calculated, and the answer corresponding to the question with the highest similarity is returned.

[0004] However, when the user's input is vague, the above search process may not be able to determine the most appropriate answer. Summary of the Invention

[0005] This application provides a question-and-answer method, apparatus, and device that can improve the accuracy of responses returned to users.

[0006] In a first aspect, this application provides a question-answering method, comprising: obtaining a target question input by a user; obtaining a response corresponding to the target question based on stored content in a knowledge base; wherein the stored content in the knowledge base includes: a knowledge graph, multiple question-answer pairs, and the association relationship between entities in the knowledge graph and the multiple question-answer pairs, and each question-answer pair includes a known question and an answer corresponding to the known question.

[0007] In this scheme, when obtaining the response to the target question, the content stored in the knowledge base is utilized: knowledge graph, multiple question-answer pairs, and the association between entities in the knowledge graph and the multiple question-answer pairs. Thus, when the user's target question is relatively vague, for example, when the user's target question has a high similarity to known questions in multiple question-answer pairs, the response to the target question can be determined based on the association between the entities associated with the multiple question-answer pairs, thereby improving the accuracy of the response returned to the user.

[0008] In conjunction with the first aspect, in one possible implementation, obtaining the response corresponding to the target question based on the stored content in the knowledge base includes: obtaining the response corresponding to the target question based on the similarity between the question-answer pairs associated with each entity in the knowledge graph and the target question, as well as the association relationships between each entity in the knowledge graph.

[0009] In conjunction with the first aspect, in one possible implementation, obtaining the response corresponding to the target question based on the similarity between the question-answer pairs associated with each entity in the knowledge graph and the target question, as well as the association relationships between the entities in the knowledge graph, includes: for each entity in the knowledge graph, determining the similarity between each entity and the target question based on the similarity between the question-answer pairs associated with each entity and the target question; identifying a target entity in the knowledge graph, wherein the similarity between the target entity and the target question is greater than or equal to a preset threshold; if there are multiple target entities, determining the candidate path corresponding to each target entity in the knowledge graph, and obtaining the response corresponding to the target question based on the association relationships between the entities in the determined multiple candidate paths; wherein, a candidate path corresponding to a target entity is a path from a parent entity in the knowledge graph to the target entity.

[0010] In this implementation, when multiple target entities are identified, it indicates that the semantics of the user's target question are relatively ambiguous. In this case, the response to the target question can be determined based on the candidate paths corresponding to each target entity. The response to the target question determined in this case is actually a follow-up question used to further clarify the user's intent, rather than a specific answer to the target question. By using follow-up questions, the user engages in multiple rounds of interaction with the question-and-answer device, guiding the user to accurately express their question, thereby ensuring that the most appropriate answer is provided to the user.

[0011] In conjunction with the first aspect, in one possible implementation, after the target entity is determined in the knowledge graph, the method further includes: if the number of target entities is one, then obtaining the response to the target question based on the question-answer pair associated with the target entity.

[0012] In this implementation, when only one target entity is identified, it indicates that the semantics of the user's target question are relatively clear. In this case, the answer to the target question can be determined directly based on the question-and-answer pairs associated with the target entity. For example, if the target entity is associated with only one question-and-answer pair, the answer in that pair is directly used as the answer to the target question. If the target entity is associated with multiple question-and-answer pairs, the answer in the question-and-answer pair with the highest similarity to the target question is used as the answer to the target question.

[0013] In conjunction with the first aspect, in one possible implementation, obtaining the response corresponding to the target question based on the association relationship between entities in the determined multiple candidate paths includes: if the determined multiple candidate paths include the same parent entity, then generating a counter-question to further clarify the user's intent based on the intermediate entity in each candidate path, and providing the counter-question to the user; wherein the intermediate entity is located between the parent entity and the target entity in the candidate path.

[0014] In conjunction with the first aspect, in one possible implementation, obtaining the response corresponding to the target question based on the association relationship between entities in the determined multiple candidate paths includes: if the determined multiple candidate paths do not include the same parent entity, then generating a counter-question to further clarify the user's intent based on the parent entity of the target entity in at least one of the multiple candidate paths, and providing the counter-question to the user.

[0015] In both of the above implementation methods, when the user's target question is relatively vague, the association between different question-answer pairs indicated by the knowledge graph is used to generate a counter-question to clarify the user's intent. Through a multi-round question-answering interaction process, the user's intent is clarified, and the most appropriate answer is returned to the user.

[0016] In conjunction with the first aspect, in one possible implementation, determining the similarity between each entity and the target question based on the similarity between the question-answer pairs associated with each entity and the target question includes: if an entity is associated with only one question-answer pair, then the similarity between the question-answer pair associated with the entity and the target question is determined as the similarity between the entity and the target question; if an entity is associated with multiple question-answer pairs, then the highest similarity is determined from the similarities between the multiple question-answer pairs associated with the entity and the target question, and the highest similarity is determined as the similarity between the entity and the target question.

[0017] Secondly, this application provides a question-answering device, including: a communication unit, a processing unit, and a knowledge base; wherein, the communication unit is used to acquire a target question input by a user; the processing unit is used to acquire a response corresponding to the target question based on the stored content in the knowledge base; wherein, the stored content in the knowledge base includes: a knowledge graph, multiple question-answer pairs, and the association relationship between entities in the knowledge graph and the multiple question-answer pairs, each question-answer pair including a known question and an answer corresponding to the known question.

[0018] In conjunction with the second aspect, in one possible implementation, the processing unit is specifically used to: obtain the response corresponding to the target question based on the similarity between the question-answer pairs associated with each entity in the knowledge graph and the target question, as well as the association relationship between each entity in the knowledge graph.

[0019] In conjunction with the second aspect, in one possible implementation, the processing unit is specifically configured to: for each entity in the knowledge graph, determine the similarity between each entity and the target question based on the similarity between the question-answer pair associated with each entity and the target question; identify a target entity in the knowledge graph, wherein the similarity between the target entity and the target question is greater than or equal to a preset threshold; if there are multiple target entities, determine the candidate path corresponding to each target entity in the knowledge graph, and obtain the response corresponding to the target question based on the association relationship between entities in the determined multiple candidate paths; wherein, a candidate path corresponding to a target entity is a path from a parent entity in the knowledge graph to the target entity.

[0020] In conjunction with the second aspect, in one possible implementation, the processing unit is further specifically used to: if the number of target entities is one, obtain the response to the target question based on the question-answer pair associated with the target entity.

[0021] In conjunction with the second aspect, in one possible implementation, the processing unit is specifically configured to: if the determined multiple candidate paths include the same parent entity, generate a rhetorical question to further clarify the user's intent based on the intermediate entity in each candidate path, and provide the rhetorical question to the user; wherein the intermediate entity is located between the parent entity and the target entity in the candidate path.

[0022] In conjunction with the second aspect, in one possible implementation, the processing unit is specifically configured to: if the determined multiple candidate paths do not include the same parent entity, generate a rhetorical question to further clarify the user's intent based on the parent entity of the target entity in at least one of the multiple candidate paths, and provide the rhetorical question to the user.

[0023] In conjunction with the second aspect, in one possible implementation, the processing unit is specifically used to: if an entity is associated with only one question-answer pair, determine the similarity between the question-answer pair associated with the entity and the target question as the similarity between the entity and the target question; if an entity is associated with multiple question-answer pairs, determine the highest similarity from the similarities between the multiple question-answer pairs associated with the entity and the target question, and determine the highest similarity as the similarity between the entity and the target question.

[0024] Thirdly, this application provides a question-and-answer device, comprising: a memory and a processor, the memory being used to store a computer program, and the processor being used to call and run the computer program from the memory, such that the processor runs the computer program to perform the method as described in any of the first aspects.

[0025] Fourthly, this application provides a computer-readable storage medium comprising a computer program for implementing the method as described in any of the first aspects.

[0026] Fifthly, this application provides a chip or chip system including at least one processor and a communication interface, the communication interface and at least one processor being interconnected via a line, the at least one processor being used to run computer programs or instructions to perform any of the methods in the first aspect.

[0027] The communication interface in the chip can be an input / output interface, pins, or circuits.

[0028] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).

[0029] Sixthly, this application provides a computer program product comprising: computer program code, which, when run on a computer, causes the computer to perform the method described in any of the first aspects above.

[0030] The question-answering method, apparatus, and device provided in this application include: acquiring a target question input by a user; and acquiring a response corresponding to the target question based on stored content in a knowledge base. The stored content in the knowledge base includes a knowledge graph, multiple question-answer pairs, and the association relationships between entities in the knowledge graph and the multiple question-answer pairs. Thus, when the target question raised by the user is relatively vague, for example, when the user's target question has a high similarity to known questions in multiple question-answer pairs, the response corresponding to the target question can be determined based on the association relationships between the entities associated with the multiple question-answer pairs, thereby improving the accuracy of the response returned to the user. Attached Figure Description

[0031] Figure 1 This is a schematic diagram illustrating a possible application scenario of an embodiment of this application;

[0032] Figure 2 This is a schematic diagram illustrating the principle of the question-and-answer process in an embodiment of this application;

[0033] Figure 3 A flowchart illustrating a question-and-answer method provided in one embodiment of this application;

[0034] Figure 4 This is a schematic diagram of the stored content in the knowledge base in an embodiment of this application;

[0035] Figure 5 A schematic diagram of a knowledge graph provided for an embodiment of this application;

[0036] Figure 6 A flowchart illustrating a question-and-answer method provided in another embodiment of this application;

[0037] Figure 7 A schematic diagram illustrating a question-and-answer method provided in yet another embodiment of this application;

[0038] Figure 8 This is a schematic diagram of the structure of a question-and-answer device provided in one embodiment of this application;

[0039] Figure 9 This is a schematic diagram of the structure of a question-and-answer device provided in one embodiment of this application. Detailed Implementation

[0040] The technical solution of this application will now be described with reference to the accompanying drawings.

[0041] Question-answering systems (QA) have been widely adopted. A QA system is an advanced form of information retrieval system that can answer user questions posed in natural language with accurate and concise natural language. QA systems can also be called human-computer dialogue systems, etc. Currently, many intelligent customer service systems in various fields utilize QA systems. Figure 1 This is a schematic diagram illustrating a possible application scenario of an embodiment of this application. For example... Figure 1 As shown, this application scenario includes a question-and-answer device and a user. For example, a user can ask a question to the question-and-answer device, and the device will return an appropriate answer based on the question. For instance, if a user asks the question "What is the capital of China?", the device will return the answer "Beijing".

[0042] Question-answering devices can be any electronic device capable of responding to user questions. They can also be called question-answering robots, including but not limited to: computers, smartphones, smart home devices, smart speakers, wearable devices, and smart robots. Depending on the application area, question-answering devices may have different names, such as chatbots, customer service robots, consultation robots, and reception robots.

[0043] Figure 1 In the application scenarios shown, there can be various ways for users to interact with the question-and-answer device, and this embodiment does not limit this. For example, users can input questions into the question-and-answer device via voice or text. In some scenarios, users can also use body language to input questions. Correspondingly, the question-and-answer device can also output response information to the user using various interaction methods.

[0044] The question-and-answer device includes a question-and-answer unit, which can acquire the user's input question and perform calculations to obtain the corresponding answer. It should be understood that, in addition to the question-and-answer unit, the question-and-answer device may also include other devices, such as input devices (e.g., keyboard, touchscreen, voice input device, etc.) and output devices (e.g., display screen, speaker, etc.). For some question-and-answer devices that perform actions, it may also include a driving device, a control device, etc. This embodiment does not limit the structure of the question-and-answer device.

[0045] Figure 2 This is a schematic diagram illustrating the principle of the question-and-answer process in an embodiment of this application. Figure 2As shown, a question-answering device may include a communication unit, a processing unit, and a knowledge base. The knowledge base provides the knowledge needed to answer user questions. The processing unit may include a semantic matching model to retrieve the most suitable answer from the knowledge base based on the user's question. It is understood that the richer the knowledge base, the more questions the question-answering device can answer. The communication unit interacts with other components of the question-answering device, for example, by obtaining the user's input question from the input device and providing the corresponding response to the output device.

[0046] Different types of question-answering devices may use different representations of the knowledge in their knowledge bases. In one possible implementation, the knowledge in the knowledge base is stored in the form of "question-answer pairs." These pairs can also be simply called "question-answering (QA) pairs." Here, Q represents a known question (or standard question), and A represents the answer to Q. After receiving a user's question, the question-answering device uses a semantic matching model to search for the answer in the knowledge base. Essentially, this involves matching the user's question with known questions in the knowledge base and returning the answer corresponding to the most matching known question.

[0047] The question-answering method described above can be called information retrieval-based question answering (IRQA). This type of method includes two core features. The first feature is storing pre-written question-answer pairs in a knowledge base. The second feature is that after receiving a user's question, it calculates the similarity between the user's question and known questions (Q) in the knowledge base, and returns the answer (A) corresponding to the known question (Q) with the highest similarity. It is understandable that for retrieval-based question answering methods to achieve good results, on the one hand, the knowledge base needs to be sufficiently rich, i.e., ensuring that the user's question is included in the knowledge base as much as possible. On the other hand, the semantic matching model needs to be sufficiently accurate, i.e., ensuring that the answer can be found even if it exists in the knowledge base.

[0048] However, in the above-mentioned retrieval-based question-answering scheme, the retrieval is based on the similarity between the user's question and known questions in the knowledge base. If the user's question is ambiguous, that is, the similarity between the user's question and multiple known questions cannot be distinguished, the question-answering device cannot determine the most appropriate answer, resulting in a decrease in the accuracy of the answer returned by the question-answering device.

[0049] To address the aforementioned issues, embodiments of this application provide a question-and-answer method, apparatus, and device that can improve the accuracy of question-and-answer systems.

[0050] The technical solutions of this application will be described in detail below with reference to several specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0051] Figure 3 This is a flowchart illustrating a question-and-answer method provided in one embodiment of this application. The method in this embodiment can be... Figure 1 The question-and-answer device in the system performs the task; for example, it can be performed by the question-and-answer mechanism within the question-and-answer device. For example... Figure 3 As shown, the method in this embodiment includes:

[0052] S301: The target problem for obtaining user input.

[0053] The target question can be a question input by the user to the question-and-answer device. For example, the user can input the target question in text format, in which case the question-and-answer device receives the target question in text form. The user can also input the target question in voice format, in which case the question-and-answer device can convert the received voice information into text information, thus obtaining the target question in text form. The user can also input the target question using body language, in which case the question-and-answer device collects and analyzes the user's body movements to identify the target question in text form.

[0054] S302: Obtain the response corresponding to the target question based on the stored content in the knowledge base; wherein, the stored content in the knowledge base includes: a knowledge graph, multiple question-answer pairs, and the association relationship between entities in the knowledge graph and the multiple question-answer pairs, and each question-answer pair includes a known question and the answer corresponding to the known question.

[0055] In existing technologies, knowledge bases store only multiple question-answer pairs, and these pairs are independent of each other. For example, the knowledge base stores N question-answer pairs, as shown in Table 1. Therefore, in existing technologies, after receiving a target question input by a user, the question-answering device calculates the similarity between the target question and known questions in the N question-answer pairs, and uses the answer corresponding to the known question with the highest similarity as the answer to the target question.

[0056] Table 1

[0057]

[0058] In the research process, the inventors of the present application found that the N question-and-answer pairs stored in the knowledge base of the above-mentioned prior art are independent of each other. In some scenarios, the meaning of the target question input by the user is relatively vague, making the similarity between the target question and the known questions of the M question-and-answer pairs in the knowledge base relatively high, where M < N. Since these M question-and-answer pairs are independent of each other, it is very difficult for the question-and-answer device to further accurately determine the answer to the target question based on these M question-and-answer pairs.

[0059] The difference between this embodiment and the prior art is that in addition to storing multiple question-and-answer pairs, the knowledge base of this embodiment also stores the association relationships between multiple question-and-answer pairs using a knowledge graph. Figure 4 It is a schematic diagram of the storage content in the knowledge base of the embodiment of the present application. As Figure 4 shown, the storage content in the knowledge base includes: a knowledge graph, multiple question-and-answer pairs, and the association relationships between the entities in the knowledge graph and the question-and-answer pairs. Among them, the multiple question-and-answer pairs are similar to the storage content in Table 1, and each question-and-answer pair includes a known question and the answer corresponding to the known question.

[0060] Among them, a knowledge graph is a semantic network designed to describe various entities and their relationships existing in the real world. An entity is something that is distinguishable and exists independently within itself, such as a certain person, a certain city, a certain plant, a certain commodity, etc. Entities are the most basic elements in the knowledge graph, and there are different relationships between different entities. The knowledge graph can be regarded as a huge graph, which includes nodes and edges. Nodes represent entities, and edges represent the semantic relationships between entities.

[0061] The knowledge graph can be constructed and defined manually. Exemplarily, it can be constructed based on the knowledge of a certain application scenario or a certain application field.

[0062] In practical applications, there can be multiple ways to construct a knowledge graph. In one possible way, the knowledge graph can be constructed based on triples. Among them, the basic form of a triple can be (entity 1 - relationship - entity 2), or it can also be (entity - attribute - attribute value). It should be noted that in practical applications, other ways to construct a knowledge graph can also be adopted. When the construction methods are different, the constructed knowledge graphs may also be different.

[0063] Regardless of which construction method is adopted, the construction of the knowledge graph starts from the most original data (including structured, semi-structured, and unstructured data), and uses a series of automatic or semi-automatic technical means to extract knowledge facts from the original database and third-party databases, and constructs the knowledge graph through multiple processes such as information extraction, knowledge representation, knowledge fusion, and knowledge reasoning. The construction process of the knowledge graph in this embodiment will not be elaborated in detail.

[0064] In this embodiment, a knowledge graph is constructed based on the knowledge within the application scenario or domain of the question-answering system, and then stored in a knowledge base. The knowledge graph includes multiple entities, and the relationships between these entities can be determined from the knowledge graph. See also... Figure 4 In addition to storing multiple question-answer pairs and knowledge graphs, the knowledge base also stores the associations between entities in the knowledge graph and the question-answer pairs. For example, entity 1 is associated with QA0001 and QA0002, entity 2 is associated with QA0003 and QA0004, and so on. Thus, based on the association between entity 1 and entity 2 in the knowledge graph, the associations between the aforementioned multiple question-answer pairs can be determined. This embodiment, by establishing associations between question-answer pairs and entities in the knowledge graph, realizes the association of multiple question-answer pairs using the associations between multiple entities in the knowledge graph, thereby enabling associations between multiple question-answer pairs. In other words, the associations between multiple question-answer pairs can be presented through the associations between the entities associated with these question-answer pairs.

[0065] The following is combined Figure 5 Let's illustrate with examples. Figure 5 This is a schematic diagram of another knowledge graph provided in an embodiment of this application, taking a pet dog knowledge graph as an example, such as... Figure 5 As shown, the knowledge graph includes seven entities: pet dog, Golden Retriever, Tibetan Mastiff, Golden Retriever characteristics, Golden Retriever training methods, Tibetan Mastiff characteristics, and Tibetan Mastiff training methods. When establishing the association between entities and question-and-answer pairs in the knowledge graph, the question-and-answer pair can be associated with the corresponding entity in the knowledge graph based on the entity described by each pair. For example, suppose a question-and-answer pair is "Q: What are the characteristics of a Golden Retriever? A: Gentle and loyal, enthusiastic and friendly, intelligent and alert." The entity described by this question-and-answer pair is "Characteristics of a Golden Retriever." Therefore, this question-and-answer pair can be associated with... Figure 5 The entity "Characteristics of Golden Retrievers" in the knowledge graph shown is associated. Suppose a question-and-answer pair is "Q: How to train a Golden Retriever? A: Use correct rewards, punishments, and guidance, etc...", the entity described in this pair is "Methods of training Golden Retrievers." Therefore, this question-and-answer pair can be associated with... Figure 5 The entity "Methods for training Golden Retrievers" is associated in the knowledge graph shown. Similarly, each question-answer pair in the knowledge base can be associated with an entity in the knowledge graph. For example... Figure 5 As shown, QA0001 is associated with the entity "Golden Retriever Characteristics", QA0002 is associated with the entity "Golden Retriever Training Method", QA0003 is associated with "Tibetan Mastiff Characteristics", and QA0004 is associated with "Tibetan Mastiff Training Method".

[0066] This is understandable. When establishing the relationships between entities and question-answer pairs in a knowledge graph, each entity in the knowledge graph can be associated with one or more question-answer pairs, and each question-answer pair can be associated with only one entity in the knowledge graph. In a knowledge graph, only some entities can be associated with question-answer pairs, or every entity can be associated with a question-answer pair.

[0067] In this embodiment, after the question-and-answer device obtains the user's target question, it can, according to, as follows: Figure 4 The knowledge base shown contains stored content, from which the answer to the target question can be obtained. Since the knowledge base stores a knowledge graph, multiple question-answer pairs, and the relationships between entities and question-answer pairs in the knowledge graph, the relationships between question-answer pairs can be determined by utilizing these relationships. Therefore, when obtaining the answer to the target question, these relationships between question-answer pairs can be used, potentially returning a suitable answer even if the user's target question is somewhat vague.

[0068] In other words, when obtaining the response to a target question, the response can be obtained based on the similarity between the question-and-answer pairs associated with each entity in the knowledge graph and the target question, as well as the relationships between the entities in the knowledge graph. When the semantics of the user's target question are ambiguous, for example, if the user's target question has a high similarity to known questions in multiple question-and-answer pairs, the response to the target question can be determined based on the relationships between the entities associated with those multiple question-and-answer pairs. It is understood that the response can be a specific answer to the target question, or it can be a follow-up question used to further clarify the user's intent.

[0069] For example, if the user's target question is "How to train a pet dog", since this target question is related to... Figure 5 The high similarity between known questions QA0001 and QA0002 in the knowledge graph indicates that the semantics of the target question are somewhat ambiguous. Based on the relationships between entities associated with QA0001 and QA0002 in the knowledge graph, the question-answering device can determine whether the user's target question is about Golden Retrievers or Tibetan Mastiffs. Therefore, the question-answering device can use the follow-up question, "Do you mean Golden Retrievers or Tibetan Mastiffs?" as the corresponding response to the target question. In this way, by asking a follow-up question, the device can guide the user to accurately express their question, thereby ensuring that the most appropriate answer is provided to the user.

[0070] The question-answering method provided in this embodiment includes: obtaining a target question input by a user; and obtaining a response corresponding to the target question based on the stored content in a knowledge base. The stored content in the knowledge base includes: a knowledge graph, multiple question-answer pairs, and the association relationships between entities in the knowledge graph and the multiple question-answer pairs. Thus, when the target question raised by the user is relatively vague, for example, when the user's target question has a high similarity to known questions in multiple question-answer pairs, the response corresponding to the target question can be determined based on the association relationships between the entities associated with the multiple question-answer pairs, thereby improving the accuracy of the response returned to the user.

[0071] The following is combined Figure 6 The illustrated embodiments provide a more detailed description of the question-and-answer method provided in this application. This embodiment uses... Figure 5 The knowledge graph shown is used as an example for illustration.

[0072] Figure 6 This is a flowchart illustrating a question-and-answer method provided in another embodiment of this application. For example... Figure 6 As shown, the method in this embodiment includes:

[0073] S701: The target problem for obtaining user input.

[0074] The specific implementation method of S701 in this embodiment is the same as Figure 3 S301 in the illustrated embodiment is similar and will not be described again here.

[0075] For example, the target question entered by the user could be "How do I train a pet dog?", "How do I train a pet dog?", "What are the characteristics of a Golden Retriever?", "What are the characteristics of a pet dog?", etc.

[0076] S702: For each entity in the knowledge graph, determine the similarity between each entity and the target question based on the similarity between the question-answer pair associated with each entity and the target question.

[0077] For example, firstly, for each question-answer pair in the knowledge base, the similarity between each question-answer pair and the target question is calculated. It can be understood that this similarity refers to the semantic similarity between the known question and the target question in each question-answer pair. Combined with... Figure 5 The similarity between QA0001 to QA0004 and the target question can be calculated separately. Calculating the similarity between each question-answer pair and the target question is existing technology and can be done using existing semantic similarity calculation methods; this embodiment will not elaborate on this.

[0078] Then, for each entity in the knowledge graph associated with question-answer pairs, the similarity between each entity and the target question is determined based on the similarity between the question-answer pairs associated with each entity and the target question. For example, if an entity is associated with only one question-answer pair, the similarity between that question-answer pair and the target question is determined as the similarity between the entity and the target question. If an entity is associated with multiple question-answer pairs, the highest similarity is determined from the similarities between each of the multiple question-answer pairs associated with the entity and the target question, and this highest similarity is determined as the similarity between the entity and the target question.

[0079] S703: Identify a target entity in the knowledge graph, wherein the similarity between the target entity and the target question is greater than or equal to a preset threshold.

[0080] For example, entities in the knowledge graph are filtered by setting a preset threshold. Entities with low similarity to the target question are filtered out, and entities with a similarity to the target question greater than the preset threshold are identified as target entities. In this embodiment, the value of the preset threshold is not limited and can be set according to the actual application scenario. The preset threshold can be a fixed value or a dynamic value.

[0081] Combination Figure 5 When the target question is "What are the characteristics of a Golden Retriever?", the identified target entity can be "Golden Retriever characteristics". When the target question is "How should I train a pet dog?" or "How to train a pet dog?", the identified target entities can be "Golden Retriever training methods" and "Tibetan Mastiff training methods". When the target question is "What are the characteristics of a pet dog?", the identified target entities can be "Golden Retriever characteristics" and "Tibetan Mastiff characteristics".

[0082] S704: If the number of target entities is one, then obtain the response to the target question based on the question-answer pair associated with the target entity.

[0083] In this embodiment, when only one target entity is identified, it indicates that the semantics of the user's target question are relatively clear. In this case, the answer to the target question can be determined directly based on the question-and-answer pairs associated with the target entity. For example, if the target entity is associated with only one question-and-answer pair, the answer in that pair is directly used as the answer to the target question. If the target entity is associated with multiple question-and-answer pairs, the answer in the question-and-answer pair with the highest similarity to the target question is used as the answer to the target question.

[0084] Combination Figure 5When the target question is "What are the characteristics of a Golden Retriever?", the number of target entities identified is only one, namely "Golden Retriever characteristics". Since the target entity "Golden Retriever characteristics" is only associated with one question-answer pair QA0001, the answer in question-answer pair QA0001 can be used as the response to the target question.

[0085] It's understandable that if only one target entity is identified, it indicates that the semantics of the user's target question are relatively clear. The response obtained from the question-and-answer pairs associated with the target entity is the specific answer to that target question. In this case, multiple rounds of interaction are unnecessary.

[0086] S705: If there are multiple target entities, then each target entity is identified in the knowledge graph as a candidate path, and the response to the target question is obtained based on the relationship between entities in the identified multiple candidate paths.

[0087] In this context, a candidate path for a target entity is a path originating from a parent entity in the knowledge graph and leading to that target entity. A parent entity can also be called a superparent entity. In this embodiment, the parent entity can be the direct parent entity of the target entity or an indirect parent entity. For example: Figure 5 In the knowledge graph shown, the direct parent entity of "Golden Retriever trait" is "Golden Retriever", and the indirect parent entity is "Pet Dog". For the target entity "Golden Retriever trait", the corresponding candidate path can be "Golden Retriever -> Golden Retriever trait" or "Pet Dog -> Golden Retriever -> Golden Retriever trait".

[0088] In this embodiment, when multiple target entities are identified, it indicates that the semantics of the user's target question are relatively ambiguous. In this case, the response to the target question can be determined based on the candidate paths corresponding to each target entity. The response to the target question determined in this case is actually a rhetorical question used to further clarify the user's intent, rather than a specific answer to the target question. By using rhetorical questions, the user engages in multiple rounds of interaction with the question-and-answer device, guiding the user to accurately express their question, thereby ensuring that the most appropriate answer is provided to the user.

[0089] In one possible implementation, when multiple target entities are identified, the common parent entity of the target entities can be first determined in the knowledge graph. Then, the path from this common parent entity to each target entity is used as the candidate path for that target entity. For example, when the target question is "How do I train a pet dog?" or "How to train a pet dog?", the identified target entities would be "Golden Retriever training methods" and "Tibetan Mastiff training methods". Figure 6If the common parent entity of these two target entities in the knowledge graph is "pet dog", then two candidate paths are identified: "pet dog -> Golden Retriever -> Golden Retriever training method" and "pet dog -> Tibetan Mastiff -> Tibetan Mastiff training method".

[0090] After identifying candidate paths for each target entity, if these candidate paths include the same parent entity, a follow-up question can be generated based on the intermediate entities in each candidate path to further clarify the user's intent, and this follow-up question can be provided to the user. The intermediate entity is the entity located between the parent entity and the target entity in the candidate path. Figure 5 After identifying two candidate paths, "Pet Dog -> Golden Retriever -> Golden Retriever Training Method" and "Pet Dog -> Tibetan Mastiff -> Tibetan Mastiff Training Method," the system determines that a counter-question needs to be asked based on the second entity ("Golden Retriever" or "Tibetan Mastiff"). Therefore, it generates the counter-question, "Is your pet dog a Golden Retriever or a Tibetan Mastiff?" and provides it to the user. This allows the user to clearly articulate their question, enabling the question-and-answer device to accurately return the most desired answer. For example, if the user further inputs "Golden Retriever," the answer from the question-and-answer pair QA0002 associated with "Golden Retriever Training Method" is returned. If the user further inputs "Tibetan Mastiff," the answer from the question-and-answer pair QA0004 associated with "Tibetan Mastiff Training Method" is returned. If the user further inputs "Poodle," the system generates the message "Sorry, I cannot answer your question at this time."

[0091] Of course, in some application scenarios, there may be situations where multiple target entities do not share a common parent entity. In this scenario, the candidate paths corresponding to each target entity do not contain the same parent entity. In this case, separate questions can be generated for each of the multiple candidate paths.

[0092] In one possible implementation, multiple candidate paths can be traversed sequentially. For the parent entity of the target entity in each candidate path, a follow-up question can be generated to further clarify the user's intent, and this follow-up question can be provided to the user. Combined with... Figure 5Suppose that for the target question "What are some methods for training pet dogs?", two candidate paths are identified: "Golden Retriever -> Golden Retriever training methods" and "Tibetan Mastiff -> Tibetan Mastiff training methods". Then, we can generate follow-up questions for each of these candidate paths sequentially. For example, based on the parent entity in the first candidate path, we could generate the follow-up question "Is your pet dog a Golden Retriever?", and based on the parent entity in the second candidate path, we could generate the follow-up question "Is your pet dog a Tibetan Mastiff?". It's understandable that in practical applications, after the question-answering device presents the user with the first follow-up question "Is your pet dog a Golden Retriever?", if the user further inputs "Yes, it's a Golden Retriever", then there's no need to generate follow-up questions for subsequent candidate paths.

[0093] In another possible implementation, when asking questions about multiple candidate paths, the questions can be asked in a certain order, ensuring that each question presented to the user is one to which the user is highly likely to answer "yes." For example, the processing priority of multiple candidate paths is determined based on the similarity between the target entity and the target question in each candidate path. The processing priority of a candidate path is positively correlated with the similarity between the target entity and the target question in that candidate path. That is, the higher the similarity between the target entity and the target question in a candidate path, the higher the processing priority of that candidate path. Each time, the candidate path with the highest processing priority is selected from the multiple candidate paths. Based on the parent entity of the target entity in that candidate path, a question is generated to further clarify the user's intent, and this question is then provided to the user.

[0094] Another way to describe the above processing method is as follows: each time, a first candidate path is determined from multiple candidate paths, and the similarity between the target entity in the first candidate path and the target question is greater than or equal to the similarity between the target entity in other candidate paths and the target question; based on the parent entity of the target entity in the first candidate path, a rhetorical question is generated to further clarify the user's intent, and the rhetorical question is provided to the user.

[0095] The following example illustrates this. Suppose that for the target question "What are the characteristics of a pet dog?", two candidate paths are identified: "Golden Retriever -> Golden Retriever characteristics" and "Tibetan Mastiff -> Tibetan Mastiff characteristics". The similarity between "Golden Retriever characteristics" and the target entity is higher than that between "Tibetan Mastiff characteristics" and the target entity. Therefore, the processing priority of the two candidate paths is determined as: "Golden Retriever -> Golden Retriever characteristics" and "Tibetan Mastiff -> Tibetan Mastiff characteristics". First, for the candidate path with the highest processing priority, "Golden Retriever -> Golden Retriever characteristics", a follow-up question is generated: "Is your pet dog a Golden Retriever?", and this question is provided to the user. The candidate path with the highest processing priority is then removed. If the user's further input is "yes", the answer in the question-and-answer pair QA0001 associated with "Golden Retriever characteristics" is returned to the user. If the user's further input is "no", then based on the candidate path with the highest processing priority, "Tibetan Mastiff -> Tibetan Mastiff characteristics", a follow-up question is generated: "Is your pet dog a Tibetan Mastiff?", and this question is provided to the user. The candidate path with the highest processing priority is then removed. If the user enters "yes" in the next step, the answer in the question-and-answer pair QA0003 associated with "Tibetan Mastiff characteristics" will be returned to the user. If the user enters "no" in the next step, since there are no candidate paths available, the message "Sorry, I cannot answer your question at this time" will be generated and returned to the user.

[0096] Therefore, the question-and-answer method in this embodiment, when the user's target question is relatively vague, utilizes the association between different question-and-answer pairs indicated by the knowledge graph to generate a counter-question to clarify the user's intent. Through a multi-round question-and-answer interaction process, the user's intent is clarified, thereby returning the most appropriate answer to the user.

[0097] It should be noted that the question-and-answer method in this embodiment is applicable to all scenarios that require question-and-answer interaction through human-computer interaction. The above embodiment only uses the pet question-and-answer field as an example for illustration. The following example, from the IT operations and maintenance field, will further illustrate this point.

[0098] Figure 7 This is a schematic diagram illustrating a question-and-answer method provided in yet another embodiment of this application. For example... Figure 7 As shown, assuming the knowledge base stores many question-and-answer pairs for IT operations and maintenance scenarios, this embodiment will only use the "modify hosts" question-and-answer scenario as an example for ease of description. First, a knowledge graph is constructed, and the association between entities in the knowledge graph and question-and-answer pairs is established.

[0099] For example, in real-world question-and-answer scenarios, users ask questions in various forms, such as: "What is the path to the hosts file in Windows?", "How do I modify the hosts configuration in Linux?", etc. Analyzing these questions reveals that they typically fall into two categories of solutions, depending on the operating system (Windows or Linux). Therefore, this embodiment can construct solutions like... Figure 7 The knowledge graph shown. (For example...) Figure 7 As shown, the knowledge graph includes five entities: Entity 1 - Operating System, Entity 2 - Windows, Entity 3 - Linux, Entity 4 - How to modify Windows hosts, and Entity 5 - How to modify Linux hosts. Then, QA pairs from the knowledge base can be associated with the corresponding entities in the knowledge graph. See [link to relevant documentation]. Figure 7 Entity 4 is associated with QA0001 and QA0002, and entity 5 is associated with QA0011 and QA0012. Thus, using... Figure 7 The knowledge graph shown, along with the relationships between entities and question-answer pairs within it, forms a semantic network of question-answer pairs. Question-answering devices can use this semantic network to calculate the user's target question and guide the user to different solutions based on the operating system category, thereby obtaining the corresponding response to the target question.

[0100] Suppose the user's target question is "How to modify hosts?". In this embodiment, the similarity between the target question and each question-answer pair in the knowledge base is first calculated. Then, for each entity in the knowledge graph, the similarity between each entity and the target question is determined based on the similarity between the question-answer pairs associated with that entity and the target question (for example, the maximum similarity between the question-answer pairs associated with that entity and the target question is taken as the similarity between that entity and the target question). Then, based on a preset threshold, entities 4 and 5 are determined to have a high similarity to the target question, and are therefore designated as target entities.

[0101] After identifying the target entities as Entity 4 and Entity 5, the common parent entity of Entity 4 and Entity 5, namely Entity 1 - Operating System, is obtained, resulting in two candidate paths: Entity 1 -> Entity 2 -> Entity 4 and Entity 1 -> Entity 3 -> Entity 5. Based on the hierarchical relationship of the entities in these two candidate paths, it is determined that a question needs to be asked based on Entity 1 (Operating System). The question content is the value of the lower-level entity of Entity 1 (Operating System) (i.e., Entity 2 - Windows and Entity 3 - Linux). Therefore, the question "Is your operating system Windows or Linux?" is generated and returned to the user to further clarify the user's intent. When the user inputs further information in response to the question, this information is used as supplementary information for the target question, making the meaning of the target question clearer. This method is repeated until a unique target entity is obtained. The answer from the question-and-answer pair with the highest similarity between the target entity and the target question is then returned to the user as the final answer.

[0102] In this embodiment, if a traditional IRQA scheme is used, the semantics of the user's target question, "How to modify hosts?", are relatively ambiguous, resulting in high similarity between the target question and multiple question-answer pairs. Consequently, only one answer from a question-answer pair can be randomly selected for return, or a large number of redundant answers from question-answer pairs can be returned to the user for selection, leading to a poor question-answering experience. This embodiment, however, supplements the semantic information of the question-answer pairs by introducing a knowledge graph. By utilizing the relationships between entities in the knowledge graph to further inquire about the user's intent, it can return more accurate answers to the user, thus improving the question-answering effect.

[0103] Figure 8 This is a schematic diagram of a question-and-answer device provided in one embodiment of this application. The question-and-answer device in this embodiment can be in the form of software and / or hardware. For example... Figure 8 As shown, the question-answering device 900 of this embodiment includes: a communication unit 901, a processing unit 902, and a knowledge base 903.

[0104] The communication unit 901 is used to acquire the target question input by the user; the processing unit 902 is used to acquire the response corresponding to the target question according to the stored content in the knowledge base 903; wherein the stored content in the knowledge base 903 includes: a knowledge graph, multiple question-answer pairs, and the association relationship between entities in the knowledge graph and the multiple question-answer pairs, and each question-answer pair includes a known question and the answer corresponding to the known question.

[0105] In one possible implementation, the processing unit 902 is specifically used to: obtain the response corresponding to the target question based on the similarity between the question-answer pairs associated with each entity in the knowledge graph and the target question, as well as the association relationship between each entity in the knowledge graph.

[0106] In one possible implementation, the processing unit 902 is specifically configured to: for each entity in the knowledge graph, determine the similarity between each entity and the target question based on the similarity between the question-answer pair associated with each entity and the target question; identify a target entity in the knowledge graph, wherein the similarity between the target entity and the target question is greater than or equal to a preset threshold; if there are multiple target entities, determine the candidate path corresponding to each target entity in the knowledge graph, and obtain the response corresponding to the target question based on the association relationship between entities in the determined multiple candidate paths; wherein, a candidate path corresponding to a target entity is a path from a parent entity in the knowledge graph to the target entity.

[0107] In one possible implementation, the processing unit 902 is further configured to: if the number of target entities is one, obtain the response to the target question based on the question-answer pair associated with the target entity.

[0108] In one possible implementation, the processing unit 902 is specifically configured to: if the determined multiple candidate paths include the same parent entity, generate a rhetorical question to further clarify the user's intent based on the intermediate entity in each candidate path, and provide the rhetorical question to the user; wherein the intermediate entity is located between the parent entity and the target entity in the candidate path.

[0109] In one possible implementation, the processing unit 902 is specifically configured to: if the determined multiple candidate paths do not include the same parent entity, generate a rhetorical question to further clarify the user's intent based on the parent entity of the target entity in at least one of the multiple candidate paths, and provide the rhetorical question to the user.

[0110] In one possible implementation, the processing unit 902 is specifically configured to: if an entity is associated with one question-answer pair, determine the similarity between the question-answer pair associated with the entity and the target question as the similarity between the entity and the target question; if an entity is associated with multiple question-answer pairs, determine the highest similarity from the similarities between the multiple question-answer pairs associated with the entity and the target question, and determine the highest similarity as the similarity between the entity and the target question.

[0111] The question-and-answer device in this embodiment can be used to implement the question-and-answer method in any of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0112] Figure 9 This is a schematic diagram of the structure of a question-and-answer device provided in one embodiment of this application. Figure 9 As shown, the question-and-answer device 1000 of this embodiment includes a processor 1001 and a memory 1002.

[0113] The memory 1002 is used to store computer programs; the processor 1001 is used to execute the computer programs stored in the memory 1002 to implement the question-and-answer method in the above method embodiments.

[0114] Optionally, the memory 1002 can be either standalone or integrated with the processor 1001. When the memory 1002 is a device independent of the processor 1001, the controller 1000 may further include a bus 1005 for connecting the memory 1002 and the processor 1001.

[0115] In one possible implementation, Figure 8 The communication unit 901 and the processing unit 902 can be integrated into the processor 1001. Figure 8 The knowledge base 903 can be stored in the memory 1002.

[0116] In one possible implementation, the question-and-answer device 1000 may further include an input device 1003 and an output device 1004. The processor 1001, memory 1002, input device 1003, and output device 1004 may be connected via a bus or other means. Figure 9 Taking a bus connection as an example, input device 1003 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the question-and-answer device, such as touch screen, keypad, mouse, trackpad, touchpad, pointer, one or more mouse buttons, trackball, joystick, microphone, etc. Output device 1004 may include display device, speaker, auxiliary lighting device, and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, liquid crystal display, light-emitting diode display, and plasma display. In some embodiments, the display device may be a touch screen.

[0117] The question-and-answer device provided in this embodiment can be used to execute the question-and-answer method in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.

[0118] This application provides a computer-readable storage medium, which includes a computer program for implementing the question-and-answer method in the above method embodiments.

[0119] This application also provides a chip, including a memory and a processor. The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a device equipped with the chip performs the question-and-answer method in the above method embodiments.

[0120] This application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute the question-and-answer method in the above method embodiments.

[0121] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

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

[0123] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0124] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application.

[0125] It should be understood that the aforementioned processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0126] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0127] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0128] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0129] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in application-specific integrated circuits (ASICs). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.

Claims

1. A question and answer method, characterized by, include: The target question for obtaining user input; Based on the stored content in the knowledge base, the answer corresponding to the target question is obtained; wherein, the stored content in the knowledge base includes: a knowledge graph, multiple question-answer pairs, and the association relationship between entities in the knowledge graph and the multiple question-answer pairs, each question-answer pair includes a known question and the answer corresponding to the known question; the association relationship is established in the following way: based on the entity described by each question-answer pair, the question-answer pair is associated with the corresponding entity in the knowledge graph; The step of obtaining the answer to the target question based on the stored content in the knowledge base includes: For each entity in the knowledge graph, the similarity between each entity and the target question is determined based on the similarity between the question-answer pair associated with each entity and the target question. In the knowledge graph, a target entity is identified, and the similarity between the target entity and the target question is greater than or equal to a preset threshold. If there are multiple target entities, then each target entity is identified in the knowledge graph as a candidate path. Based on the relationships between entities in the identified multiple candidate paths, the response to the target question is obtained. Among them, the candidate path corresponding to a target entity is the path from the parent entity in the knowledge graph to the target entity.

2. The method according to claim 1, characterized in that, After identifying the target entity in the knowledge graph, the method further includes: If the number of target entities is one, then the response to the target question is obtained based on the question-answer pair associated with the target entity.

3. The method according to claim 1 or 2, characterized in that, The step of obtaining the response to the target question based on the relationships between entities in the determined multiple candidate paths includes: If multiple candidate paths identified include the same parent entity, then based on the intermediate entities in each candidate path, a rhetorical question is generated to further clarify the user's intent, and the rhetorical question is provided to the user; wherein, the intermediate entity is located between the parent entity and the target entity in the candidate path.

4. The method according to claim 1 or 2, characterized in that, The step of obtaining the response to the target question based on the relationships between entities in the determined multiple candidate paths includes: If the identified candidate paths do not include the same parent entity, then based on the parent entity of the target entity in at least one of the candidate paths, a rhetorical question is generated to further clarify the user's intent, and the rhetorical question is provided to the user.

5. A question answering apparatus characterized by comprising: include: Communication unit, processing unit, and knowledge base; among which, The communication unit is used to acquire the target question input by the user; The processing unit is configured to obtain the response corresponding to the target question based on the stored content in the knowledge base; wherein, the stored content in the knowledge base includes: a knowledge graph, multiple question-answer pairs, and the association relationship between entities in the knowledge graph and the multiple question-answer pairs, each question-answer pair including a known question and the answer corresponding to the known question; the association relationship is established in the following way: based on the entity described by each question-answer pair, the question-answer pair is associated with the corresponding entity in the knowledge graph; The processing unit is specifically used for: For each entity in the knowledge graph, the similarity between each entity and the target question is determined based on the similarity between the question-answer pair associated with each entity and the target question. In the knowledge graph, a target entity is identified, and the similarity between the target entity and the target question is greater than or equal to a preset threshold. If there are multiple target entities, then each target entity is identified in the knowledge graph as a candidate path. Based on the relationships between entities in the identified multiple candidate paths, the response to the target question is obtained. Among them, the candidate path corresponding to a target entity is the path from the parent entity in the knowledge graph to the target entity.

6. The apparatus of claim 5, wherein, The processing unit is also specifically used for: If the number of target entities is one, then the response to the target question is obtained based on the question-answer pair associated with the target entity.

7. The apparatus of claim 5 or 6, wherein, The processing unit is specifically used for: If multiple candidate paths identified include the same parent entity, then based on the intermediate entities in each candidate path, a rhetorical question is generated to further clarify the user's intent, and the rhetorical question is provided to the user; wherein, the intermediate entity is located between the parent entity and the target entity in the candidate path.

8. The apparatus of claim 5 or 6, wherein, The processing unit is specifically used for: If the identified candidate paths do not include the same parent entity, then based on the parent entity of the target entity in at least one of the candidate paths, a rhetorical question is generated to further clarify the user's intent, and the rhetorical question is provided to the user.

9. A question-and-answer device, characterized in that, include: A memory and a processor, the memory for storing a computer program, and the processor for calling and running the computer program from the memory, such that the processor runs the computer program to perform the method as described in any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program for implementing the method as described in any one of claims 1 to 4.