Question answering method and device based on knowledge graph, equipment and storage medium

By identifying the intent type and relevance set of user questions to determine the target path in the knowledge graph, the problem of missing head entities is solved, and an efficient and accurate question-answering system is achieved, which is suitable for multi-turn question-answering scenarios.

CN116126999BActive Publication Date: 2026-04-17MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MASHANG CONSUMER FINANCE CO LTD
Filing Date
2022-08-05
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing knowledge graph-based question answering systems cannot accurately determine the answer when the head entity in the user's question is missing, resulting in question answering failure. Furthermore, existing models have high requirements for training samples, high manual annotation costs, and poor performance when the number of samples is small.

Method used

By identifying the intent type of user questions and determining the target path in the knowledge graph based on the relevance set, the answer information of user questions can be obtained, avoiding the judgment of missing head entities, and using multi-turn question answering to obtain missing information.

Benefits of technology

It improves the accuracy and efficiency of question answering in cases where the head entity is missing, reduces resource consumption, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126999B_ABST
    Figure CN116126999B_ABST
Patent Text Reader

Abstract

This application provides a knowledge graph-based question-answering method, apparatus, device, and storage medium, relating to the field of artificial intelligence technology. The knowledge graph-based question-answering method includes: acquiring user question information and a question-answering knowledge graph; identifying the intent type corresponding to the user question information, including object list questions and object attribute questions; acquiring a first relevance set between the user question information and a preset object list, and acquiring a second relevance set between the user question information and a preset object attribute list; if both the first and second relevance sets satisfy a relevance condition, determining a target path in the question-answering knowledge graph based on the intent type, the first relevance set, and the second relevance set; and acquiring the response information corresponding to the user question information based on the target path. This application can obtain answers to user questions more accurately.
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, device, and storage medium based on knowledge graphs. Background Technology

[0002] Knowledge-based question answering (KBQA) leverages the rich semantic relationships within knowledge graphs to deeply understand user questions and provide answers. Knowledge graphs are typically represented by triples: a head entity, a relation, and a tail entity. KBQA is gaining increasing popularity due to its powerful interconnectivity, information retrieval, and knowledge reasoning capabilities.

[0003] Currently, in the application of KBQA, information retrieval is usually adopted. This involves obtaining entity mentions (including head entities) in the user's question, linking these entity mentions to entity nodes in the knowledge graph to obtain linked entities, querying the knowledge graph based on the linked entities to obtain candidate paths, and then ranking the user's question according to the similarity between the user's question and the candidate paths to obtain the answer corresponding to the user's question.

[0004] Clearly, the above methods are only applicable when the user's question contains entity references. If no head entity is identified in the user's question, these methods cannot be used to determine the answer. Therefore, finding a universally applicable and efficient question-answering solution has become one of the most pressing issues in the knowledge graph-based question-answering field. Summary of the Invention

[0005] This application provides a knowledge graph-based question answering method, apparatus, device, and storage medium, which realizes universal and efficient knowledge graph-based question answering.

[0006] Firstly, this application provides a question-answering method based on knowledge graphs, including:

[0007] Obtain user question information and question-answer knowledge graph. The question-answer knowledge graph is used to reflect the relationship between objects, object attributes, and object channels.

[0008] Identify the intent type corresponding to the user's question information. The intent types include object list questions and object attribute questions. Object list questions are used to represent that the response information corresponding to the user's question information contains at least one object. Object attribute questions are used to represent that the response information corresponding to the user's question information contains one object attribute.

[0009] Obtain a first relevance set between user question information and a preset object list, and obtain a second relevance set between user question information and a preset object attribute list; the first relevance set includes the relevance between user question information and each object in the preset object list, and the second relevance set includes the relevance between user question information and each object attribute in the preset object attribute list;

[0010] If both the first relevance set and the second relevance set satisfy the relevance condition, then the target path is determined in the question-answering knowledge graph based on the intent type, the first relevance set, and the second relevance set.

[0011] Based on the target path, obtain the response information corresponding to the user's question.

[0012] Secondly, this application provides a question-answering device based on a knowledge graph, comprising:

[0013] The acquisition module is used to acquire user question information and question-answer knowledge graph. The question-answer knowledge graph is used to reflect the relationship between objects, object attributes, and object channels.

[0014] The identification module is used to identify the intent type corresponding to the user's question information. The intent types include object list questions and object attribute questions. Object list questions are used to indicate that the response information corresponding to the user's question information contains at least one object; object attribute questions are used to indicate that the response information corresponding to the user's question information contains one object attribute.

[0015] The acquisition module is also used to acquire a first relevance set between user question information and a preset object list, and to acquire a second relevance set between user question information and a preset object attribute list; the first relevance set includes the relevance between user question information and each object in the preset object list, and the second relevance set includes the relevance between user question information and each object attribute in the preset object attribute list;

[0016] The processing module is used to determine the target path in the question-answering knowledge graph based on the intent type, the first relevance set, and the second relevance set if both the first relevance set and the second relevance set satisfy the relevance condition.

[0017] The acquisition module is also used to obtain the answer information corresponding to the user's question information based on the target path.

[0018] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0019] The memory stores the instructions that the computer executes;

[0020] The processor executes computer execution instructions stored in memory to implement the knowledge graph-based question-answering method as described in the first aspect of this application.

[0021] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the knowledge graph-based question-answering method as described in the first aspect of this application.

[0022] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the knowledge graph-based question-answering method as described in the first aspect of this application.

[0023] The knowledge graph-based question-answering method, apparatus, device, and storage medium provided in this application obtain a first relevance set between user question information and a preset object list, and a second relevance set between user question information and a preset object attribute list. The first relevance set includes the relevance between user question information and each object in the preset object category, and the second relevance set includes the relevance between user question information and each object attribute in the preset object attribute list. It should be understood that a higher relevance between user question information and any object indicates that the user question information may include that object; similarly, a higher relevance between user question information and any object attribute indicates that the user question information may include that object attribute.

[0024] Furthermore, determining whether the first and second relevance sets satisfy the relevance conditions, based on the foregoing, essentially involves determining whether object information is missing from the user question information based on the relevance between the user question information and each object, and determining whether object attribute information is missing from the user question information based on the relevance between the user question and each object attribute. Compared to existing technologies, determining whether there is missing information in the user question information through the above method, rather than extracting header entity information, avoids the situation where accurate judgment cannot be made due to the absence of header entity information, thereby improving the accuracy of determining whether specific types of information are missing from the user question information.

[0025] If both the first and second relevance sets satisfy the relevance condition, the target path is determined in the question-answering knowledge graph based on the intent type corresponding to the identified user question information, the first relevance set, and the second relevance set. The intent type includes object list questions and object attribute questions. This application can more accurately understand the intent of user questions while ensuring that no object information or object attribute information is missing. Therefore, based on the target path determined in the question-answering knowledge graph, the corresponding response information (i.e., the answer) can be obtained more accurately. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a schematic diagram illustrating an application scenario provided in one embodiment of this application;

[0028] Figure 2 A flowchart illustrating a knowledge graph-based question-answering method provided in an embodiment of this application;

[0029] Figure 3 A schematic diagram of an RDF knowledge graph provided in an embodiment of this application;

[0030] Figure 4 A flowchart of a knowledge graph-based question-answering method provided in another embodiment of this application;

[0031] Figure 5 A schematic diagram of the structure of a knowledge graph-based question-answering device provided in an embodiment of this application;

[0032] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0034] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0035] The main task of KBQA is to map Natural Language Query (NLQ) queries to structured queries using different methods and obtain answers from a knowledge graph. Transforming knowledge graphs from single-turn question answering to multi-turn question answering is a challenge in knowledge graph question answering tasks. In one related technique, when performing question answering based on a knowledge graph, the process involves: obtaining entity mentions (including head entities) from the user's question; linking these entity mentions to entity nodes in the knowledge graph to obtain linked entities; querying the knowledge graph based on these linked entities to obtain at least one query path and candidate answers for each query path; determining the most suitable query path based on the similarity between each query path and the user's question; and finally obtaining the final answer to the user's question based on the candidate answers corresponding to the most suitable query path. However, when the head entity in the user's question is not identified, i.e., when the semantic information related to the head entity is missing, the system does not further query the user for entity information, resulting in the inability to obtain the final answer to the user's question.

[0036] Another related technology constructs a question-predicate sequence dataset based on a knowledge graph by using question-answer training samples from a question-answer training set, and then trains a predicate sequence detector. For a question to be answered, the predicate sequence detector first identifies the predicate sequence of the question. A core path is constructed using the question's focus words, predicate sequence, and entity label values. Then, by analyzing the question identification constraints, a query path is constructed based on the core path. The final answer is selected according to the question and the candidate answers and query paths obtained from the core path. However, this related technology relies on the predicate sequence detector to mine information about the question and obtain the query path, without considering the question type. For example, the question type is not templated, and single or multiple path answers are returned depending on the question type. In addition, current knowledge graph-based question answering models have the problems of high requirements for training samples, high cost of manual annotation, and poor performance when the number of training samples is small.

[0037] To address the aforementioned problems, this application provides a knowledge graph-based question-answering method, apparatus, device, and storage medium. It identifies the intent type corresponding to the user's question based on the question information; based on a first relevance set between the user's question information and a preset object list, and a second relevance set between the user's question information and a preset object attribute list, when both the first and second relevance sets satisfy the relevance condition, it determines the target path in the knowledge graph, thereby determining the corresponding response information, i.e., the answer to the user's question; it can also further ask the user follow-up questions based on missing information in the user's question information, realizing multi-turn question-answering based on the knowledge graph. Therefore, it can accurately understand the intent of the question, greatly narrow down the range of answer choices, ensure the correctness of the answer, and save resource consumption.

[0038] The following section provides examples illustrating the application scenarios of the solution provided in this application.

[0039] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 1 As shown, in this application scenario, a user inputs a question related to a product (such as an insurance product) via mobile phone 101. Mobile phone 101 sends the question to server 102. Server 102 determines the corresponding answer based on the question and sends the answer to mobile phone 101. Mobile phone 101 displays the answer to the user. The specific implementation process of server 102 determining the answer based on the question can be found in the solutions of the following embodiments.

[0040] It should be noted that, Figure 1 This is merely a schematic diagram illustrating one application scenario provided by an embodiment of this application. This embodiment of the application does not necessarily represent... Figure 1 The included equipment is not limited, nor is it restricted. Figure 1 The positional relationships between devices are defined. For example, in Figure 1 The application scenario shown may also include a data storage device, which may be an external storage device relative to the server 102 or an internal storage device integrated into the server 102.

[0041] Next, we will introduce a question-answering method based on knowledge graphs through specific examples.

[0042] Figure 2 This is a flowchart illustrating a knowledge graph-based question-answering method according to an embodiment of this application. The method described in this embodiment can be applied to an electronic device, such as a server or server cluster. Figure 2 As shown, the method in this application embodiment includes:

[0043] S201. Obtain user question information and question-answer knowledge graph.

[0044] Among them, the question-answering knowledge graph is used to reflect the relationship between objects, object attributes, and object channels.

[0045] In this step, the user question information can be input by the user to the electronic device executing this method embodiment, or it can be sent by other devices to the electronic device executing this method embodiment. For example, the user question information could be "How do I buy health insurance?". Exemplarily, if the object is a product, the object attribute is a product attribute, and the object channel is a product channel, then the question-and-answer knowledge graph reflects the relationship between the product, product attribute, and product channel. It can be understood that different paths can be obtained in the question-and-answer knowledge graph based on the different relationships between products, product attributes, and product channels. Simply put, a product, a product attribute, and a product channel constitute a path in the question-and-answer knowledge graph. Or, a product and a product attribute or a product channel constitute a path in the question-and-answer knowledge graph.

[0046] For example, a question-answering knowledge graph could be a Resource Description Framework (RDF) knowledge graph. Figure 3 This is a schematic diagram of an RDF knowledge graph provided in an embodiment of this application, as shown below. Figure 3 The diagram illustrates the inclusion relationships between different nodes; for example, car insurance is the product, underwriting conditions are product attributes, and offline or public accounts are product channels. From... Figure 3 As can be seen, the RDF knowledge graph mainly reflects the relationship between products, product attributes, and product channels. Specifically, car insurance includes two product channels: offline and WeChat official accounts. According to different product channels, there are different types of commercial motor vehicle insurance, and each type of commercial motor vehicle insurance includes different product attributes (such as underwriting conditions).

[0047] S202. Identify the intent type corresponding to the user's question information. The intent types include object list questions and object attribute questions.

[0048] Among them, the object list is used to represent that the response information corresponding to the user's question information contains at least one object; the object attribute is used to represent that the response information corresponding to the user's question information contains an object attribute.

[0049] For example, taking insurance products as an example, in an insurance scenario, user questions may contain one-to-one or one-to-many statements. In one example, a user question might be "How do I buy health insurance?", where the user is asking how to purchase health insurance (the object). However, health insurance includes multiple insurance products such as "XX Medical Insurance" and "XX Million Medical Insurance." In this case, the system would return the purchase methods for all products under the health insurance category. This type of question is defined as a product list question, i.e., an object list question. In another example, a user question might be "Can I buy third-party liability insurance?", where the system could directly return the product attribute value corresponding to the identified insurance product. This type of question is defined as a product attribute question, i.e., an object attribute question. Identifying the intent type corresponding to user question information is a binary classification problem. Current related technologies can be referenced to identify the intent type corresponding to user questions. For details on how to identify the intent type corresponding to user question information, please refer to subsequent embodiments; they will not be elaborated here.

[0050] S203. Obtain the first relevance set between user question information and a preset object list, and obtain the second relevance set between user question information and a preset object attribute list.

[0051] The first relevance set includes the relevance between user question information and each object in the preset object list, and the second relevance set includes the relevance between user question information and each object attribute in the preset object attribute list.

[0052] In this step, the preset object list can be understood as a pre-determined range of objects, containing multiple different objects; the preset object attribute list can be understood as a pre-determined range of object attributes, containing multiple different object attributes. For example, the preset object list could be a preset product list, and the preset object attribute list could be a preset product attribute list. The relevance between the user's question information and each product in the preset product list can be obtained to obtain a first relevance set, and the relevance between the user's question information and each product attribute in the preset product attribute list can be obtained to obtain a second relevance set.

[0053] Optionally, the first relevance set can be sorted according to the relevance between the user's question information and each object in the preset object list, with the specific relevance expressed as confidence level, for example. Similarly, the second relevance set can be sorted according to the relevance between the user's question information and each attribute in the preset object attribute list, with the specific relevance expressed as confidence level, for example. For details on how to obtain the first relevance set between the user's question information and the preset object list, and the second relevance set between the user's question information and the preset object attribute list, please refer to subsequent embodiments; these will not be elaborated upon here.

[0054] It should be noted that this application does not restrict the order in which steps S202 and S203 are executed. That is, step S202 can be executed first and then step S203 can be executed, or step S203 can be executed first and then step S202 can be executed.

[0055] S204. If both the first relevance set and the second relevance set satisfy the relevance condition, then the target path is determined in the question-answering knowledge graph based on the intent type, the first relevance set, and the second relevance set.

[0056] It should be understood that the relevance condition is essentially used to determine whether there exists a relevance in the first relevance set, the object corresponding to which may belong to the user's question information. If it exists, it means that the user's question information does not lack object information. Similarly, the relevance condition is also used to determine whether there exists a relevance in the second relevance set, the object attribute corresponding to which may belong to the user's question information. If it exists, it means that the user's question information does not lack object attribute information.

[0057] In summary, relevance criteria are essentially used to determine whether the user's question is missing object information or object attribute information.

[0058] In one possible implementation, the relevance condition includes a first relevance threshold and a second relevance threshold. The knowledge graph-based question-answering method provided in this application embodiment may further include: if the maximum relevance in the first relevance set is greater than or equal to the first relevance threshold, then the first relevance set is determined to satisfy the relevance condition; if the maximum relevance in the first relevance set is less than the first relevance threshold, then the first relevance set is determined not to satisfy the relevance condition; if the maximum relevance in the second relevance set is greater than or equal to the second relevance threshold, then the second relevance set is determined to satisfy the relevance condition; if the maximum relevance in the second relevance set is less than the second relevance threshold, then the second relevance set is determined not to satisfy the relevance condition.

[0059] This application does not limit the specific values ​​of the first relevance threshold and the second relevance threshold. For example, after obtaining the first relevance set, the relevance values ​​in the first relevance set can be sorted in descending order to determine the maximum relevance value in the first relevance set. After obtaining the second relevance set, the relevance values ​​in the second relevance set can be sorted in descending order to determine the maximum relevance value in the second relevance set.

[0060] Therefore, it can be determined whether the maximum relevance in the first relevance set is greater than or equal to the first relevance threshold, and it can also be determined whether the maximum relevance in the second relevance set is greater than or equal to the second relevance threshold. If the maximum relevance in the first relevance set is less than the first relevance threshold, then the first relevance set does not meet the relevance condition; if the maximum relevance in the second relevance set is greater than or equal to the second relevance threshold, then the second relevance set meets the relevance condition; if the maximum relevance in the second relevance set is less than the second relevance threshold, then the second relevance set does not meet the relevance condition.

[0061] In another possible implementation, the relevance condition includes a first quantity and a second quantity. The knowledge graph-based question-answering method provided in this application embodiment may further include: if the number of relevances in the first relevance set that is greater than or equal to a third relevance threshold is greater than or equal to the first quantity, then the first relevance set is determined to satisfy the relevance condition; if the number of relevances in the first relevance set that is greater than or equal to the third relevance threshold is less than the first quantity, then the first relevance set is determined not to satisfy the relevance condition; if the number of relevances in the second relevance set that is greater than or equal to the third relevance threshold is greater than or equal to the second quantity, then the second relevance set is determined to satisfy the relevance condition; if the number of relevances in the second relevance set that is greater than or equal to the third relevance threshold is less than the second quantity, then the second relevance set is determined not to satisfy the relevance condition.

[0062] This application does not limit the specific values ​​of the first quantity, the second quantity, and the third relevance threshold. For example, after obtaining the first relevance set, the relevance values ​​in the first relevance set can be sorted in descending order to determine the number of relevance values ​​in the first relevance set that are greater than or equal to the third relevance threshold. After obtaining the second relevance set, the relevance values ​​in the second relevance set can be sorted in descending order to determine the number of relevance values ​​in the second relevance set that are greater than or equal to the third relevance threshold. Therefore, it can be determined whether the number of relevance values ​​in the first relevance set that are greater than or equal to the third relevance threshold is greater than or equal to the first quantity, and it can be determined whether the number of relevance values ​​in the second relevance set that are greater than or equal to the third relevance threshold is greater than or equal to the second quantity. If the number of relevance values ​​in the first relevance set that are greater than or equal to the third relevance threshold is greater than or equal to the first number, then the first relevance set is determined to meet the relevance condition. If the number of relevance values ​​in the first relevance set that are greater than or equal to the third relevance threshold is less than the first number, then the first relevance set is determined not to meet the relevance condition. If the number of relevance values ​​in the second relevance set that are greater than or equal to the third relevance threshold is greater than or equal to the second number, then the second relevance set is determined to meet the relevance condition. If the number of relevance values ​​in the second relevance set that are greater than or equal to the third relevance threshold is less than the second number, then the second relevance set is determined not to meet the relevance condition.

[0063] S205. Based on the target path, obtain the response information corresponding to the user's question information.

[0064] In this step, after determining the target path, the corresponding answer information can be obtained based on the target path, i.e., the answer to the user's question can be obtained. For details on how to obtain the answer information based on the target path, please refer to subsequent embodiments; it will not be repeated here. After obtaining the answer to the user's question, the answer can be output so that the user can view it.

[0065] The knowledge graph-based question-answering method provided in this application obtains a first relevance set between user question information and a preset object list, and a second relevance set between user question information and a preset object attribute list. The first relevance set includes the relevance between user question information and each object in the preset object category, and the second relevance set includes the relevance between user question information and each object attribute in the preset object attribute list. It should be understood that the greater the relevance between user question information and any object, the more likely that user question information includes that object; similarly, the greater the relevance between user question information and any object attribute, the more likely that user question information includes that object attribute. Further, it determines whether the first and second relevance sets meet the relevance conditions. Based on the foregoing, determining whether the first and second relevance sets meet the relevance conditions essentially involves determining whether object information is missing from the user question information based on the relevance between user question information and each object, and determining whether object attribute information is missing from the user question information based on the relevance between user question information and each object attribute. Compared to existing technologies, determining whether user questions are missing information through the above method, rather than extracting head entity information, avoids situations where accurate judgment is impossible due to the absence of head entity information, thereby improving the accuracy of determining whether specific types of information are missing from user questions. If both the first and second relevance sets satisfy the relevance condition, a target path is determined in the question-and-answer knowledge graph based on the identified intent type of the user question, the first relevance set, and the second relevance set. The intent type includes object list questions and object attribute questions. This application embodiment can more accurately understand the intent of user questions while ensuring that no object information or object attribute information is missing. Therefore, based on the target path determined in the question-and-answer knowledge graph, it can more accurately obtain the corresponding response information (i.e., the answer) for the user question, improving the user experience.

[0066] Based on the above embodiments, the user question information includes the question information entered by the user in one round of question and answer and the response information entered by the user in response to a preset rhetorical question in multiple rounds of question and answer. If the user question information is the response information entered by the user in response to a preset rhetorical question in multiple rounds of question and answer, then obtaining the user question information may include: obtaining initial user question information; the initial user question information is the question information entered by the user in one round of question and answer, or the response information entered by the user in response to a preset rhetorical question in the previous multiple rounds of question and answer; obtaining a first initial relevance set between the initial user question information and a preset object list, and obtaining the initial user question information. The system firstly sets the relevance between the information and the preset object attribute list. If the first or second initial relevance set does not meet the relevance condition, a multi-round question-and-answer approach is adopted to send the user a corresponding preset rhetorical question. The preset rhetorical question is used to prompt the user to provide object information. The user's response to the preset rhetorical question is used as the initial user question information, and the step of obtaining the first initial relevance set between the initial user question information and the preset object list is executed. If both the first and second initial relevance sets meet the relevance condition, the initial user question information is used as the user question information.

[0067] In this embodiment, if the first relevance set between the initial user question information (which is the question information input by the user in a round of question-and-answer) and the preset object list, as well as the second relevance set between the initial user question information and the preset object attribute list, both satisfy the relevance condition, then the response information corresponding to the user question information can be obtained through this round of question-and-answer; that is, the initial user question information can be used as user question information. If the first relevance set obtained based on the initial user question information does not satisfy the relevance condition, or the second relevance set obtained based on the initial user question information does not satisfy the relevance condition, then a multi-round question-and-answer approach is needed to obtain user question information containing explicit object information or object attribute information. The initial user question information is the response information input by the user in response to a preset rhetorical question in the previous multi-round question-and-answer. In multi-round question-and-answer sessions, a corresponding preset rhetorical question is posed to the user. The user's response to the preset rhetorical question is used as the initial user question information. A first initial relevance set between the initial user question information and a preset object list, and a second initial relevance set between the initial user question information and preset object attribute columns are obtained. This process continues until both the first and second initial relevance sets satisfy the relevance condition, at which point the initial user question information is used as the user question information. It can be understood that the first initial relevance set is the first relevance set in the above embodiment, and the second initial relevance set is the second relevance set in the above embodiment.

[0068] Figure 4This is a flowchart illustrating a knowledge graph-based question-answering method according to another embodiment of this application. Based on the above embodiments, this application further describes the knowledge graph-based question-answering method. Figure 4 As shown, the method in this application embodiment may include:

[0069] S401. Obtain user question information and question-answer knowledge graph.

[0070] For a detailed description of this step, please refer to [link / reference]. Figure 2 The relevant description of S201 in the illustrated embodiment will not be repeated here.

[0071] S402. Input the user's question information into the intent model and identify the intent type corresponding to the user's question information. The intent types include object list questions and object attribute questions.

[0072] In this step, the intent model may employ a Bidirectional Encoder Representations from Transformers (BERT) as a classification model to handle binary classification problems; this application is not limited to this. For example, referring to the example in step S202, taking insurance products as an example, for product list questions or product attribute questions in an insurance scenario, inputting the user question information into the intent model can identify the intent type corresponding to the user question information. Intent types include object list questions and object attribute questions. Table 1 shows the training data of the intent model provided in an embodiment of this application. As shown in Table 1, the training data includes user question samples and corresponding labels. The labels indicate the intent type corresponding to the user question samples, including product list questions (i.e., object list questions) and product attribute questions (i.e., object attribute questions).

[0073] Table 1

[0074] User Question Sample Label How much is the premium this year? Can I find that information? Product list question Do you sell health insurance? Product list question Which insurance policy is more suitable for parents? Product list question Can I buy third-party liability insurance? Product attributes question Can I buy motorcycle insurance? Product attributes question Can't buy compulsory traffic accident liability insurance online? Product attributes question

[0075] S403. Concatenate the user's question information with each object in the preset object list to obtain the concatenated first text pair; input the first text pair into the relevance model to calculate the relevance and obtain the first relevance set.

[0076] For example, assuming the user's question is "I want to buy compulsory traffic accident liability insurance for my motorcycle," and the preset object list includes objects such as compulsory traffic accident liability insurance and health insurance, the user's question is concatenated with each object in the preset object list according to a preset format to obtain the first concatenated text pair. The first text pair might be: [CLS] I want to buy compulsory traffic accident liability insurance for my motorcycle [SEP] Compulsory traffic accident liability insurance [SEP]. [SEP] separates the user's question and each object in the preset object list. [CLS] is used to output the relevance between the user's question and each object in the preset object list, with a relevance value between 0 and 1. The first text pair is then input into a relevance model for relevance calculation to obtain the first relevance set. For details on how to obtain the relevance model, please refer to subsequent embodiments; details will not be elaborated here.

[0077] S404. Concatenate the user's question information with each object attribute in the preset object attribute list to obtain a concatenated second text pair; input the second text pair into the relevance model to calculate the relevance and obtain a second relevance set.

[0078] For example, suppose the user's question is "I want to buy compulsory traffic accident liability insurance for my motorcycle," and the preset object attribute list includes object attributes such as policyholder conditions, contact information, and price quotes. Then, the user's question is concatenated with each object attribute in the preset object attribute list according to a preset format to obtain a concatenated second text pair. The second text pair might be, for example: [CLS]I want to buy compulsory traffic accident liability insurance for my motorcycle[SEP]Policyholder conditions[SEP]. By inputting the second text pair into a relevance model and calculating its relevance, a second relevance set can be obtained.

[0079] It should be noted that this application does not restrict the order in which steps S403 and S404 are executed. That is, step S403 can be executed first and then step S404 can be executed, or step S404 can be executed first and then step S403 can be executed.

[0080] S405. Determine whether both the first relevance set and the second relevance set satisfy the relevance condition.

[0081] After obtaining the first relevance set, it can be determined whether the first relevance set meets the relevance condition; after obtaining the second relevance set, it can be determined whether the second relevance set meets the relevance condition. Therefore, it can be determined whether both the first and second relevance sets meet the relevance condition. If both the first and second relevance sets meet the relevance condition, then step S406 is executed; if the first relevance set does not meet the relevance condition, or the second relevance set does not meet the relevance condition, then step S408 is executed.

[0082] S406. If the intent type is an object list question, then based on the preset number of objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold and the object attribute corresponding to the maximum relevance in the second relevance set, query in the question-answering knowledge graph to determine the target path.

[0083] In this step, assuming the preset quantity is represented by N, the preset number of objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold can be understood as the top N (i.e., top N) objects with high relevance. For example, if the intent type is an object list question, such as "how to purchase health insurance", since health insurance includes multiple specific products, multiple paths are matched after querying the knowledge graph. Therefore, the top N objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold and the object attributes corresponding to the highest relevance in the second relevance set are used as path retrieval conditions to query the question-answering knowledge graph and determine the target path. It is understandable that for an intent type of object list question, since an object may contain multiple specific objects, querying the question-answering knowledge graph will match multiple paths. At this time, a preset number of objects with a relevance greater than or equal to the fourth relevance threshold in the first relevance set and the object attribute corresponding to the maximum relevance in the second relevance set are used as path retrieval conditions to query the question-answering knowledge graph. Since the question-answering knowledge graph contains the relationship between objects and object attributes, it is possible to obtain a preset number of target paths with a high relevance to the user's question information, that is, to obtain the target path corresponding to each object in the preset number of objects.

[0084] S407. If the intent type is an object attribute question, then obtain the third relevance set between the user's question information and the preset object channel list; based on the preset number of objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold, the object attribute corresponding to the maximum relevance in the second relevance set, and the object channel corresponding to the maximum relevance in the third relevance set, query in the question-answering knowledge graph to determine the target path.

[0085] For example, if the intent type is an object attribute question, the first step is to obtain the third relevance set between the user's question information and each object channel in the preset object channel list. Then, the top N objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold, the object attribute corresponding to the maximum relevance in the second relevance set, and the object channel corresponding to the maximum relevance in the third relevance set are used as path retrieval conditions to query the question-and-answer knowledge graph and determine the target path. In essence, for an intent type of object attribute question, the first step is to obtain the object channel with the highest relevance to the user's question information in the third relevance set. Then, a preset number of objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold, the object attribute corresponding to the maximum relevance in the second relevance set, and the object channel corresponding to the maximum relevance in the third relevance set are used as path retrieval conditions to query the question-and-answer knowledge graph. Since the question-and-answer knowledge graph contains the relationships between objects, object attributes, and object channels, it is possible to obtain a preset number of target paths with high relevance to the user's question information.

[0086] Optionally, obtaining a third relevance set between user question information and a preset object channel list includes: concatenating the user question information with each object channel in the preset object channel list to obtain a concatenated third text pair; and inputting the third text pair into a relevance model to calculate the relevance to obtain a third relevance set.

[0087] For example, the preset target channel list can be understood as a pre-determined range of target channels, containing multiple different target channels. For example, assuming the user's question is "I want to buy compulsory traffic accident insurance for my motorcycle," and the preset target channel list includes offline channels, public accounts, etc., then the user's question information is concatenated with each target channel in the preset target channel list according to a preset format to obtain a concatenated third text pair. For example, the third text pair might be: [CLS]I want to buy compulsory traffic accident insurance for my motorcycle[SEP]Offline[SEP]. Inputting the third text pair into a relevance model and calculating its relevance yields a third relevance set.

[0088] S408. Using a multi-round question-and-answer approach, send the corresponding preset rhetorical question to the user; obtain the user's response information to the preset rhetorical question; based on the response information, obtain a new first relevance set and a new second relevance set until both the first relevance set and the second relevance set satisfy the relevance condition, and execute step S406 or S407.

[0089] In one example of this step, assuming the maximum relevance in the first relevance set is less than the first relevance threshold, indicating a missing object, the user's question might be "How to buy?". The intent type corresponding to the user's question is identified as an object attribute question, meaning the object attribute question is about the purchase method, but no specific object is identified. To query the knowledge graph, the user needs to be further questioned, with a preset question like "What specific product do you want to know about?". The user's response to the preset question is obtained, and based on the response, a new first relevance set is obtained, referring to step S403. It is then determined whether the maximum relevance in the new first relevance set is greater than or equal to the first relevance threshold. This process is repeated in multiple rounds until the maximum relevance in the obtained first relevance set is greater than or equal to the first relevance threshold. In another example, assuming the maximum relevance in the second relevance set is less than the second relevance threshold, indicating a missing object attribute, the same multi-round question-and-answer method can be used until the maximum relevance in the obtained second relevance set is greater than or equal to the second relevance threshold.

[0090] S409. Based on the target path, determine the end node corresponding to the target path in the question-answering knowledge graph; based on the attribute information of the end node, obtain the answer information corresponding to the user's question.

[0091] In this step, after determining the target path based on the question-and-answer knowledge graph, the end node corresponding to the target path in the question-and-answer knowledge graph can be determined. The attribute information of the end node includes, for example, the name of the end node and the answer information (i.e., the answer). This application is not limited to this. Therefore, the answer corresponding to the user's question information can be obtained based on the attribute information of the end node.

[0092] After obtaining the answer to the user's question, the answer can be output so that the user can view it.

[0093] The knowledge graph-based question-answering method provided in this application obtains a first relevance set between user question information and a preset object list, and a second relevance set between user question information and a preset object attribute list. It then determines whether the first and second relevance sets meet relevance conditions, enabling more accurate identification of whether user question information is missing object information or object attribute information, resulting in broader information extraction coverage. If both the first and second relevance sets meet the relevance conditions, a target path is determined in the question-answering knowledge graph based on the intent type corresponding to the user question information identified by the intent model, the first relevance set, and the second relevance set. If either the first or second relevance set does not meet the relevance conditions, a multi-round question-answering approach is used to further question the user to obtain the missing object information. Therefore, while ensuring that user questions do not lack object information or object attribute information, the method more accurately understands the intent of user question information and, based on the target path determined in the question-answering knowledge graph, more accurately obtains the corresponding response information (i.e., the answer) for the user question information, thus improving the user experience.

[0094] Based on the above embodiments, the relevance model can be obtained in the following way: Training sample pairs are obtained, which include positive and negative sample pairs. Positive sample pairs are obtained by concatenating user question samples and first-category object-related text samples based on a preset text pair format. The first-category object-related text samples are related to the user question samples. Object-related text samples include object text samples, object attribute text samples, and object channel text samples. Negative sample pairs are obtained by concatenating user question samples and second-category object-related text samples based on a preset text pair format. The second-category object-related text samples are unrelated to the user question samples. Based on the training sample pairs, the initial relevance model is iteratively trained until the calculated loss function value meets the preset evaluation conditions, thus obtaining the relevance model.

[0095] For example, the initial relevance model could be a BERT model. Taking an insurance product as an example, the insurance product-related text samples include product text samples, product attribute text samples, and product channel text samples. In the insurance scenario, for the object-related text samples being product text samples, the training sample pairs could be: [('[CLS]I want to buy compulsory traffic accident liability insurance for my motorcycle[SEP]XX personal medical insurance[SEP]',0), ('[CLS]I want to buy compulsory traffic accident liability insurance for my motorcycle[SEP]YY compulsory traffic accident liability insurance (2020 version)[SEP]',1)], where 0 represents a negative sample pair, which can be constructed using random sampling; and 1 represents a positive sample pair. The user question samples and product text samples are separated by [SEP]. Then, the features of the user question samples and the corresponding product text samples are extracted using BERT's self-attention mechanism, and the vector representation of the features is obtained through [CLS].

[0096] For object-related text samples, which are object attribute text samples, the training sample pairs are as follows: [('[CLS]By the way, inquire about this year's vehicle insurance premium [SEP]Insured conditions [SEP]',0), ('[CLS]By the way, inquire about this year's vehicle insurance premium [SEP]Contact information [SEP]',0), ('[CLS]By the way, inquire about this year's vehicle insurance premium [SEP]Quote [SEP]',1)].

[0097] For the object-related text samples as product channel text samples, the training sample pairs are as follows: [('[CLS] Does it have motorcycle insurance? [SEP] Offline [SEP]',1), ('[CLS] Does it have motorcycle insurance? [SEP] Official Account [SEP]',0), ('[CLS] How to buy motorcycle insurance [SEP] Offline [SEP]',1), ('[CLS] How to buy motorcycle insurance [SEP] Official Account [SEP]',0), ('[CLS] Can I buy compulsory traffic accident liability insurance for motorcycles? [SEP] Offline [SEP]',1), ('[CLS] Can I buy compulsory traffic accident liability insurance for motorcycles? [SEP] Official Account [SEP]',0), ('[CLS] Can I apply for car insurance online? [SEP] Offline [SEP]',0)].

[0098] The initial relevance model is iteratively trained using training sample pairs corresponding to product text samples and object-related text samples, until the calculated loss function value meets the preset evaluation conditions. Similarly, the initial relevance model is iteratively trained using training sample pairs corresponding to product attribute text samples and object-related text samples corresponding to product channel text samples, until the calculated loss function value meets the preset evaluation conditions, thus obtaining the relevance model. The loss function may be, for example, cross-entropy, and the specific ranking algorithm may be, for example, a point-wise method. In essence, the relevance model includes models that calculate the relevance for products, product attributes, and product channels separately.

[0099] Based on the above embodiments, the knowledge graph-based question-answering method provided in this application can at least solve the following problems existing in the current related technologies:

[0100] (1) It can solve the problem of not being able to effectively make full use of the semantic information of nodes in the knowledge graph. In the traditional path-based information extraction method, the head entity information in the user's question is identified through dependency parsing and entity linking. The candidate path is obtained by searching the knowledge graph through the head entity information. The final path is obtained by ranking the candidate path with the user's question based on similarity and then the answer is generated. In this process, no semantic judgment is performed on nodes other than the head entity, so better results cannot be obtained; however, the embodiment of this application uses RDF knowledge graph to input objects (such as insurance products) into the graph in triplets, and extracts objects, object attributes and object channels through point-wise method to obtain the first relevance set, the second relevance set and the third relevance set, and then the answer can be obtained through knowledge graph retrieval; (2) It can solve the problem of not being able to combine the characteristics of knowledge graph with multi-round question answering. At present, question answering based on knowledge graph can only solve the problem of single-round question answering. In the embodiment of this application, objects, object attributes and object channels will be trained with sorting algorithms. After the user's question enters the relevance model, according to the relevance results in the set, a counter-question will be thrown to the user; the logic of the counter-question is that when the maximum relevance in the object or object attribute sequence is less than the relevance threshold, the corresponding preset counter-question is sent to the user to inquire about the user's intention, until the maximum relevance in the object or object attribute sequence is greater than or equal to the relevance threshold, so the answer can be obtained through knowledge graph retrieval.

[0101] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0102] Figure 5This is a schematic diagram of the structure of a knowledge graph-based question-answering device provided in an embodiment of this application, as shown below. Figure 5 As shown, the knowledge graph-based question-answering device 500 of this application embodiment includes: an acquisition module 501, an identification module 502, and a processing module 503. Wherein:

[0103] The acquisition module 501 is used to acquire user question information and question-answer knowledge graph. The question-answer knowledge graph is used to reflect the relationship between objects, object attributes and object channels.

[0104] The identification module 502 is used to identify the intent type corresponding to the user's question information. The intent type includes object list questions and object attribute questions. Object list questions are used to indicate that the response information corresponding to the user's question information contains at least one object. Object attribute questions are used to indicate that the response information corresponding to the user's question information contains an object attribute.

[0105] The acquisition module 501 is also used to acquire a first relevance set between user question information and a preset object list, and to acquire a second relevance set between user question information and a preset object attribute list.

[0106] The processing module 503 is used to determine the target path in the question-answering knowledge graph based on the intent type, the first relevance set, and the second relevance set if both the first relevance set and the second relevance set satisfy the relevance condition.

[0107] The acquisition module 501 is also used to acquire the response information corresponding to the user's question information based on the target path.

[0108] In some embodiments, the relevance condition includes a first relevance threshold and a second relevance threshold. The knowledge graph-based question-answering device 500 further includes a determination module 504, configured to: determine that the first relevance set satisfies the relevance condition if the maximum relevance in the first relevance set is greater than or equal to the first relevance threshold; determine that the first relevance set does not satisfy the relevance condition if the maximum relevance in the first relevance set is less than the first relevance threshold; determine that the second relevance set satisfies the relevance condition if the maximum relevance in the second relevance set is greater than or equal to the second relevance threshold; and determine that the second relevance set does not satisfy the relevance condition if the maximum relevance in the second relevance set is less than the second relevance threshold.

[0109] In some embodiments, the relevance condition includes a first quantity and a second quantity. The determining module 504 can also be used to: determine that the first relevance set satisfies the relevance condition if the number of relevances in the first relevance set that is greater than or equal to the third relevance threshold is greater than or equal to the first quantity; determine that the first relevance set does not satisfy the relevance condition if the number of relevances in the first relevance set that is greater than or equal to the third relevance threshold is less than the first quantity; determine that the second relevance set satisfies the relevance condition if the number of relevances in the second relevance set that is greater than or equal to the third relevance threshold is greater than or equal to the second quantity; and determine that the second relevance set does not satisfy the relevance condition if the number of relevances in the second relevance set that is greater than or equal to the third relevance threshold is less than the second quantity.

[0110] In some embodiments, the processing module 503 may be specifically used to: if the intent type is an object list question, then query the question-and-answer knowledge graph to determine the target path based on a preset number of objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold and the object attribute corresponding to the maximum relevance in the second relevance set; if the intent type is an object attribute question, then obtain the third relevance set between the user's question information and the preset object channel list, and query the question-and-answer knowledge graph to determine the target path based on a preset number of objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold, the object attribute corresponding to the maximum relevance in the second relevance set, and the object channel corresponding to the maximum relevance in the third relevance set.

[0111] In some embodiments, the acquisition module 501 may be specifically used to: concatenate the user question information with each object in a preset object list to obtain a concatenated first text pair, and input the first text pair into a relevance model to calculate the relevance to obtain a first relevance set; concatenate the user question information with each object attribute in a preset object attribute list to obtain a concatenated second text pair; and input the second text pair into a relevance model to calculate the relevance to obtain a second relevance set.

[0112] Optionally, when processing module 503 is used to obtain the third relevance set between user question information and preset object channel list, it can specifically be used to: concatenate the user question with each object channel in the preset object channel list to obtain a concatenated third text pair; input the third text pair into the relevance model to calculate the relevance and obtain the third relevance set.

[0113] Optionally, the knowledge graph-based question answering device 500 further includes a training module 505, used to obtain a relevance model in the following ways: acquiring training sample pairs, which include positive sample pairs and negative sample pairs. Positive sample pairs are obtained by concatenating user question samples and first-type object-related text samples based on a preset text pair format. The first-type object-related text samples are related to the user question samples. Object-related text samples include object text samples, object attribute text samples, and object channel text samples. Negative sample pairs are obtained by concatenating user question samples and second-type object-related text samples based on a preset text pair format. The second-type object-related text samples are not related to the user question samples. Based on the training sample pairs, the initial relevance model is iteratively trained until the calculated loss function value meets the preset evaluation conditions, thus obtaining the relevance model.

[0114] In some embodiments, the acquisition module 501 may be specifically used to: determine the end node corresponding to the target path in the question-and-answer knowledge graph based on the target path; and acquire the answer information corresponding to the user's question information based on the attribute information of the end node.

[0115] In some embodiments, the user question information includes question information entered by the user in a single round of question-and-answer and response information entered by the user in response to a preset rhetorical question in multiple rounds of question-and-answer. If the user question information is response information entered by the user in response to a preset rhetorical question in multiple rounds of question-and-answer, then the acquisition module 501 may be specifically used to: acquire initial user question information; the initial user question information is question information entered by the user in a single round of question-and-answer, or response information entered by the user in response to a preset rhetorical question in the previous multiple rounds of question-and-answer; acquire a first initial relevance set between the initial user question information and a preset object list, and acquire the initial user question information and... A second initial relevance set is set between preset object attribute columns; if the first initial relevance set or the second initial relevance set does not meet the relevance condition, a multi-round question-and-answer approach is adopted to issue corresponding preset rhetorical questions to the user, which are used to prompt the user to provide object information; the user's response to the preset rhetorical questions is used as the initial user question information, and the step of obtaining the first initial relevance set between the initial user question information and the preset object list is executed; if both the first initial relevance set and the second initial relevance set meet the relevance condition, the initial user question information is used as the user question information.

[0116] Optionally, the recognition module 502 can be specifically used to: input user question information into the intent model and identify the intent type corresponding to the user question information. The apparatus of this embodiment can be used to execute the technical solutions of any of the method embodiments shown above, and its implementation principle and technical effects are similar, so they will not be repeated here.

[0117] Figure 6This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Exemplarily, the electronic device may be provided as a server or a computer. (Refer to...) Figure 6 The electronic device 600 includes a processing component 601, which further includes one or more processors, and memory resources represented by memory 602 for storing instructions, such as application programs, that can be executed by the processing component 601. The application programs stored in memory 602 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 601 is configured to execute instructions to perform any of the method embodiments described above.

[0118] Electronic device 600 may also include a power supply component 603 configured to perform power management of electronic device 600, a wired or wireless network interface 604 configured to connect electronic device 600 to a network, and an input / output (I / O) interface 605. Electronic device 600 may operate on an operating system stored in memory 602, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.

[0119] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described knowledge graph-based question-answering method.

[0120] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described knowledge graph-based question-answering method.

[0121] The aforementioned computer-readable 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 readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0122] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Alternatively, the readable storage medium can be an integral part of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in a knowledge graph-based question-answering device.

[0123] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A question-answering method based on knowledge graphs, characterized in that, include: Acquire user question information and question-answer knowledge graph, wherein the question-answer knowledge graph is used to reflect the relationship between objects, object attributes and object channels; Identify the intent type corresponding to the user question information. The intent type includes object list questions and object attribute questions. The object list questions are used to indicate that the response information corresponding to the user question information contains at least one object. The object attribute questions are used to indicate that the response information corresponding to the user question information contains an object attribute. Obtain a first relevance set between the user question information and a preset object list, and obtain a second relevance set between the user question information and a preset object attribute list; the first relevance set includes the relevance between the user question information and each object in the preset object list, and the second relevance set includes the relevance between the user question information and each object attribute in the preset object attribute list; If both the first relevance set and the second relevance set satisfy the relevance condition, then the target path is determined in the question-answering knowledge graph based on the intent type, the first relevance set, and the second relevance set. Based on the target path, obtain the response information corresponding to the user's question information.

2. The question-answering method based on knowledge graphs according to claim 1, characterized in that, The relevance conditions include a first relevance threshold and a second relevance threshold, and the method further includes: If the maximum relevance in the first relevance set is greater than or equal to the first relevance threshold, then the first relevance set is determined to satisfy the relevance condition; if the maximum relevance in the first relevance set is less than the first relevance threshold, then the first relevance set is determined not to satisfy the relevance condition. If the maximum relevance in the second relevance set is greater than or equal to the second relevance threshold, then the second relevance set is determined to satisfy the relevance condition; if the maximum relevance in the second relevance set is less than the second relevance threshold, then the second relevance set is determined not to satisfy the relevance condition.

3. The question-answering method based on knowledge graphs according to claim 1, characterized in that, The relevance criteria include a first quantity and a second quantity, and the method further includes: If the number of relevance values ​​in the first relevance set that are greater than or equal to the third relevance threshold is greater than or equal to the first number, then the first relevance set is determined to satisfy the relevance condition; if the number of relevance values ​​in the first relevance set that are greater than or equal to the third relevance threshold is less than the first number, then the first relevance set is determined not to satisfy the relevance condition. If the number of relevance values ​​in the second relevance set that are greater than or equal to the third relevance threshold is greater than or equal to the second number, then the second relevance set is determined to satisfy the relevance condition; if the number of relevance values ​​in the second relevance set that are greater than or equal to the third relevance threshold is less than the second number, then the second relevance set is determined not to satisfy the relevance condition.

4. The question-answering method based on knowledge graphs according to claim 1, characterized in that, Determining the target path in the question-answering knowledge graph based on the intent type, the first relevance set, and the second relevance set includes: If the intent type is an object list question, then based on a preset number of objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold, and the object attribute corresponding to the maximum relevance in the second relevance set, the target path is determined by querying the question-and-answer knowledge graph. If the intent type is an object attribute question, then the third relevance set between the user question information and the preset object channel list is obtained, and the target path is determined by querying the question-and-answer knowledge graph based on the preset number of objects in the first relevance set whose relevance is greater than or equal to the fourth relevance threshold, the object attribute corresponding to the maximum relevance in the second relevance set, and the object channel corresponding to the maximum relevance in the third relevance set.

5. The question-answering method based on knowledge graphs according to claim 1, characterized in that, The steps of obtaining a first relevance set between the user question information and a preset object list, and obtaining a second relevance set between the user question information and a preset object attribute list, include: The user question information is concatenated with each object in the preset object list to obtain a concatenated first text pair. The first text pair is then input into a relevance model to calculate the relevance, resulting in the first relevance set. The relevance model is a pre-trained model used to calculate the relevance between texts. The user question information is concatenated with each object attribute in the preset object attribute list to obtain a concatenated second text pair; the second text pair is input into the relevance calculation to obtain the second relevance set.

6. The question-answering method based on knowledge graphs according to claim 5, characterized in that, The relevance model was obtained in the following way: Training sample pairs are obtained, comprising positive and negative sample pairs. Positive sample pairs are obtained by concatenating user question samples and first-category object-related text samples based on a preset text pair format. The first-category object-related text samples are related to the user question samples. The object-related text samples include object text samples, object attribute text samples, and object channel text samples. Negative sample pairs are obtained by concatenating user question samples and second-category object-related text samples based on the preset text pair format. The second-category object-related text samples are unrelated to the user question samples. Based on the training sample pairs, the initial relevance model is iteratively trained until the calculated loss function value meets the preset evaluation conditions, thus obtaining the relevance model.

7. The knowledge graph-based question-answering method according to any one of claims 1 to 6, characterized in that, The step of obtaining the response information corresponding to the user's question information based on the target path includes: Based on the target path, determine the end node corresponding to the target path in the question-and-answer knowledge graph; Based on the attribute information of the last node, the response information corresponding to the user's question is obtained.

8. The knowledge graph-based question-answering method according to any one of claims 1 to 6, characterized in that, The user question information includes the question information entered by the user in one round of question and answer and the response information entered by the user in response to preset rhetorical questions in multiple rounds of question and answer; If the user question information is the response information input by the user to a preset rhetorical question in a multi-round question-and-answer session, then obtaining the user question information includes: Obtain initial user question information; the initial user question information is the question information entered by the user in a round of question and answer, or the response information entered by the user in response to a preset rhetorical question in the previous multi-round question and answer; Obtain a first initial relevance set between the initial user question information and the preset object list, and obtain a second initial relevance set between the initial user question information and the preset object attribute column; If the first initial relevance set does not meet the relevance condition, or the second initial relevance set does not meet the relevance condition, a multi-round question-and-answer approach is adopted to send the user a corresponding preset rhetorical question, which is used to prompt the user to provide object information; The user's response to the preset rhetorical question is used as the initial user question information, and the step of obtaining the first initial relevance set between the initial user question information and the preset object list is executed; If both the first initial relevance set and the second initial relevance set satisfy the relevance condition, then the initial user question information is used as the user question information.

9. The knowledge graph-based question-answering method according to any one of claims 1 to 6, characterized in that, The identification of the intent type corresponding to the user's question information includes: The user's question information is input into the intent recognition model to identify the intent type corresponding to the user's question information.

10. A question-answering device based on a knowledge graph, characterized in that, include: The acquisition module is used to acquire user question information and question-answer knowledge graph, wherein the question-answer knowledge graph is used to reflect the relationship between objects, object attributes and object channels; The identification module is used to identify the intent type corresponding to the user question information. The intent type includes object list questions and object attribute questions. The object list questions are used to indicate that the response information corresponding to the user question information contains at least one object. The object attribute questions are used to indicate that the response information corresponding to the user question information contains an object attribute. The acquisition module is further configured to acquire a first relevance set between the user question information and a preset object list, and to acquire a second relevance set between the user question information and a preset object attribute list; the first relevance set includes the relevance between the user question information and each object in the preset object list, and the second relevance set includes the relevance between the user question information and each object attribute in the preset object attribute list; The processing module is configured to determine a target path in the question-and-answer knowledge graph based on the intent type, the first relevance set, and the second relevance set if both the first relevance set and the second relevance set satisfy the relevance condition. The acquisition module is also used to acquire the response information corresponding to the user's question information based on the target path.

11. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the knowledge graph-based question-answering method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the knowledge graph-based question-answering method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Question answering method, electronic equipment and computer readable storage medium

    CN110532368A

  • Knowledge graph-based question and answer method and device, computer equipment and storage medium

    CN111444313A