Knowledge question and answer method and device based on domain knowledge graph, and electronic device

By using a domain knowledge graph-based approach, the system receives questions, extracts sets of entities or relations, retrieves triple information, and generates answers. This solves the accuracy and cost issues of intelligent question-answering systems in financial service scenarios, achieving efficient and reliable knowledge-based question answering.

CN117076688BActive Publication Date: 2026-05-22INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-08-18
Publication Date
2026-05-22

Smart Images

  • Figure CN117076688B_ABST
    Figure CN117076688B_ABST
Patent Text Reader

Abstract

The application discloses a knowledge question answering method and device based on a domain knowledge graph and electronic equipment, and relates to the fields of artificial intelligence, financial technology or other related fields, wherein the knowledge question answering method comprises the following steps: receiving a target question, processing the target question to obtain question prompt information, extracting a target entity set or a target relationship set based on the target question, retrieving triple information matched with the target entity from a preset domain knowledge graph based on the target entity set to obtain a triple information set, constructing input knowledge information based on the triple information set and the question prompt information, inputting the input knowledge information into a preset reasoning model, and outputting a target answer to the target question. The application solves the technical problem of low accuracy of knowledge question answering reasoning for a question in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence, and more specifically, to a knowledge question answering method, apparatus, and electronic device based on a domain knowledge graph. Background Technology

[0002] Currently, in financial service scenarios (such as financial market trading scenarios), it is necessary to manually conduct pre-trade research, data analysis, and trading decisions. Often, there is a difficulty in quickly obtaining effective information from massive amounts of data and integrating and analyzing the information in a timely manner, which leads to problems such as decision-making difficulties and inaccurate decisions, thereby affecting business efficiency and growth.

[0003] With the release of generative models (such as ChatGPT, short for Chat Generative Pre-trained Transformer, a chatbot program), the ability to understand and generate natural language text has been significantly improved, and the level of intelligent knowledge question answering and reasoning services has been greatly enhanced. However, current generative models still suffer from unreliable logical reasoning, low factual accuracy of generated results, and are unable to provide professional and accurate answers to domain-specific questions (such as those in the financial field).

[0004] In related technologies, the following schemes are often used for intelligent question answering: (1) intelligent question answering reasoning based on knowledge graphs; (2) question-answer pair matching; and (3) intelligent question answering based on generative models.

[0005] (1) Knowledge graph-based intelligent question answering reasoning can construct general or professional domain knowledge graphs based on knowledge graph technology to realize intelligent question answering application for knowledge reasoning.

[0006] Figure 1 This is a schematic diagram of an optional knowledge graph-based intelligent question-answering reasoning method based on relevant technologies, such as... Figure 1 As shown, it includes: a problem analysis module, a problem answering module, and an answer generation module. The problem analysis module includes problem classification and NLP (Natural Language Processing) technology. It first classifies the input problem and then uses NLP technology for keyword extraction and semantic analysis. The problem answering module includes pattern matching and knowledge-based question answering. It performs semantic understanding and parsing on the data transmitted from the problem analysis module and uses a knowledge base for querying and reasoning to derive the answer. The answer generation module scores candidate answers based on the data transmitted from the problem analysis module and selects the best answer.

[0007] (2) Question-answer pair matching relies on a question-answer database and matches answers by calculating semantic similarity.

[0008] (3) Intelligent question answering based on generative models: Based on pre-trained models, intent recognition and semantic analysis are performed according to context, user questions and other information, and question answering is generated.

[0009] Figure 2 This is a schematic diagram of an optional generative model-based intelligent question answering approach based on relevant technologies, such as... Figure 2 As shown, the model includes modules such as intent analysis, semantic analysis, and answer generation. The question is input into the model, intent analysis and semantic analysis are performed on the question, and then the answer generation module obtains the question-and-answer answer.

[0010] However, the intelligent knowledge question answering schemes in related technologies have the following problems: (1) For model-based intelligent question answering reasoning schemes, there are problems such as unreliable reasoning results and low controllability of results. On the one hand, the model is mainly pre-trained by self-collected and self-labeled data. If the training sample data is unbalanced, it may lead to bias and fairness issues in the model. On the other hand, for domain-related scenarios, there is not enough professional sample data in the data used for model pre-training (or there is very little sample data in some domains), and the information collected by the model from the network also faces non-factual issues, resulting in low reliability of the content generated by the model reasoning and inability to provide professional and reliable answers for domain-related questions. If newly labeled professional sample data of the domain is used and injected into the model for pre-training, there are problems such as high manpower and computing costs, and the model cannot be guaranteed to achieve the expected results in each sub-scenarios of the domain. (2) For knowledge graph-based intelligent question answering reasoning schemes, there are problems such as difficulty in adjusting the architecture and difficulty in modifying and adjusting according to new data or scenarios. There are also problems such as weak reasoning ability and high cost of graph construction.

[0011] There is currently no effective solution to the above problems. Summary of the Invention

[0012] This invention provides a knowledge question answering method, apparatus, and electronic device based on a domain knowledge graph, to at least solve the technical problem of low accuracy in knowledge question answering reasoning in related technologies.

[0013] According to one aspect of the present invention, a knowledge question answering method based on a domain knowledge graph is provided, comprising: receiving a target question and processing the target question to obtain question prompt information; extracting a target entity set or a target relation set based on the target question, wherein the target entity set includes multiple target entities and the target relation set includes multiple target relations; if the target entity set is extracted, retrieving triple information matching the target entity from a preset domain knowledge graph based on the target entity set, or if the target relation set is extracted, retrieving triple information matching the target relation from a preset domain knowledge graph based on the target relation set to obtain a triple information set; constructing input knowledge information based on the triple information set and the question prompt information, inputting the input knowledge information into a preset reasoning model, and outputting the target answer to the target question.

[0014] Optionally, the step of processing the target problem to obtain problem prompt information includes: constructing a problem prompt template, wherein the problem prompt template includes a problem instruction; and adding the problem instruction to the target problem based on the problem prompt template to generate the problem prompt information.

[0015] Optionally, the step of extracting a target entity set or a target relation set based on the target question includes: performing word segmentation on the target question to obtain multiple word segments; analyzing the word segments to determine their word types; if the word type is a first preset type, determining the word segment indicated by the word type as the target entity, or if the word type is a second preset type, determining the word segment indicated by the word type as the target relation, thus obtaining the target relation set; if none of the word types are the first preset type or the second preset type, determining the context information of the target question, and supplementing the target entity corresponding to the target question based on the context information; and generating the target entity set based on all the target entities.

[0016] Optionally, the triple information includes: a subject entity, an object entity, and an entity relationship. When the target entity set is extracted, the step of retrieving triple information matching the target entity from a preset domain knowledge graph based on the target entity set to obtain a triple information set includes: determining a retrieval hop count threshold and an initial retrieval hop count; retrieving a knowledge graph entity matching the target entity from the preset domain knowledge graph, wherein the knowledge graph entity is the subject entity or the object entity; and, if a first knowledge graph entity matching the target entity is found, performing a retrieval on the initial hop count. The hop count is updated to obtain the current hop count. If the current hop count is less than the hop count threshold, a second knowledge graph entity associated with the first knowledge graph entity is determined based on the entity relationship. The current hop count is updated, and a third knowledge graph entity associated with the second knowledge graph entity is determined based on the entity relationship until the current hop count is greater than or equal to the hop count threshold, thus obtaining a knowledge graph entity set. Based on the knowledge graph entity set, the triplet information to which each knowledge graph entity belongs is determined, thus obtaining the triplet information set.

[0017] Optionally, when the target relation set is extracted, the step of retrieving triple information matching the target relation from a preset domain knowledge graph based on the target relation set to obtain a triple information set includes: retrieving entity relations matching the target relation from the preset domain knowledge graph until the retrieval is successful or the number of retrievals reaches a preset retrieval threshold to obtain retrieval results; if the retrieval is successful, determining the target entity relations matching the target relation based on the retrieval results to obtain a target entity relation set; and determining the triple information to which each target entity relation belongs based on the target entity relation set to obtain the triple information set.

[0018] Optionally, after retrieving triple information matching the target entity from a preset domain knowledge graph based on the target entity set to obtain a triple information set, the method further includes: connecting the subject entity, object entity, and entity relationship in the triple information to obtain the answer text, wherein the triple information corresponds to an association value associated with the target entity; and sorting all the answer texts based on the association value to obtain an answer text set.

[0019] Optionally, the step of constructing input knowledge information based on the triplet information set and the question prompt information includes: constructing an answer prompt template, wherein the answer prompt template includes an answer instruction; adding the answer instruction to each answer text in the answer text set based on the answer prompt template to generate an answer prompt information set; and concatenating the question prompt information and the answer prompt information set to obtain the input knowledge information.

[0020] Optionally, the step of inputting the input knowledge information into a preset reasoning model and outputting the target answer to the target question includes: analyzing the question prompt information using the preset reasoning model to obtain an answer set, wherein the preset reasoning model is a reasoning model pre-trained using a training data set, the training data set including: a set of historical questions and historical answers corresponding to each historical question in the set of historical questions; representing the input knowledge information as preset conditions, and determining the conditional probability value of each answer in the answer set based on the preset conditions; and determining the answer indicated by the maximum conditional probability value as the target answer.

[0021] According to another aspect of the present invention, a knowledge question answering device based on a domain knowledge graph is also provided, comprising: a receiving unit, configured to receive a target question and process the target question to obtain question prompt information; an extraction unit, configured to extract a target entity set or a target relation set based on the target question, wherein the target entity set includes multiple target entities and the target relation set includes multiple target relations; a retrieval unit, configured to, if the target entity set is extracted, retrieve triplet information matching the target entity from a preset domain knowledge graph based on the target entity set, or, if the target relation set is extracted, retrieve triplet information matching the target relation from a preset domain knowledge graph based on the target relation set, to obtain a triplet information set; and a construction unit, configured to, based on the triplet information set and the question prompt information, construct input knowledge information, input the input knowledge information into a preset reasoning model, and output the target answer to the target question.

[0022] Optionally, the receiving unit includes: a first construction module, configured to construct a problem prompt template, wherein the problem prompt template includes: a problem instruction; and a first generation module, configured to add the problem instruction to the target problem based on the problem prompt template, thereby generating the problem prompt information.

[0023] Optionally, the extraction unit includes: a first processing module, configured to perform word segmentation on the target question to obtain multiple word segments; a first analysis module, configured to analyze the word segments and determine the word type of the word segments; a first determination module, configured to determine the word segment indicated by the word type as the target entity when the word type is a first preset type, or to determine the word segment indicated by the word type as the target relation when the word type is a second preset type, thereby obtaining the target relation set; a second determination module, configured to determine the context information of the target question when none of the word types are the first preset type or the second preset type, and to supplement the target entity corresponding to the target question based on the context information; and a second generation module, configured to generate the target entity set based on all the target entities.

[0024] Optionally, the triple information includes: a subject entity, an object entity, and an entity relationship. The retrieval unit includes: a third determining module for determining a retrieval hop count threshold and an initial retrieval hop count; a first retrieval module for retrieving a knowledge graph entity matching the target entity from the preset domain knowledge graph, wherein the knowledge graph entity is the subject entity or the object entity; a first updating module for updating the initial retrieval hop count when a first knowledge graph entity matching the target entity is found, to obtain the current retrieval hop count; a fourth determining module for determining a second knowledge graph entity associated with the first knowledge graph entity based on the entity relationship when the current retrieval hop count is less than the retrieval hop count threshold; a second updating module for updating the current retrieval hop count and continuing to determine a third knowledge graph entity associated with the second knowledge graph entity based on the entity relationship, until the current retrieval hop count is greater than or equal to the retrieval hop count threshold, to obtain a knowledge graph entity set; and a fifth determining module for determining the triple information to which each knowledge graph entity belongs based on the knowledge graph entity set, to obtain the triple information set.

[0025] Optionally, the retrieval unit further includes: a second retrieval module, used to retrieve entity relationships matching the target relationship from the preset domain knowledge graph until the retrieval is successful or the number of retrievals reaches a preset retrieval threshold, and obtain retrieval results; a sixth determination module, used to determine the target entity relationship matching the target relationship based on the retrieval results when the retrieval is successful, and obtain a set of target entity relationships; and a seventh determination module, used to determine the triplet information to which each target entity relationship belongs based on the set of target entity relationships, and obtain a set of triplet information.

[0026] Optionally, the knowledge question answering device further includes: a first connection module, configured to, based on the target entity set, retrieve triple information matching the target entity from a preset domain knowledge graph, obtain a triple information set, and then connect the subject entity, object entity, and entity relationship in the triple information to obtain answer text, wherein the triple information corresponds to an association value associated with the target entity; and a first sorting module, configured to sort all the answer texts based on the association value to obtain an answer text set.

[0027] Optionally, the construction unit includes: a second construction module for constructing an answer prompt template, wherein the answer prompt template includes an answer instruction; a third generation module for adding the answer instruction to each answer text in the answer text set based on the answer prompt template to generate an answer prompt information set; and a first splicing module for splicing the question prompt information and the answer prompt information set to obtain the input knowledge information.

[0028] Optionally, the construction unit further includes: a second analysis module, used to analyze the question prompt information using the preset reasoning model to obtain an answer set, wherein the preset reasoning model is a reasoning model pre-trained using a training data set, the training data set including: a historical question set and historical answers corresponding to each historical question in the historical question set; an eighth determination module, used to characterize the input knowledge information as preset conditions, and determine the conditional probability value of each answer in the answer set based on the preset conditions; and a ninth determination module, used to determine the answer indicated by the maximum conditional probability value as the target answer.

[0029] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute any of the above-described knowledge question answering methods based on domain knowledge graphs.

[0030] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any of the above-described knowledge question answering methods based on domain knowledge graphs.

[0031] In this disclosure, a target question is received and processed to obtain question prompt information. Based on the target question, a target entity set or a target relation set is extracted. If a target entity set is extracted, triple information matching the target entities is retrieved from a preset domain knowledge graph based on the target entity set. Alternatively, if a target relation set is extracted, triple information matching the target relations is retrieved from a preset domain knowledge graph based on the target relation set to obtain a triple information set. Based on the triple information set and the question prompt information, input knowledge information is constructed and input into a preset reasoning model to output the target answer to the target question. In this disclosure, the received target question can be processed first to obtain question prompt information, and a set of target entities or a set of target relations can be extracted from the target question. Based on the set of target entities, triple information matching the target entities can be retrieved from a preset domain knowledge graph, or based on the set of target relations, triple information matching the target relations can be retrieved from the preset domain knowledge graph. Then, based on the obtained set of triple information and the question prompt information, input knowledge information is constructed. The input knowledge information is then input into a preset reasoning model to obtain the target answer to the output target question. By combining the preset domain knowledge graph, the question can be constructed as input knowledge information, and then the input knowledge information can be processed by the preset reasoning model. This can reduce bias in the model reasoning process and improve the accuracy of knowledge question answering reasoning for the question, thereby solving the technical problem of low accuracy in knowledge question answering reasoning for questions in related technologies. Attached Figure Description

[0032] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0033] Figure 1 This is a schematic diagram of an optional knowledge graph-based intelligent question-answering reasoning method based on relevant technologies;

[0034] Figure 2 This is a schematic diagram of an optional generative model-based intelligent question answering method based on relevant technologies;

[0035] Figure 3 This is a flowchart of an optional knowledge question answering method based on a domain knowledge graph according to an embodiment of the present invention;

[0036] Figure 4 This is a schematic diagram of an optional knowledge question-answering reasoning process based on a domain knowledge graph according to an embodiment of the present invention;

[0037] Figure 5This is a schematic diagram of an optional knowledge question answering device based on a domain knowledge graph according to an embodiment of the present invention;

[0038] Figure 6 This is a hardware structure block diagram of an electronic device (or mobile device) for a knowledge question answering method based on a domain knowledge graph, according to an embodiment of the present invention. Detailed Implementation

[0039] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0040] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0041] To facilitate understanding of the present invention by those skilled in the art, some terms or nouns involved in the various embodiments of the present invention are explained below:

[0042] A knowledge graph is a method that uses a graph model to describe knowledge and model the relationships between entities, consisting of nodes and edges.

[0043] A language model is used to generate a probability distribution for a sequence of words, that is, to determine a probability distribution for a text, representing the likelihood of the text existing.

[0044] It should be noted that the knowledge question answering method and apparatus based on domain knowledge graphs in this disclosure can be used in the field of artificial intelligence for knowledge question answering based on domain knowledge graphs, and can also be used in any field other than artificial intelligence for knowledge question answering based on domain knowledge graphs. This disclosure does not limit the application field of the knowledge question answering method and apparatus based on domain knowledge graphs.

[0045] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) disclosed herein are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of such data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding access points are provided for users to choose to authorize or refuse. For example, this system has interfaces with relevant users or organizations. Before obtaining relevant information, a request to obtain the information must be sent to the aforementioned user or organization through the interface, and the relevant information will be obtained only after receiving consent from the aforementioned user or organization.

[0046] The following embodiments of the present invention can be applied to various systems / applications / devices for knowledge question answering based on domain knowledge graphs. The present invention proposes a knowledge question answering reasoning method based on domain knowledge graphs, which can solve the problems of low reliability, bias, and fairness in intelligent reasoning question answering results in related technologies.

[0047] This invention utilizes domain knowledge graph data assets to enhance the controllability and reliability of model reasoning results, reduce non-factual errors in the model, improve the model's intelligent question-answering reasoning ability, and enhance the model's applicability in scenarios such as intelligent customer service and virtual assistants. In addition, this invention does not require retraining the model according to scenario type, and can be flexibly applied to knowledge question-answering reasoning in various scenarios.

[0048] The present invention will now be described in detail with reference to various embodiments.

[0049] Example 1

[0050] According to an embodiment of the present invention, an embodiment of a knowledge question answering method based on a domain knowledge graph is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0051] Figure 3 This is a flowchart of an optional knowledge question answering method based on a domain knowledge graph according to an embodiment of the present invention, such as... Figure 3 As shown, the method includes the following steps:

[0052] Step S301: Receive the target problem, process the target problem, and obtain the problem prompt information.

[0053] Step S302: Based on the target problem, extract the target entity set or the target relation set, wherein the target entity set includes multiple target entities and the target relation set includes multiple target relations.

[0054] Step S303: If a target entity set is extracted, retrieve triple information matching the target entity from a preset domain knowledge graph based on the target entity set; or if a target relation set is extracted, retrieve triple information matching the target relation from a preset domain knowledge graph based on the target relation set, and obtain a triple information set.

[0055] Step S304: Based on the triplet information set and the question prompt information, construct input knowledge information, input the input knowledge information into the preset reasoning model, and output the target answer to the target question.

[0056] Through the above steps, a target question can be received and processed to obtain question prompt information. Based on the target question, a target entity set or a target relation set can be extracted. If a target entity set is extracted, triple information matching the target entities can be retrieved from a preset domain knowledge graph. Alternatively, if a target relation set is extracted, triple information matching the target relations can be retrieved from a preset domain knowledge graph. A triple information set can then be obtained. Based on the triple information set and the question prompt information, input knowledge information is constructed and input into a preset reasoning model to output the target answer to the target question. In this embodiment of the invention, the received target question can be processed first to obtain question prompt information. A set of target entities or a set of target relationships can be extracted from the target question. Based on the set of target entities, triple information matching the target entities can be retrieved from a preset domain knowledge graph; or based on the set of target relationships, triple information matching the target relationships can be retrieved from the preset domain knowledge graph. Then, based on the obtained set of triple information and the question prompt information, input knowledge information is constructed. This input knowledge information is then input into a preset reasoning model to obtain the target answer to the output target question. By combining the preset domain knowledge graph, the question can be constructed as input knowledge information. Processing the input knowledge information through the preset reasoning model reduces bias in the model's reasoning process and improves the accuracy of knowledge-based question-and-answer reasoning for the question. This solves the technical problem of low accuracy in knowledge-based question-and-answer reasoning for questions in related technologies.

[0057] The embodiments of the present invention will now be described in detail with reference to the steps described above.

[0058] Step S301: Receive the target problem, process the target problem, and obtain the problem prompt information.

[0059] Optionally, the step of processing the target problem to obtain problem prompt information includes: constructing a problem prompt template, wherein the problem prompt template includes: a problem instruction; and adding the problem instruction to the target problem based on the problem prompt template to generate problem prompt information.

[0060] In this embodiment of the invention, a target question requiring knowledge-based Q&A can be received first, and then the target question can be processed to obtain question prompt information. Specifically, a question prompt template can be constructed first, which includes a question instruction (e.g., please answer the following question). Then, based on the question prompt template, the question instruction is added to the target question to generate question prompt information. For example, if the target question x is "Who is the author of a certain book?", then according to the question prompt template, the generated question prompt information x' is "Please answer the following question: Who is the author of a certain book?".

[0061] Step S302: Based on the target problem, extract the target entity set or the target relation set, wherein the target entity set includes multiple target entities and the target relation set includes multiple target relations.

[0062] Optionally, the step of extracting a target entity set or a target relation set based on the target question includes: performing word segmentation on the target question to obtain multiple word segments; analyzing the word segments to determine their word types; if the word type is a first preset type, determining the word segment indicated by the word type as the target entity, or if the word type is a second preset type, determining the word segment indicated by the word type as the target relation, thus obtaining a target relation set; if none of the word types are the first or second preset types, determining the context information of the target question, and supplementing the target entities corresponding to the target question based on the context information; and generating a target entity set based on all target entities.

[0063] In this embodiment of the invention, the content (i.e., entities or relations, which can be subject entities (i.e., nouns located in the subject position), object entities (i.e., nouns located in the object position), or relationships between entities (e.g., marital relationships, master-subordinate relationships, etc.)) in a question or sentence (i.e., the target question) can be extracted using entity links or natural language models. If an entity or relation does not exist, the entity in the question can be supplemented using knowledge completion methods (i.e., based on the target question, extract a target entity set or a target relation set, where the target entity set includes multiple target entities and the target relation set includes multiple target relations). Specifically, the target question can first be segmented to obtain multiple segments, and then each segment can be analyzed to determine the word type of each segment (e.g., noun, verb, adjective, etc.). If the word type is a first preset type (e.g., nouns representing object names, etc.), the segment indicated by the word type can be determined as the target entity. If the word type is a second preset type (e.g., nouns representing relationships, etc.), the segment indicated by the word type can be determined as the target entity. If none of the word types are the first or second preset type, then the context information of the target question can be determined first, and then the target entities corresponding to the target question can be supplemented based on the context information. Finally, a target entity set can be generated based on all the target entities.

[0064] Step S303: If a target entity set is extracted, retrieve triple information matching the target entity from a preset domain knowledge graph based on the target entity set; or if a target relation set is extracted, retrieve triple information matching the target relation from a preset domain knowledge graph based on the target relation set, and obtain a triple information set.

[0065] Optionally, the triple information includes: a subject entity, an object entity, and an entity relation. Given a target entity set, the step of retrieving triple information matching the target entity from a preset domain knowledge graph to obtain a triple information set includes: determining a retrieval hop count threshold and an initial retrieval hop count; retrieving knowledge graph entities matching the target entity from the preset domain knowledge graph, where the knowledge graph entities are subject entities or object entities; updating the initial retrieval hop count when a first knowledge graph entity matching the target entity is found, obtaining the current retrieval hop count; determining a second knowledge graph entity associated with the first knowledge graph entity based on entity relations when the current retrieval hop count is less than the retrieval hop count threshold; updating the current retrieval hop count and continuing to determine a third knowledge graph entity associated with the second knowledge graph entity based on entity relations, until the current retrieval hop count is greater than or equal to the retrieval hop count threshold, obtaining a knowledge graph entity set; and determining the triple information to which each knowledge graph entity belongs based on the knowledge graph entity set, obtaining the triple information set.

[0066] In this embodiment of the invention, based on the extracted entities, triples (subject entity, object entity, relation) related to the entities extracted from the question can be retrieved from the domain knowledge graph (a knowledge graph pre-constructed based on domain knowledge, such as a financial domain knowledge graph). (That is, based on the target entity set, triple information matching the target entity is retrieved from the preset domain knowledge graph to obtain a triple information set). The triples retrieved from the knowledge graph can be used as relevant facts for the input question. There may be multiple pairs of triples, and the triple information includes: subject entity, object entity, and entity relation.

[0067] In this embodiment of the invention, when performing triple retrieval, the size of the retrieval space affects the number of triples. Therefore, the number of hops for retrieval from the question can be set according to the task complexity of the question-and-answer scenario. Furthermore, considering that there may be problems that are irrelevant to the target question or that are numerous, a symmetric knowledge retrieval device or an asymmetric retrieval device can be used for retrieval.

[0068] In this embodiment of the invention, a retrieval hop count threshold (which can be set according to actual conditions, for example, 2) and an initial retrieval hop count (for example, setting the initial retrieval hop count to 0) can be determined first. Then, knowledge graph entities (knowledge graph entities are subject entities or object entities) that match the target entity can be retrieved from the preset domain knowledge graph. If a first knowledge graph entity that matches the target entity is retrieved, the initial retrieval hop count can be updated (i.e., the initial retrieval hop count is incremented by 1) to obtain the current retrieval hop count. If the current retrieval hop count is less than the retrieval hop count threshold, a second knowledge graph entity associated with the first knowledge graph entity can be determined according to the corresponding entity relationship, the current retrieval hop count is updated again, and the third knowledge graph entity associated with the second knowledge graph entity is determined according to the corresponding entity relationship until the current retrieval hop count is greater than or equal to the retrieval hop count threshold, thereby obtaining a set of knowledge graph entities. Then, based on the set of knowledge graph entities, the triplet information to which each knowledge graph entity belongs is determined to obtain a set of triplet information, where the triplet information K can be represented as: s i Represents the main entity, r i Represents an object entity, o i This represents an entity relationship, and N represents the number of triples.

[0069] Optionally, if a target relation set is extracted, the step of retrieving triple information matching the target relation from a preset domain knowledge graph based on the target relation set to obtain a triple information set includes: retrieving entity relations matching the target relation from the preset domain knowledge graph until the retrieval is successful or the number of retrievals reaches a preset retrieval threshold to obtain retrieval results; if the retrieval is successful, determining the target entity relations matching the target relation based on the retrieval results to obtain a target entity relation set; and determining the triple information to which each target entity relation belongs based on the target entity relation set to obtain a triple information set.

[0070] In this embodiment of the invention, if a set of target relations is extracted from the target problem, entity relations matching the target relations can be retrieved from a preset domain knowledge graph. If the retrieval is successful, the retrieval stops, and the triple information of the relations in the retrieved domain knowledge graph is obtained (in the case of successful retrieval, the target entity relations matching the target relations are determined based on the retrieval results, a set of target entity relations is obtained, and based on the set of target entity relations, the triple information of each target entity relation is determined, a set of triple information is obtained); if the retrieval is not successful after the number of retrievals reaches a preset retrieval threshold (which can be set according to the actual situation, for example, 3 times), the retrieval stops.

[0071] Optionally, after retrieving triple information matching the target entity from a preset domain knowledge graph based on the target entity set to obtain a triple information set, the method further includes: connecting the subject entity, object entity, and entity relationship in the triple information to obtain the answer text, wherein the triple information corresponds to an association value associated with the target entity; and sorting all the answer texts based on the association value to obtain the answer text set.

[0072] In this embodiment of the invention, the input to the inference model is in text form. Therefore, it is necessary to transform the question-related triples retrieved from the domain knowledge graph into a variable-length text series. Specifically, the subject entity, entity relation, and object entity of the triple can be connected linearly to generate knowledge text (i.e., connecting the subject entity, object entity, and entity relation in the triple information to obtain the answer text). In this embodiment, the association value between the triple information and the target entity can be determined based on the number of retrieval hops experienced when retrieving the triple information. Then, all answer texts are sorted according to the association value to obtain a sorted set of answer texts.

[0073] Step S304: Based on the triplet information set and the question prompt information, construct input knowledge information, input the input knowledge information into the preset reasoning model, and output the target answer to the target question.

[0074] In this embodiment of the invention, the answer text set k needs to be converted into an answer prompt information set k', and then the answer prompt information set is preset into the question prompt information to obtain input knowledge information. After that, the input knowledge information is input into a preset reasoning model, and the preset reasoning model generates an answer and returns the final question and answer result (i.e., the target answer).

[0075] Optionally, the step of constructing input knowledge information based on the triplet information set and question prompt information includes: constructing an answer prompt template, wherein the answer prompt template includes: answer instructions; based on the answer prompt template, adding answer instructions to each answer text in the answer text set to generate an answer prompt information set; and concatenating the question prompt information and the answer prompt information set to obtain the input knowledge information.

[0076] In this embodiment of the invention, an answer prompt template can be constructed first. This template includes an answer instruction (e.g., the answer to the question is as follows). Then, based on the answer prompt template, the answer instruction is added to each answer text in the answer text set to generate an answer prompt information set. For example, if the answer text set k is "The author of a certain book is A, the author of a certain book is A+B, and the translator of a certain book is C", then according to the answer prompt template, the generated answer prompt information set k' is "The answer to the question is as follows: The author of a certain book is A, the author of a certain book is A+B, and the translator of a certain book is C". Afterwards, the question prompt information and the answer prompt information set are concatenated to obtain the input knowledge information [x′,k′], where [] represents a connection.

[0077] Optionally, the step of inputting input knowledge information into a preset reasoning model and outputting the target answer to the target question includes: analyzing the question prompt information using the preset reasoning model to obtain an answer set, wherein the preset reasoning model is a reasoning model pre-trained using a training data set, the training data set including: a set of historical questions and historical answers corresponding to each historical question in the set of historical questions; representing the input knowledge information as preset conditions, and determining the conditional probability value of each answer in the answer set based on the preset conditions; and determining the answer indicated by the maximum conditional probability value as the target answer.

[0078] In this embodiment of the invention, the preset reasoning model is a reasoning model pre-trained using a training data set (including: a set of historical questions and historical answers corresponding to each historical question in the set of historical questions). The reasoning model can be various algorithmic models, such as a model that uses a deep neural network to learn the complex relationship between questions and answers, or a model that learns the statistical relationship between questions and answers by analyzing a large amount of data, etc., and is not limited here.

[0079] In this embodiment of the invention, after obtaining the input knowledge information [x′,k′], the input knowledge information [x′,k′] can be injected into a preset inference model. Then, the preset inference model is used to analyze the question prompt information x′ to obtain the answer set. Furthermore, the preset inference model can use the input knowledge information as preset conditions and determine the conditional probability value of each answer in the answer set (i.e., P(y|[x′,k′]), where y represents a certain answer in the answer set) based on the preset conditions. Finally, the answer indicated by the maximum conditional probability value is determined as the target answer and output.

[0080] The following describes in detail another optional implementation method.

[0081] Figure 4 This is a schematic diagram of an optional knowledge question-answering reasoning process based on a domain knowledge graph according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following:

[0082] (1) Obtain the question and add instructions to the question according to the template to obtain the question prompt;

[0083] (2) Extract entities from the problem to obtain entity and relation elements, and then perform knowledge retrieval in the domain knowledge graph based on the entity and relation elements to obtain triples (problem-related);

[0084] (3) Then, the triplet (problem-related) is converted into colloquial language to generate knowledge text;

[0085] (4) Add instructions to the knowledge text according to the template to obtain knowledge prompts (facts), and then pre-set the knowledge prompts (facts) into the question prompts to merge them into knowledge prompts;

[0086] (5) Inject the hints into the reasoning model, analyze them through the reasoning model, and generate the answer to the question.

[0087] This invention proposes a method for generating knowledge hints based on domain knowledge graphs to enhance the model's professional knowledge reasoning ability. This method addresses issues such as poor reliability of model-generated results and potential biases and fairness problems in related technologies. Furthermore, by fully utilizing the factual advantages of existing domain knowledge graph data assets, it can iteratively enhance the model's reasoning ability, offering advantages such as greater scenario adaptability, higher flexibility, and lower cost. In addition, this embodiment generates factual answers based on factual knowledge as conditions for the reasoning model, effectively avoiding logically confused answers generated by the model. It also maintains the model's parameters unchanged, eliminating the need for fine-tuning during knowledge updates. This makes it more flexible and cost-effective for scenarios where domain knowledge updates rapidly and drastically.

[0088] The following is a detailed description with reference to another embodiment.

[0089] Example 2

[0090] The knowledge question answering device based on domain knowledge graph provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in Embodiment 1 above.

[0091] Figure 5 This is a schematic diagram of an optional knowledge question answering device based on a domain knowledge graph according to an embodiment of the present invention, such as... Figure 5 As shown, the knowledge question-answering device may include: a receiving unit 50, an extraction unit 51, a retrieval unit 52, and a construction unit 53, wherein...

[0092] The receiving unit 50 is used to receive the target question, process the target question, and obtain the question prompt information;

[0093] Extraction unit 51 is used to extract a target entity set or a target relation set based on the target problem, wherein the target entity set includes multiple target entities and the target relation set includes multiple target relations;

[0094] The retrieval unit 52 is used to retrieve triple information matching the target entity from a preset domain knowledge graph based on the target entity set when the target entity set is extracted, or to retrieve triple information matching the target relation from a preset domain knowledge graph based on the target relation set when the target relation set is extracted, thereby obtaining a triple information set.

[0095] The construction unit 53 is used to construct input knowledge information based on the triplet information set and the question prompt information, and input the input knowledge information into the preset reasoning model to output the target answer to the target question.

[0096] The aforementioned knowledge-based question-answering device can receive a target question through a receiving unit 50, process the target question to obtain question prompt information, extract a target entity set or a target relation set based on the target question through an extraction unit 51, and retrieve, if the target entity set is extracted, retrieve triple information matching the target entity from a preset domain knowledge graph based on the target entity set, or if the target relation set is extracted, retrieve triple information matching the target relation from a preset domain knowledge graph based on the target relation set to obtain a triple information set. The construction unit 53 constructs input knowledge information based on the triple information set and the question prompt information, inputs the input knowledge information into a preset reasoning model, and outputs the target answer to the target question. In this embodiment of the invention, the received target question can be processed first to obtain question prompt information. A set of target entities or a set of target relationships can be extracted from the target question. Based on the set of target entities, triple information matching the target entities can be retrieved from a preset domain knowledge graph; or based on the set of target relationships, triple information matching the target relationships can be retrieved from the preset domain knowledge graph. Then, based on the obtained set of triple information and the question prompt information, input knowledge information is constructed. This input knowledge information is then input into a preset reasoning model to obtain the target answer to the output target question. By combining the preset domain knowledge graph, the question can be constructed as input knowledge information. Processing the input knowledge information through the preset reasoning model reduces bias in the model's reasoning process and improves the accuracy of knowledge-based question-and-answer reasoning for the question. This solves the technical problem of low accuracy in knowledge-based question-and-answer reasoning for questions in related technologies.

[0097] Optionally, the receiving unit includes: a first construction module for constructing a problem prompt template, wherein the problem prompt template includes: a problem instruction; and a first generation module for adding a problem instruction to a target problem based on the problem prompt template to generate problem prompt information.

[0098] Optionally, the extraction unit includes: a first processing module for segmenting the target question into multiple words; a first analysis module for analyzing the words and determining their word types; a first determination module for determining the words indicated by the word type as target entities when the word type is a first preset type, or determining the words indicated by the word type as target relations when the word type is a second preset type, thus obtaining a set of target relations; a second determination module for determining the context information of the target question when none of the word types are the first or second preset types, and supplementing the target entities corresponding to the target question based on the context information; and a second generation module for generating a set of target entities based on all target entities.

[0099] Optionally, the triple information includes: a subject entity, an object entity, and an entity relation. The retrieval unit includes: a third determining module for determining a retrieval hop count threshold and an initial retrieval hop count; a first retrieval module for retrieving knowledge graph entities matching the target entity from a preset domain knowledge graph, wherein the knowledge graph entity is a subject entity or an object entity; a first updating module for updating the initial retrieval hop count when a first knowledge graph entity matching the target entity is retrieved, to obtain the current retrieval hop count; a fourth determining module for determining a second knowledge graph entity associated with the first knowledge graph entity based on entity relations when the current retrieval hop count is less than the retrieval hop count threshold; a second updating module for updating the current retrieval hop count and continuing to determine a third knowledge graph entity associated with the second knowledge graph entity based on entity relations, until the current retrieval hop count is greater than or equal to the retrieval hop count threshold, to obtain a set of knowledge graph entities; and a fifth determining module for determining the triple information to which each knowledge graph entity belongs based on the set of knowledge graph entities, to obtain a set of triple information.

[0100] Optionally, the retrieval unit further includes: a second retrieval module, used to retrieve entity relationships matching the target relationship from a preset domain knowledge graph until the retrieval is successful or the number of retrievals reaches a preset retrieval threshold, and obtain retrieval results; a sixth determination module, used to determine the target entity relationships matching the target relationship based on the retrieval results when the retrieval is successful, and obtain a set of target entity relationships; and a seventh determination module, used to determine the triplet information to which each target entity relationship belongs based on the set of target entity relationships, and obtain a set of triplet information.

[0101] Optionally, the knowledge question answering device further includes: a first connection module, used to retrieve triple information matching the target entity from a preset domain knowledge graph based on the target entity set, and after obtaining a triple information set, connect the subject entity, object entity and entity relationship in the triple information to obtain the answer text, wherein the triple information corresponds to an association value associated with the target entity; and a first sorting module, used to sort all the answer texts based on the association value to obtain a set of answer texts.

[0102] Optionally, the construction unit includes: a second construction module for constructing an answer prompt template, wherein the answer prompt template includes an answer instruction; a third generation module for adding an answer instruction to each answer text in the answer text set based on the answer prompt template to generate an answer prompt information set; and a first splicing module for splicing the question prompt information and the answer prompt information set to obtain the input knowledge information.

[0103] Optionally, the construction unit further includes: a second analysis module, used to analyze the question prompt information using a preset reasoning model to obtain an answer set, wherein the preset reasoning model is a reasoning model pre-trained using a training data set, the training data set including: a set of historical questions and historical answers corresponding to each historical question in the set of historical questions; an eighth determination module, used to represent the input knowledge information as preset conditions, and based on the preset conditions, determine the conditional probability value of each answer in the answer set; and a ninth determination module, used to determine the answer indicated by the maximum conditional probability value as the target answer.

[0104] The aforementioned knowledge-based question-and-answer device may also include a processor and a memory. The receiving unit 50, extraction unit 51, retrieval unit 52, and construction unit 53 are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0105] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, input knowledge information is constructed based on the triplet information set and question prompts. This input knowledge information is then fed into a preset reasoning model to output the target answer to the target question.

[0106] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0107] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: receiving a target question, processing the target question to obtain question prompt information, extracting a target entity set or a target relation set based on the target question, and, if a target entity set is extracted, retrieving triple information matching the target entities from a preset domain knowledge graph based on the target entity set, or, if a target relation set is extracted, retrieving triple information matching the target relations from a preset domain knowledge graph based on the target relation set to obtain a triple information set, constructing input knowledge information based on the triple information set and the question prompt information, inputting the input knowledge information into a preset reasoning model, and outputting the target answer to the target question.

[0108] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the above-described knowledge question answering method based on domain knowledge graph.

[0109] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-described knowledge question answering method based on domain knowledge graph.

[0110] Figure 6 This is a hardware structure block diagram of an electronic device (or mobile device) for a knowledge question answering method based on a domain knowledge graph, according to an embodiment of the present invention. Figure 6 As shown, an electronic device may include one or more ( Figure 6 The processor 602 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 604 for storing data may also be included. In addition, it may include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 6 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device may also include components that are more... Figure 6 The more or fewer components shown, or having the same Figure 6 The different configurations shown.

[0111] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0112] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

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

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

[0115] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0116] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0117] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A knowledge question answering method based on domain knowledge graphs, characterized in that, include: Receive the target question, process the target question, and obtain the question prompt information; Based on the target problem, a target entity set or a target relation set is extracted, wherein the target entity set includes multiple target entities, and the target relation set includes multiple target relations; If the target entity set is extracted, triple information matching the target entity is retrieved from a preset domain knowledge graph based on the target entity set; or if the target relation set is extracted, triple information matching the target relation is retrieved from a preset domain knowledge graph based on the target relation set, to obtain a triple information set. Based on the triplet information set and the question prompt information, input knowledge information is constructed, and the input knowledge information is input into a preset reasoning model to output the target answer to the target question. The step of retrieving triplet information set by extracting the target relation set and then retrieving triplet information set from a preset domain knowledge graph based on the target relation set includes: The system retrieves entity relationships that match the target relationship from the preset domain knowledge graph until a successful retrieval or the number of retrievals reaches a preset retrieval threshold, and then obtains the retrieval results. If the retrieval is successful, the target entity relationships that match the target relationship are determined based on the retrieval results, and a set of target entity relationships is obtained. Based on the target entity relationship set, the triplet information to which each target entity relationship belongs is determined, thus obtaining the triplet information set.

2. The knowledge question-answering method according to claim 1, characterized in that, The steps for processing the target problem and obtaining problem prompt information include: Construct a problem prompt template, wherein the problem prompt template includes: a problem instruction; Based on the aforementioned problem prompt template, the problem instruction is added to the target problem to generate the problem prompt information.

3. The knowledge question-answering method according to claim 1, characterized in that, Based on the stated objective problem, the steps for extracting the target entity set or the target relation set include: The target problem is processed by word segmentation to obtain multiple words; The word segments are analyzed to determine their word types; If the word type is a first preset type, the word segment indicated by the word type is determined as the target entity; or, if the word type is a second preset type, the word segment indicated by the word type is determined as the target relation, thereby obtaining the target relation set. If none of the stated word types are the first preset type or the second preset type, determine the context information of the target question, and based on the context information, supplement the target entity corresponding to the target question; Based on all the target entities, the target entity set is generated.

4. The knowledge question-answering method according to claim 1, characterized in that, The triple information includes: subject entity, object entity, and entity relationship. Given the extracted target entity set, the step of retrieving triple information matching the target entity from a preset domain knowledge graph based on the target entity set to obtain a triple information set includes: Determine the retrieval hop count threshold and the initial retrieval hop count; Retrieve knowledge graph entities that match the target entity from the preset domain knowledge graph, wherein the knowledge graph entity is the subject entity or the object entity; If a first knowledge graph entity matching the target entity is found, the initial retrieval hop count is updated to obtain the current retrieval hop count; If the current retrieval hop count is less than the retrieval hop count threshold, a second knowledge graph entity associated with the first knowledge graph entity is determined based on the entity relationship; Update the current retrieval hop count, and continue to determine the third knowledge graph entity associated with the second knowledge graph entity based on the entity relationship, until the current retrieval hop count is greater than or equal to the retrieval hop count threshold, and obtain the knowledge graph entity set; Based on the knowledge graph entity set, the triple information to which each knowledge graph entity belongs is determined, thus obtaining the triple information set.

5. The knowledge question-answering method according to claim 1, characterized in that, After obtaining the set of triple information, it also includes: By connecting the subject entity, object entity, and entity relationship in the triple information, the answer text is obtained, wherein the triple information corresponds to an association value associated with the target entity; Based on the association value, all the answer texts are sorted to obtain a set of answer texts.

6. The knowledge question-answering method according to claim 5, characterized in that, The steps for constructing input knowledge information based on the triplet information set and the question prompt information include: Construct an answer prompt template, wherein the answer prompt template includes: answer instructions; Based on the answer prompt template, the answer instruction is added to each answer text in the answer text set to generate an answer prompt information set; The input knowledge information is obtained by combining the question prompt information and the answer prompt information.

7. The knowledge question-answering method according to claim 6, characterized in that, The steps of inputting the input knowledge information into a preset reasoning model and outputting the target answer to the target question include: The question prompt information is analyzed using the preset reasoning model to obtain a set of answers. The preset reasoning model is a reasoning model pre-trained using a training data set, which includes: a set of historical questions and historical answers corresponding to each historical question in the set of historical questions. The input knowledge information is represented as preset conditions, and based on the preset conditions, the conditional probability value of each answer in the answer set is determined; The answer indicated by the maximum conditional probability value is determined as the target answer.

8. A knowledge question-answering device based on a domain knowledge graph, characterized in that, include: A receiving unit is used to receive the target question, process the target question, and obtain question prompt information; An extraction unit is configured to extract a set of target entities or a set of target relationships based on the target problem, wherein the set of target entities includes multiple target entities, and the set of target relationships includes multiple target relationships; The retrieval unit is configured to, when the target entity set is extracted, retrieve triplet information matching the target entity from a preset domain knowledge graph based on the target entity set, or, when the target relation set is extracted, retrieve triplet information matching the target relation from a preset domain knowledge graph based on the target relation set, thereby obtaining a triplet information set; The construction unit is used to construct input knowledge information based on the triplet information set and the question prompt information, input the input knowledge information into a preset reasoning model, and output the target answer to the target question; The retrieval unit further includes: a second retrieval module, used to retrieve entity relationships matching the target relationship from a preset domain knowledge graph until the retrieval is successful or the number of retrievals reaches a preset retrieval threshold, and obtain retrieval results; a sixth determination module, used to determine the target entity relationships matching the target relationship based on the retrieval results when the retrieval is successful, and obtain a set of target entity relationships; and a seventh determination module, used to determine the triplet information to which each target entity relationship belongs based on the set of target entity relationships, and obtain a set of triplet information.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the knowledge question answering method based on any one of claims 1 to 7.

10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the knowledge question answering method based on any one of claims 1 to 7.