Knowledge graph construction method, knowledge question and answer method and device
Patent Information
- Application Number
- CN202611234269.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-10-20
AI Technical Summary
[0003]在实际应用场景中,企业知识形态复杂、来源广泛,可能覆盖多个服务场景或技术域,广泛分布于多类结构化与非结构化载体中,如技术文档、行业规范、产品说明、代码库及代码注释等,对相关智能问答系统的信息检索、理解及推理造成较大障碍,相关智能问答系统难以给出高质量答案
[0041]上述实施例,通过对来自不同信息源的各个原始文档进行分句处理,得到多个句子,任一句子均可以作为知识图谱中的一个句子节点,并对其中的第一句子节点和第二句子节点,构建二者之间的相似度边、位置边和实体边等至少一种第一关联边,得到知识图谱。基于此,在接收到待回答的当前问题的情况下,可以在上述知识图谱中进行检索,得到答题辅助信息,并根据该答题辅助信息,生成当前问题对应的当前答案。由于上述知识图谱以句子为最小粒度节点,相对于以文本块为节点的知识图谱,可以实现更精细的信息定位,提升知识检索的准确度,在应用于知识问答场景下时,可以减少噪声信息的引入,提升答案质量。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This specification relates to the field of artificial intelligence technology in one or more embodiments, and in particular to a knowledge graph construction method, a knowledge question answering method and apparatus. Background Technology
[0002] In recent years, large model technology has made significant progress in fields such as natural language understanding, intelligent dialogue, and human-computer interaction, and has gradually become an important infrastructure for enterprise knowledge management and information services, driving the transformation of related intelligent service systems from simple text matching and retrieval modes to intelligent question-answering modes driven by knowledge understanding and reasoning.
[0003] In real-world applications, enterprise knowledge is complex in form and comes from a wide range of sources, potentially covering multiple service scenarios or technical domains. It is widely distributed across various structured and unstructured carriers, such as technical documents, industry standards, product specifications, code libraries, and code comments. This poses significant obstacles to information retrieval, understanding, and reasoning by relevant intelligent question-answering systems, making it difficult for them to provide high-quality answers.
[0004] Therefore, how to improve the quality of knowledge-based question answering has become a technical problem that urgently needs to be solved by those in the field. Summary of the Invention
[0005] This specification provides one or more embodiments of a knowledge graph construction method, a knowledge question answering method, and an apparatus to improve the quality of knowledge question answering.
[0006] Firstly, one or more embodiments of this specification provide a knowledge graph construction method, including: Segment each original document in the original document collection to obtain multiple sentences; Each sentence is treated as a sentence node, and a first association edge is constructed for the first sentence node and the second sentence node among the multiple sentence nodes to obtain a knowledge graph. The first association edge includes at least one of similarity edge, position edge and entity edge. The similarity edge represents the semantic similarity between the first sentence corresponding to the first sentence node and the second sentence corresponding to the second sentence node. The position edge represents that the first sentence and the second sentence belong to the same original document. The entity edge represents that the first sentence and the second sentence contain at least one common entity.
[0007] In one possible implementation, the above method further includes: If the current answer to the current question is generated based on the knowledge graph, an experience node is generated based on the current answer and added to the knowledge graph. Construct a second association edge between the experience node and at least one sentence node.
[0008] In one possible implementation, a first association edge is constructed for the first sentence node and the second sentence node among multiple sentence nodes, including: Entity extraction is performed on the first sentence and the second sentence to obtain the first sentence entity set corresponding to the first sentence node and the second sentence entity set corresponding to the second sentence node; If the intersection of the first sentence entity set and the second sentence entity set is not an empty set, generate entity edges between the first sentence node and the second sentence node; The weights of the entity edges are determined based on the importance scores of each entity in the intersection, wherein the importance scores characterize the importance of the corresponding entity in the multiple sentences, and the importance scores are related to the number of times the corresponding entity appears in the multiple sentences.
[0009] In one possible implementation, a first association edge is constructed for the first sentence node and the second sentence node among multiple sentence nodes, including: If both the first sentence and the second sentence belong to the first original document, generate a positional edge between the first sentence node and the second sentence node; The weight of the position edge is determined based on the distance between the first sentence and the second sentence in the first original document.
[0010] In one possible implementation, a first association edge is constructed for the first sentence node and the second sentence node among multiple sentence nodes, including: If the semantic similarity between the first sentence and the second sentence meets the preset conditions, a similarity edge is generated between the first sentence node and the second sentence node. The weights of the similarity edges are determined based on the semantic similarity between the first sentence and the second sentence.
[0011] One possible implementation involves generating experience nodes based on the current answer, including: Determine the quality score of the current answer; If the quality score is greater than a preset quality score threshold, a standard experience node is generated based on the current answer and the retrieval context. The retrieval context includes information related to the current question retrieved based on the knowledge graph. The standard experience node includes a first set of experience entities and answer notes. The first set of experience entities includes entities obtained based on at least one of the current answer and the retrieval context. If the quality score is not greater than a preset quality score threshold, a reflective experience node is generated based on the current answer and the retrieval context. The reflective experience node includes a second set of experience entities, which includes entities that need to be retrieved to answer the current question, determined based on at least one of the current answer and the retrieval context.
[0012] In one possible implementation, constructing a second association edge between the experience node and at least one sentence node includes: The degree of association between the experience node and each sentence node is determined based on the set of experience entities corresponding to the experience node and the set of sentence entities corresponding to each sentence node. For a third sentence node whose association density is greater than a preset association density threshold, a second association edge is generated between the experience node and the third sentence node.
[0013] Secondly, one or more embodiments of this specification provide a knowledge question-answering method, including: Based on the current question to be answered, a search is performed in the knowledge graph to obtain answer-supporting information, wherein the knowledge graph is constructed based on the method described in the first aspect; Based on the answer assistance information, generate the current answer to the current question.
[0014] In one possible implementation, based on the current question to be answered, a search is performed in the knowledge graph to obtain answer-supporting information, including: The current problem is decomposed into at least one sub-problem; For the sub-question, a search is performed in the knowledge graph to obtain the target seed set corresponding to the sub-question, and a sub-answer corresponding to the sub-question is generated based on the target seed set; wherein, the target seed set includes at least one sentence node in the knowledge graph related to the sub-question, and the answer assistance information includes at least one of the sub-question and the sub-answer.
[0015] In one possible implementation, generating the current answer to the current question based on the answer assistance information includes: Based on the current question, the multiple sub-answers are integrated to obtain the first answer; A second answer is generated based on the current problem, the sub-problems, and the target seed set; The first answer and the second answer are combined to obtain the current answer.
[0016] One possible implementation involves retrieving answer-supporting information from a knowledge graph based on the current question to be answered, and also includes: An experience subset is determined based on the first similarity between the current question and each experience node in the knowledge graph. The experience subset includes at least one associated experience node, and the first similarity corresponding to the associated experience node satisfies a first preset condition. The answer-answering assistance information also includes the experience subset.
[0017] In one possible implementation, for the sub-problem, a search is performed in the knowledge graph to obtain the target seed set corresponding to the sub-problem, including: For the sub-problem, the sub-problem is concatenated with the set of experience entities corresponding to each associated experience node in the experience subset to generate an enhanced query statement corresponding to the sub-problem; Based on the enhanced query statement, a search is performed in the knowledge graph to obtain the target seed set.
[0018] In one possible implementation, the target seed set is obtained by searching the knowledge graph based on the enhanced query statement, including: An initial seed set is determined based on the second similarity between the enhanced query statement and each sentence node in the knowledge graph, wherein the initial seed set includes at least one associated sentence node, and the second similarity corresponding to the associated sentence node satisfies a second preset condition; If the information contained in the initial seed set is insufficient to answer the corresponding sub-question, an extended search is performed in the knowledge graph based on each associated sentence node in the initial seed set to obtain the target seed set.
[0019] In one possible implementation, based on each associated sentence node in the initial seed set, an extended retrieval is performed in the knowledge graph to obtain the target seed set, including: If the information contained in the current jump seed set is sufficient to answer the corresponding sub-question, the current jump seed set is used as the target seed set, wherein the current jump seed set includes the initial seed set; If the information contained in the current jump seed set is insufficient to answer the corresponding sub-question, obtain the first-order neighbor nodes of each associated sentence node in the current jump seed set in the knowledge graph; Based on the weight of the first associated edge between the associated sentence node and the first-order neighbor node, and / or the entity matching degree between the first-order neighbor node and the corresponding sub-problem, multiple first-order neighbor nodes are filtered, and the filtered first-order neighbor nodes are added to the current hop seed set to obtain the next hop seed set. Use the next hop seed set as the new current hop seed set to determine whether it is sufficient to answer the corresponding sub-question.
[0020] In one possible implementation, for the sub-problem, the sub-problem is concatenated with the set of experience entities corresponding to each associated experience node in the experience subset to generate an enhanced query statement corresponding to the sub-problem, including: The sub-problems are resolved by substitution to generate an initial query statement; The initial query statement is concatenated with the set of experience entities corresponding to each of the associated experience nodes to obtain the enhanced query statement corresponding to the sub-problem.
[0021] In one possible implementation, generating sub-answers corresponding to the sub-questions based on the target seed set includes: For the sub-question, if the comprehensive experience weight corresponding to the experience subset is greater than the preset experience weight threshold, the target seed set and the answer notes corresponding to the associated experience node are integrated to obtain the context information corresponding to the sub-question, wherein the comprehensive experience weight represents the degree of relevance between the experience subset and the current question; The sub-answers corresponding to the sub-questions are generated based on the context information.
[0022] Thirdly, one or more embodiments of this specification also provide a knowledge graph construction apparatus, including: The document sentence segmentation module is configured to segment each original document in the original document collection into sentences; The knowledge graph construction module is configured to treat each sentence as a sentence node, and to construct a first association edge for the first sentence node and the second sentence node among the multiple sentence nodes to obtain a knowledge graph. The first association edge includes at least one of similarity edge, position edge and entity edge. The similarity edge represents the semantic similarity between the first sentence corresponding to the first sentence node and the second sentence corresponding to the second sentence node. The position edge represents that the first sentence and the second sentence belong to the same original document. The entity edge represents that the first sentence and the second sentence contain at least one common entity.
[0023] In one possible implementation, the knowledge graph construction apparatus may further include: an experience update module, configured to generate an experience node based on the current answer to the current question and add it to the knowledge graph when the current answer to the current question is generated based on the knowledge graph; and to construct a second association edge between the experience node and at least one sentence node.
[0024] In one possible implementation, to construct entity edges, the graph construction module is specifically configured to perform the following operations: Entity extraction is performed on the first sentence and the second sentence to obtain the first sentence entity set corresponding to the first sentence node and the second sentence entity set corresponding to the second sentence node; If the intersection of the first sentence entity set and the second sentence entity set is not an empty set, generate entity edges between the first sentence node and the second sentence node; The weights of the entity edges are determined based on the importance scores of each entity in the intersection, wherein the importance scores characterize the importance of the corresponding entity in the multiple sentences, and the importance scores are related to the number of times the corresponding entity appears in the multiple sentences.
[0025] In one possible implementation, to construct location edges, the graph construction module is specifically configured to perform the following operations: If both the first sentence and the second sentence belong to the first original document, generate a positional edge between the first sentence node and the second sentence node; The weight of the position edge is determined based on the distance between the first sentence and the second sentence in the first original document.
[0026] In one possible implementation, to construct similarity edges, the graph construction module is specifically configured to perform the following operations: If the semantic similarity between the first sentence and the second sentence meets the preset conditions, a similarity edge is generated between the first sentence node and the second sentence node. The weights of the similarity edges are determined based on the semantic similarity between the first sentence and the second sentence.
[0027] In one possible implementation, to generate experience nodes, the aforementioned experience update module is specifically configured to perform the following operations: Determine the quality score of the current answer; If the quality score is greater than a preset quality score threshold, a standard experience node is generated based on the current answer and the retrieval context. The retrieval context includes information related to the current question retrieved based on the knowledge graph. The standard experience node includes a first set of experience entities and answer notes. The first set of experience entities includes entities obtained based on at least one of the current answer and the retrieval context. If the quality score is not greater than a preset quality score threshold, a reflective experience node is generated based on the current answer and the retrieval context. The reflective experience node includes a second set of experience entities, which includes entities that need to be retrieved to answer the current question, determined based on at least one of the current answer and the retrieval context.
[0028] In one possible implementation, to construct a second association edge between an experience node and at least one sentence node, the aforementioned experience update module is specifically configured to perform the following operations: The degree of association between the experience node and each sentence node is determined based on the set of experience entities corresponding to the experience node and the set of sentence entities corresponding to each sentence node. For a third sentence node whose association density is greater than a preset association density threshold, a second association edge is generated between the experience node and the third sentence node.
[0029] Fourthly, one or more embodiments of this specification also provide a knowledge question-answering device, including: The knowledge retrieval module is configured to retrieve answer-aiding information from a knowledge graph based on the current question to be answered, wherein the knowledge graph is constructed based on the method of any one of claims 1 to 7; The answer generation module is configured to generate the current answer to the current question based on the answer assistance information.
[0030] In one possible implementation, to obtain answer-aiding information, the knowledge retrieval module is specifically configured to perform the following operations: The current problem is decomposed into at least one sub-problem; For the sub-question, a search is performed in the knowledge graph to obtain the target seed set corresponding to the sub-question, and a sub-answer corresponding to the sub-question is generated based on the target seed set; wherein, the target seed set includes at least one sentence node in the knowledge graph related to the sub-question, and the answer assistance information includes at least one of the sub-question and the sub-answer.
[0031] In one possible implementation, the answer generation module is specifically configured to perform the following operations: Based on the current question, the multiple sub-answers are integrated to obtain the first answer; A second answer is generated based on the current problem, the sub-problems, and the target seed set; The first answer and the second answer are combined to obtain the current answer.
[0032] In one possible implementation, to obtain answer-aiding information, the knowledge retrieval module is further configured to perform the following operations: An experience subset is determined based on the first similarity between the current question and each experience node in the knowledge graph. The experience subset includes at least one associated experience node, and the first similarity corresponding to the associated experience node satisfies a first preset condition. The answer-answering assistance information also includes the experience subset.
[0033] In one possible implementation, based on the aforementioned subset of experience, to obtain the target seed set corresponding to each sub-problem, the knowledge retrieval module is specifically configured to perform the following operations: For the sub-problem, the sub-problem is concatenated with the set of experience entities corresponding to each associated experience node in the experience subset to generate an enhanced query statement corresponding to the sub-problem; Based on the enhanced query statement, a search is performed in the knowledge graph to obtain the target seed set.
[0034] In one possible implementation, to obtain the target seed set based on the enhanced query statement, the knowledge retrieval module is specifically configured to perform the following operations: An initial seed set is determined based on the second similarity between the enhanced query statement and each sentence node in the knowledge graph, wherein the initial seed set includes at least one associated sentence node, and the second similarity corresponding to the associated sentence node satisfies a second preset condition; If the information contained in the initial seed set is insufficient to answer the corresponding sub-question, an extended search is performed in the knowledge graph based on each associated sentence node in the initial seed set to obtain the target seed set.
[0035] In one possible implementation, to achieve extended retrieval, the knowledge retrieval module is specifically configured to perform the following operations: If the information contained in the current jump seed set is sufficient to answer the corresponding sub-question, the current jump seed set is used as the target seed set, wherein the current jump seed set includes the initial seed set; If the information contained in the current jump seed set is insufficient to answer the corresponding sub-question, obtain the first-order neighbor nodes of each associated sentence node in the current jump seed set in the knowledge graph; Based on the weight of the first associated edge between the associated sentence node and the first-order neighbor node, and / or the entity matching degree between the first-order neighbor node and the corresponding sub-problem, multiple first-order neighbor nodes are filtered, and the filtered first-order neighbor nodes are added to the current hop seed set to obtain the next hop seed set. Use the next hop seed set as the new current hop seed set to determine whether it is sufficient to answer the corresponding sub-question.
[0036] In one possible implementation, to generate enhanced query statements corresponding to each sub-problem, the knowledge retrieval module is specifically configured to perform the following operations: The sub-problems are resolved by substitution to generate an initial query statement; The initial query statement is concatenated with the set of experience entities corresponding to each of the associated experience nodes to obtain the enhanced query statement corresponding to the sub-problem.
[0037] In one possible implementation, to generate corresponding sub-answers based on the target seed set, the knowledge retrieval module is specifically configured to perform the following operations: For the sub-question, if the comprehensive experience weight corresponding to the experience subset is greater than the preset experience weight threshold, the target seed set and the answer notes corresponding to the associated experience node are integrated to obtain the context information corresponding to the sub-question, wherein the comprehensive experience weight represents the degree of relevance between the experience subset and the current question; The sub-answers corresponding to the sub-questions are generated based on the context information.
[0038] Fifthly, one or more embodiments of this specification also provide an electronic device, which includes a memory and a processor; the memory is used to store a computer program product; the processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the method of the first or second aspect described above.
[0039] Sixthly, one or more embodiments of this specification also provide a computer-readable storage medium storing computer program instructions that, when executed, implement the methods of the first or second aspect described above.
[0040] In a seventh aspect, one or more embodiments of this specification also provide a computer program product, the computer program product comprising: a computer program or instructions that, when executed on a computer, cause the computer to implement the methods of the first or second aspect described above.
[0041] The above embodiments involve segmenting original documents from different information sources into sentences, resulting in multiple sentences. Each sentence can serve as a sentence node in the knowledge graph. For the first and second sentence nodes, at least one first association edge (such as a similarity edge, a position edge, or an entity edge) is constructed between them to obtain the knowledge graph. Based on this, when a question to be answered is received, it can be retrieved from the knowledge graph to obtain answer-aiding information, and then the current answer corresponding to the current question can be generated based on this information. Because the knowledge graph uses sentences as the smallest granularity node, compared to knowledge graphs using text blocks as nodes, it can achieve more refined information positioning, improve the accuracy of knowledge retrieval, and reduce the introduction of noise information when applied to knowledge question-answering scenarios, thus improving the quality of answers. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of one or more embodiments of this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of one or more embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This specification provides a schematic diagram of an application scenario for one or more embodiments. Figure 2 A flowchart illustrating a knowledge graph construction method provided in one or more embodiments of this specification; Figure 3 A schematic diagram illustrating the principle of knowledge graph construction provided for one or more embodiments of this specification; Figure 4 A flowchart illustrating another knowledge graph construction method provided in one or more embodiments of this specification; Figure 5 A schematic diagram illustrating the principle of another knowledge graph construction method provided in one or more embodiments of this specification; Figure 6 A flowchart illustrating a knowledge question-answering method provided for one or more embodiments of this specification; Figure 7 A schematic diagram illustrating the principle of a knowledge question-answering method provided in one or more embodiments of this specification; Figure 8 A structural block diagram of a knowledge graph construction apparatus provided in one or more embodiments of this specification; Figure 9 A structural block diagram of a knowledge question-answering device provided for one or more embodiments of this specification; Figure 10 This is a structural block diagram of an electronic device provided for one or more embodiments of this specification. Detailed Implementation
[0044] The present specification describes one or more embodiments in further detail below with reference to the accompanying drawings and examples. Through these descriptions, the features and advantages of one or more embodiments of the present specification will become clearer and more apparent.
[0045] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments. Although various aspects of embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated otherwise.
[0046] Furthermore, the technical features described below in one or more embodiments of this specification may be combined with each other as long as they do not conflict with each other.
[0047] It should be noted that the user information and data involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties.
[0048] The data acquisition and collection actions involved in one or more embodiments of this specification are all performed after authorization by the user, the object, or after full authorization by all parties.
[0049] The user information processed in one or more embodiments of this specification may vary depending on the specific product / service scenario. The specific scenario in which the user uses the product / service shall prevail, and may involve user account information, device information, driving information, vehicle information, or other related information. This application will treat user's personal information and its processing with the utmost diligence.
[0050] This specification and one or more embodiments place great emphasis on the security of user information and have adopted reasonable and feasible security protection measures that comply with industry standards to protect user information and prevent unauthorized access, public disclosure, use, modification, damage or loss of user information.
[0051] To facilitate understanding, the application scenarios of the technical solutions provided in one or more embodiments of this specification will be described below.
[0052] With the development and widespread application of large model technology in fields such as natural language understanding, intelligent dialogue, and human-computer interaction, related intelligent service systems are being transformed from simple text matching and retrieval modes to knowledge understanding and reasoning-driven intelligent question answering modes.
[0053] Figure 1 This diagram illustrates an application scenario provided by one or more embodiments of this specification. (Refer to...) Figure 1 Various fields or enterprises can build intelligent question-answering systems, which include knowledge graphs and knowledge question-answering models. Specifically, knowledge graphs can be built based on information sources such as technical documents, industry standards, product specifications, code repositories, and code comments, integrating knowledge contained in different information sources. Additionally, knowledge question-answering models can be built based on Large Language Models (LLMs) for interaction with users, enabling knowledge-based question answering.
[0054] like Figure 1 As shown, after receiving a question input by a user, the knowledge question answering model retrieves relevant knowledge from a pre-built knowledge graph based on the question, and then performs reasoning based on the retrieved knowledge to generate the answer to the question and provide it back to the user.
[0055] Since knowledge graphs are based on the integration of multiple information sources, they can automatically retrieve various knowledge from different information sources related to the user's input question based on the knowledge question answering model and knowledge graph. Users do not need to view different technical documents, industry standards, etc. to get an answer that integrates multiple knowledge.
[0056] However, in real-world applications, the semantic representation of knowledge varies significantly across different information sources, resulting in poor-quality knowledge graphs that are difficult to support complex problem-solving. Consequently, the generated answers are of poor quality, often exhibiting issues such as one-sided responses, semantic bias, and factual errors.
[0057] To address the aforementioned technical problems, this specification provides one or more embodiments of a knowledge graph construction method, a knowledge question answering method, and an apparatus. The knowledge graph construction method segments original documents from different information sources into multiple sentences, any of which can serve as a sentence node in the knowledge graph. For the first and second sentence nodes, at least one first association edge, such as a similarity edge, a position edge, or an entity edge, is constructed between them to obtain the knowledge graph. The knowledge question answering method searches the knowledge graph constructed by the above method based on the current question to be answered, obtains answer-supporting information, and generates the current answer corresponding to the current question based on this information. Because the knowledge graph constructed by the above method uses sentences as the smallest granularity node, compared to knowledge graphs using text blocks as nodes, it can achieve more refined information positioning, improve the accuracy of knowledge retrieval, and, when applied to knowledge question answering scenarios, reduce the introduction of noise information and improve answer quality.
[0058] The following describes embodiments of the knowledge graph construction method provided in one or more embodiments of this specification.
[0059] Figure 2 This is a flowchart illustrating a knowledge graph construction method provided in one embodiment of this specification. Figure 3 This is a schematic diagram illustrating the principle of a knowledge graph construction method provided in one embodiment of this specification. (Refer to...) Figure 2 and Figure 3 The method includes the following steps.
[0060] Step S110: Segment each original document in the original document set to obtain multiple sentences.
[0061] In some embodiments, the set of original documents used to construct the knowledge graph may include multiple original documents of various types, both structured and unstructured, from different sources and fields, such as technical documents, industry standards, product specifications, code libraries, and code comments.
[0062] In some embodiments, prior to performing sentence segmentation processing (step S110), the process may further include cleaning the individual original documents to reduce noisy data in the original documents while retaining the valid information therein.
[0063] For example, cleaning the original document can specifically include: using regular expressions to remove various Uniform Resource Locators (URLs) and references to various resources (such as text, images, etc.).
[0064] For example, if the original document contains a text segment with a URL such as "Visit http: / / test.cn to view details", using regular expressions to clean it, the URL (i.e., "http: / / test.cn") can be replaced with an empty string to get "Visit to view details".
[0065] For example, if the original document contains the text segment "Please visit our [official website](http: / / test.cn)", then the "official website" in this text segment is a linked text. By using regular expressions to clean it, we can remove the links and syntax symbols, keeping only the text, and get "Please visit our official website".
[0066] For example, structured parsers and natural language processing toolkits can also be used to clean the original documents, thereby improving the accuracy of document cleaning, reducing the destruction of effective information in the documents, and improving the quality of the cleaned documents.
[0067] In some embodiments, in step S110, the document can be segmented based on the title level of the original document, and the resulting sentence segmentation results include the content of each sentence and the title path corresponding to each sentence.
[0068] For example, segmenting the original document into sentences may include: replacing special elements such as links, images, and code blocks in the original document with structured placeholders; cutting the original document into multiple semantic blocks according to the heading level; merging shorter semantic blocks with adjacent semantic blocks using a recursive merging strategy, ensuring that each semantic block does not exceed a preset length threshold (such as 1000 characters), while recording the heading level structure (i.e., heading path) of each semantic block; and combining semantic blocks with actual content into the form of "heading path + content" as a sentence node.
[0069] In the above embodiments, the sentence segmentation process in step S110 not only extracts the text content of each semantic block, but also appends the parent title corresponding to the semantic block as metadata to the semantic block. This makes each sentence obtained from the sentence segmentation actually a semantic block with a complete title path, rather than a simple grammatical sentence. This preserves the structural information of the original document. When retrieving or referencing each sentence in the future, the title path can be used to determine which document and which specific chapter the sentence comes from, thereby accurately locating the context, reducing semantic bias, reducing the illusion of a large model, and improving the readability and credibility of the output content of the large model.
[0070] In some embodiments, for the entire original document set, assuming that N sentences are obtained through sentence segmentation in step S110, these sentences can be recorded in the sentence set P. S ={S1, S2, ..., S...} NThe subsequent steps use the sentence set P. S To process the objects, construct a knowledge graph.
[0071] Step S120: Each sentence is treated as a sentence node, and a first association edge is constructed for the first sentence node and the second sentence node among the multiple sentence nodes to obtain a knowledge graph. The first association edge includes at least one of similarity edge, position edge and entity edge.
[0072] The similarity edges represent the semantic similarity between the first sentence corresponding to the first sentence node and the second sentence corresponding to the second sentence; the position edges represent that the first sentence and the second sentence belong to the same original document; the entity edges represent that the first sentence and the second sentence contain at least one common entity.
[0073] In some embodiments, multiple sentence nodes in the knowledge graph and the first associated edges between sentence nodes can be recorded in the form of a set of sentence nodes and a set of basic edges, respectively. The two sets can be associated for retrieval and location through node identifiers and associated edge identifiers. Based on this, the above-mentioned construction of the first associated edge can specifically be achieved by adding elements representing the first associated edge to the set of basic edges corresponding to the knowledge graph.
[0074] For example, the first associated edge recorded in the above basic edge set may include attributes such as the identifier of the first associated edge and the identifiers of the two sentence nodes connected by the first associated edge.
[0075] The following is combined Figure 3 This section introduces the construction methods of different types of first associated edges. Figure 3 The diagram illustrates a knowledge graph constructed based on sentence nodes and three types of first-order association edges. Sentence nodes and entities are represented by bars and circles, respectively, and the three types of first-order association edges are represented by different line types.
[0076] (a) Construction of entity edges In some embodiments, refer to Figure 3 In step S120 above, constructing entity edges between sentence nodes can specifically include the following steps.
[0077] (1) Entity extraction Entity extraction is performed on each sentence obtained from the sentence segmentation (including the first sentence corresponding to the first sentence node and the second sentence corresponding to the second sentence node) to obtain the sentence entity set corresponding to each sentence node (including the first sentence entity set corresponding to the first sentence node and the second sentence entity set corresponding to the second sentence node).
[0078] For example, large language models (LLMs) can be used to extract entities that are helpful for information retrieval from each sentence, such as organization names, product / service names, technical terms, equipment models, class names, project phase names, etc.
[0079] For example, multi-threaded concurrent processing can be used to extract entities from multiple sentences in parallel, improving processing efficiency; incremental caching can also be supported.
[0080] For example, the collection of sentence entities can be represented as a JSON array.
[0081] For example, the multiple entities corresponding to each sentence obtained through entity extraction can be recorded not only as a set (array) but also as a list, forming a list of entities corresponding to each sentence node. The following explanation uses a set as an example.
[0082] For example, such as Figure 3 As shown, after entity extraction is completed, a mapping between each entity and each original document containing that entity can be established based on the inverted index. This allows for quick retrieval of each original document containing any entity based on the inverted index.
[0083] (2) Calculation of entity importance For each extracted entity, calculate its importance score in all sentences.
[0084] For example, a sentence can correspond to a sentence entity set, which contains at least one entity. The importance score of each entity is calculated, that is, the importance of each entity relative to the entire sentence entity set is calculated.
[0085] For example, the importance score for any entity e can be calculated based on the matching algorithm (Best Match 25, BM25) obtained after 25 iterations of optimization. The specific calculation steps are as follows: (2.1) Calculate the IDF term corresponding to entity e, i.e., IDF(e). The IDF mentioned above stands for Inverse Document Frequency, used to measure the scarcity or information content of an entity. The calculation formula is as follows: .
[0086] In the above formula, N represents the total number of sentences in the sentence set corresponding to the entire original document set obtained through sentence segmentation in step S110, which is also the total number of sentence nodes in the knowledge graph to be constructed, and the total number of sentence entity sets obtained through entity extraction; n(e) is the number of sentences containing entity e. Based on the above formula, it can be seen that the larger the IDF(e), the smaller the frequency of entity e in the entire original document set, and the higher the importance of entity e.
[0087] (2.2) Calculate the importance score of entity e in each sentence. Based on the IDF term corresponding to entity e, calculate the value of entity e in each sentence S. i Importance score Score(e, S) in (i∈{1,2,...,N}) i The calculation formula is: .
[0088] In the above formula, f(e, S) i ) is entity e in sentence S i The number of times it appears in |S i |For sentence S i The total number of entities contained in sentence S, that is, the total number of entities contained in sentence S. i The corresponding sentence entity set contains the number of elements; k1 and b are preset adjustable hyperparameters; Avgdl is the average number of entities contained in the N sentences corresponding to the original document set, that is, the average number of elements contained in the N sentence entity sets, i.e., Avgdl=(∑|S i |) / N.
[0089] The calculation of the above formula is based on the fact that entities that appear frequently in most sentences are general entities with low importance, while specific entities that appear in a few sentences have higher importance.
[0090] (2.3) Calculate the importance score of entity e. The importance score Score(e) of entity e is the average importance score of entity e in all sentences, i.e., Score(e) = (∑Score(e, S...)). i )) / N.
[0091] Based on the above calculation process, it can be seen that the importance score represents the importance of the corresponding entity in all sentences (i.e., the sentence set P mentioned above). S The importance of the corresponding entity in the sentence is related to the number of times the corresponding entity appears in the entire sentence.
[0092] In some embodiments, for each sentence node, entities whose importance scores exceed a preset score threshold can also be considered as important entities corresponding to that sentence node.
[0093] In some embodiments, for each sentence node, the K1 (i.e., Top-K1) entities with the highest importance scores in the corresponding sentence entity set can be selected as the important entities corresponding to the sentence node; where K1 is a positive integer, and its specific value can be configured according to actual application requirements, which is not limited in this embodiment.
[0094] In some embodiments, the important entities corresponding to each sentence node, determined according to the importance score, can be recorded and stored in the form of a set, forming a set of important entities corresponding to each sentence node.
[0095] (3) Construct entity edges In some embodiments, for a first sentence node and a second sentence node whose intersection of sentence entity sets is not empty, an entity edge is generated to connect the two. That is, for any two sentence nodes, an entity edge is constructed between the two sentence nodes only if the intersection of their corresponding sentence entity sets is not empty, i.e., if they contain at least one common entity; otherwise, no entity edge exists between two sentence nodes that do not contain common entities.
[0096] like Figure 3 In the knowledge graph shown, there is an entity edge between sentence nodes v1 and v3, indicating that they have at least one common entity.
[0097] In some embodiments, the weight of an entity edge can be determined based on the importance scores of each entity in the intersection of the sentence entity sets corresponding to two sentence nodes.
[0098] For example, for two sentence nodes v that have at least one identical entity i and v j (i∈{1,2,...,N},j∈{1,2,...,N},i≠j), the weight of the entity edge between them can be denoted as w. ent (v i ,v j The following formula can be used to calculate it: .
[0099] Among them, E i For sentence node v i The corresponding set of sentence entities, E j For sentence node v j The corresponding set of sentence entities, weight w ent (v i ,v j ) represents two sentence entity sets E i and E j Each entity in the intersection of (i.e., e∈E)i ∩E j The sum of importance scores.
[0100] In some embodiments, the decision to construct an entity edge between two sentence nodes can be based on the set of important entities corresponding to those two sentence nodes. That is, an entity edge is constructed only if the intersection of the sets of important entities corresponding to the two sentence nodes is not empty, or if the two sentence nodes contain at least one common important entity. Based on this, the weight of the entity edge can also be the sum of the importance scores of each important entity in the intersection of the sets of important entities corresponding to the two sentence nodes.
[0101] In the above embodiments, entity edges are constructed for two sentence nodes that contain at least one identical entity, and the weight of the entity edge is configured according to the importance score of each identical entity. The two sentence nodes with entity edges can come from the same original document or different original documents. Thus, cross-document information discovery and association can be achieved through entity edges, and multi-hop cross-document retrieval can be achieved based on entity edges, thereby improving the richness of knowledge retrieval or question answering results and document coverage.
[0102] (ii) Construction of position edges In some embodiments, the construction of a first association edge for the first sentence node and the second sentence node among multiple sentence nodes in step S120 may specifically include: generating a position edge between the first sentence node and the second sentence node when both the first sentence and the second sentence belong to the first original document.
[0103] In other words, positional edges are constructed between two sentence nodes belonging to the same original document, while no positional edges exist between two sentence nodes belonging to different original documents. Or, to put it another way, for any sentence node v... i The sentence node v can be connected via positional edges. i In its original document D S One or more sentence nodes that are adjacent in position.
[0104] For example, for any sentence node v i It can be calculated that it is related to its original document D. S Another sentence node v j If the positional distance d(i,j) between them does not exceed a preset threshold, then a connecting sentence node v is generated. i and v j The position of the edge.
[0105] For example, for any sentence node v i After calculating its relationship with the original document D,S After determining the positional distances between other sentence nodes in the document, the original document D can be processed in ascending order of positional distance. S Sort the other sentence nodes in the table, and select the top K2 other sentence nodes, along with sentence node v. i Construct position edges; where K2 is a positive integer, and its specific value can be configured according to actual application requirements. This embodiment does not limit this.
[0106] like Figure 3 In the knowledge graph shown, there is a positional edge between sentence nodes v1 and v2, indicating that sentence nodes v1 and v2 come from the same original document and are relatively close in position within the original document; there is also a positional edge between sentence nodes v1 and v3, indicating that sentence nodes v1 and v3 also come from the same original document and are relatively close in position within the original document.
[0107] In some embodiments, the weight of the positional edge between the first sentence node and the second sentence node can be determined based on the positional distance between the first sentence and the second sentence in their respective first original documents.
[0108] Still using the two sentence nodes v mentioned above i and v j For example, suppose the two belong to the same original document D. S Both are in the original document D S Let the positional distance between them be d(i,j), and the weight of the edge between them be w. pos (v i ,v j The following formula can be used to calculate it: .
[0109] Based on the above formula for calculating the weight of position edges, it can be seen that the greater the positional distance between two sentence nodes, the smaller the weight of their position edges.
[0110] In the above embodiments, by constructing positional edges, the contextual coherence between different sentence nodes can be captured, thereby achieving local semantic connectivity.
[0111] (III) Construction of similarity edges In some embodiments, refer to Figure 3 In step S120 above, constructing similarity edges between sentence nodes can specifically include the following steps.
[0112] (1) Vector representation of sentences (Embedding) In some embodiments, each sentence obtained in step S110 can be mapped to a low-dimensional dense vector that can be processed by a large language model using a pre-trained Embedding model, for use in steps such as knowledge graph construction and retrieval.
[0113] For example, the Qwen3-Embedding-8B model can be used to process each sentence in batches, obtain the Embedding vector corresponding to each sentence, and cache the processing results for later use.
[0114] For example, each sentence node can be represented by a corresponding vector. For example, the sentence set P mentioned above... S Sentences S1~S N Convert them into their respective vectors. ~ ; with the i-th sentence node v i For example, suppose its corresponding vector If it is a d-dimensional vector, then it can be represented as =[v i,1 v i,2 , ..., v i,d ], v i,1 ~v i,d For vectors The d elements in the array.
[0115] (2) Similarity calculation For any two sentence nodes v i and v j Its semantic similarity Sim(v i ,v j These are the two vectors corresponding to the two sentence nodes. and The cosine similarity between them is calculated using the following formula: Sim(v i ,v j =Cosine( , )= .
[0116] in, Representing vectors The length of the vector. Each element v in i,1 ~v i,d The square root of the sum of squares, that is = ; Representing vectors The length.
[0117] In some embodiments, to simplify calculations and reduce the impact of sentence length, the vectors of each sentence node can be normalized before calculating semantic similarity. Without changing the vector direction, the vector length can be scaled to the same size, so that the semantic similarity between the two can be directly measured by calculating cosine similarity.
[0118] For example, Euclidean normalization (L2 normalization) can be used to normalize the vectors corresponding to each sentence node so that the length of each normalized vector is 1.
[0119] Using the above sentence node v i For example, by its vector Perform L2 normalization to obtain the L2 normalized vector. The calculation formula is: ; where the L2-normalized vector length =1.
[0120] Any two sentence nodes v i and v j Semantic similarity Sim(v i ,v j That is, the normalized vectors corresponding to these two sentence nodes. and The cosine similarity between them is further determined by the L2 normalized vectors described above. and The length of each is 1, that is =1, =1, therefore the semantic similarity Sim(v) i ,v j The formula for calculating ) can be simplified to: Sim(v i ,v j =Cosine( , =Cosine( , )= = .
[0121] In some embodiments, such as Figure 3 As shown, for the above sentence set P S The N sentences in the text, corresponding to N d-dimensional vectors, can be represented as an N x d vector matrix P = = Correspondingly, the N normalized vectors obtained after L2 normalization are... ~ It can be represented as a normalized vector matrix P norm That is, P norm = Based on this, matrix multiplication can be used to quickly calculate N vectors. ~ The cosine similarity between each pair of pairs yields the cosine similarity matrix. .
[0122] Based on the cosine similarity matrix M, for any two sentence nodes v i and v j The semantic similarity between them is the element M[i][j] in the i-th row and j-th column of the cosine similarity matrix M, i.e., Sim(v i ,v j )=M[i][j].
[0123] (3) Construct similarity edges In some embodiments, for any two sentence nodes v i and v j In its corresponding semantic similarity Sim(v i ,v j If the preset conditions are met, generate these two sentence nodes v. i and v j Similarity edges between them.
[0124] For example, the above preset condition can be semantic similarity Sim(v) i ,v j The similarity is greater than the preset similarity threshold.
[0125] For example, the above preset condition can be that, in sentence node v i Among the N-1 semantic similarities between Sim(v) and the other N-1 sentence nodes, Sim(v) i ,v j ) represents one of the K3 semantic similarities with the highest numerical value. That is, for any sentence node v, ) is one of the K3 semantic similarities with the highest numerical value. i You can select the K3 sentence nodes with the highest semantic similarity to generate similarity edges; where K3 is a positive integer, and its specific value can be configured according to the actual application requirements. This embodiment does not limit this.
[0126] like Figure 3 In the knowledge graph shown, there is a similarity edge between sentence nodes v2 and v3, indicating that sentence nodes v2 and v3 are semantically similar.
[0127] In some embodiments, two sentence nodes v i and v jThe weight w of the similarity edge sim (v i ,v j ) can be the semantic similarity between the corresponding two sentence nodes, that is: .
[0128] In the above embodiments, by constructing similarity edges, the semantic relationship between different sentence nodes can be accurately reflected without being affected by the position of the sentence nodes in the original document. The greater the weight of the similarity edge, the more similar the semantics of the two sentence nodes connected by the similarity edge are, even if the two sentence nodes are far apart in the original document or belong to different documents.
[0129] The above embodiments illustrate the construction conditions of different types of first association edges (similarity edges, position edges, and entity edges). For any two sentence nodes in a knowledge graph, there may be one or more first association edges of different types between them, or there may be no first association edges. Specifically, it can be determined whether to construct a first association edge between them based on the construction conditions of each type of first association edge, such as the similarity relationship, position relationship, and entity co-occurrence relationship between them.
[0130] In the above embodiments, steps S110 and S120 can process the original document set into a knowledge graph containing a base layer. In this base layer, sentences are used as nodes, and different sentence nodes are connected by different types of first association edges, such as similarity edges, position edges, and entity edges, to represent the similarity relationship, position relationship, entity co-occurrence relationship, etc. between different sentences, thereby obtaining a knowledge graph with sentences as the smallest granularity nodes. In the subsequent knowledge retrieval and question answering process based on this knowledge graph, more refined knowledge positioning can be achieved, the introduction of noise information can be reduced, and the accuracy and reliability of retrieval results and question answering results can be improved.
[0131] In some embodiments, in practical application scenarios, after the basic layer of the knowledge graph is constructed based on the original document set, if a new document is added to the current application scenario, the new document can be processed based on the above embodiments to obtain new sentence nodes. The first association edges between these new sentence nodes or between the new sentence nodes and existing sentence nodes in the knowledge graph can also be obtained. These new sentence nodes and the first association edges are added to the basic layer of the knowledge graph to realize incremental updates to the knowledge graph, improve the update efficiency of the knowledge graph, and ensure the timeliness of knowledge.
[0132] Figure 4 This is a flowchart illustrating another knowledge graph construction method provided in one embodiment of this specification. Figure 5 This is a schematic diagram illustrating the principle of another knowledge graph construction method provided in one embodiment of this specification.
[0133] In some embodiments, for the knowledge graph that includes a base layer, an experience layer can be further constructed. The following section will discuss this further. Figure 4 and Figure 5 To elaborate.
[0134] Reference Figure 4 and Figure 5 In some embodiments, the knowledge graph construction method described above may further include: Step S130: If the current answer to the current question is generated based on the knowledge graph, an experience node is generated according to the current answer, added to the knowledge graph, and a second association edge is constructed between the experience node and at least one sentence node.
[0135] In the above embodiments, after the initial construction of the knowledge graph based on the original document set is completed, the knowledge graph can be used to reason and answer various questions input by the user. Based on the questions and answers of each reasoning question and answer, experience nodes and related edges are added to the knowledge graph to form the experience layer of the knowledge graph. Subsequently, the historical experience of the experience layer can be used to assist in the reasoning and answering of new questions, thereby improving the quality of the answers. Furthermore, as the number of answers increases, the knowledge expression ability of the knowledge graph is continuously enhanced, and the accuracy of the answers generated by the relevant system or large model will also show a gradual upward trend.
[0136] In the above embodiments, based on the establishment of multi-relational connections between sentence nodes through three types of first association edges—similarity edges, position edges, and entity edges—experience nodes are also associated with sentence nodes through second association edges, forming a hierarchical knowledge graph with a "sentence-experience" two-layer structure. This enables cross-document and cross-paragraph information association as well as unified modeling of original knowledge and reasoning experience, achieving experience accumulation, improving the quality of the knowledge graph, and thus improving the answering quality of knowledge-based question answering based on the knowledge graph.
[0137] In some embodiments, the step S130 above, which generates an experience node based on the current answer, may specifically include: determining the quality score of the current answer; generating a standard experience node based on the current answer and the retrieval context if the quality score is greater than a preset quality score threshold; and generating a reflective experience node based on the current answer and the retrieval context if the quality score is not greater than the preset quality score threshold.
[0138] The aforementioned retrieval context includes information related to the current question retrieved based on the knowledge graph, such as one or more sentence nodes related to the current question.
[0139] The aforementioned standard experience nodes include a first set of experience entities and answer notes. The first set of experience entities includes entities obtained based on at least one of the current answer and the retrieval context.
[0140] The aforementioned reflective experience node includes a second set of experience entities, which comprises entities required to answer the current question, determined based on at least one of the current answer and the retrieval context. Additionally, the aforementioned reflective experience node may also contain answer notes generated through reflective reasoning.
[0141] For example, the standard experience nodes and reflective experience nodes mentioned above may also include the original problem corresponding to the node, i.e., the current problem mentioned above.
[0142] For example, the above-mentioned precautions for answering questions may include relevant constraints on the answer generation process, such as "answer only based on the provided context / search document, and prohibit the use of external knowledge or self-pre-trained knowledge" and "pay attention to the version of the technical document".
[0143] In the above embodiments, standard experience nodes or reflective experience nodes are generated based on the quality of the current answer. Specifically, when the current answer is of high quality, a standard experience node containing a first set of experience entities and answer notes is generated, essentially recording a "successful case." When encountering similar questions later, this standard experience node can be found by searching the knowledge graph, and the entities in its corresponding first set of experience entities can be used as the entities to be searched. Furthermore, during the process of reasoning and generating an answer based on the search results, the answer notes corresponding to this experience node can be used to improve the answer quality and enhance the stability of the relevant knowledge-based question-and-answer system.
[0144] If the quality of the current answer is low, the question and answer situation is analyzed and reflected upon to generate reflective experience nodes, which are equivalent to recording "failure cases" or "error notebooks". When encountering similar problems in the future, the reflective experience node can be found by searching the knowledge graph, and the entities in its corresponding second experience entity set can be used as the entities to be searched, thereby improving the accuracy of the search results, helping to bypass incorrect search or reasoning paths, and improving the quality of the answer.
[0145] In some embodiments, the construction of the second association edge between the experience node and at least one sentence node in step S130 may specifically include: determining the association tightness between the experience node and each sentence node based on the experience entity set corresponding to the experience node and the sentence entity set corresponding to each sentence node, and generating a second association edge between the experience node and the third sentence node whose association tightness is greater than a preset association tightness threshold.
[0146] For example, for an experience node u generated based on the current answer... new The relationship between a sentence node v and any sentence node v in the knowledge graph can be calculated based on the following formula. iThe degree of correlation R(u) new ,v i ): .
[0147] Among them, E i For sentence node v i The corresponding set of sentence entities, For the newly added experience node u new The corresponding set of experiential entities, For these two sets of entities (i.e., E) i and The number of entities contained in the intersection of ) Let be the number of entities contained in the union of these two entity sets.
[0148] Based on the above calculation formula, it can be seen that the empirical node u new and any sentence node v i The degree of correlation R(u) new ,v i ), which is the set of entities corresponding to these two nodes (i.e., E). i and The ratio between the number of entities in the intersection of these two entity sets and the number of entities in the union of these two entity sets is considered to be the ratio of the number of entities in the intersection of these two entity sets to the number of entities in the union of these two entity sets. The larger this ratio is, the greater the proportion of the same entities in the two entity sets. Therefore, the corresponding empirical node u can be considered to be... new and sentence node v i The closer the relationship between them, the higher the correlation strength R(u) new ,v i The higher the value, the better.
[0149] For example, for the experience node u generated based on the current answer new Based on the above correlation strength, the empirical node u is determined. new Whether a second association edge needs to be constructed between a sentence node and a given sentence node can specifically include: if the association density corresponding to the sentence node is greater than a preset association density threshold, constructing an association edge between the sentence node and the aforementioned experience node u. new The second associated edge between them.
[0150] For example, for the experience node u generated based on the current answer new Based on the above correlation strength, the empirical node u is determined. new Whether a second association edge needs to be constructed between a sentence node and a given sentence node can specifically include: sorting the association strength of each sentence node in descending order, selecting the sentence nodes corresponding to the top K4 highest association strengths, and constructing an association edge between them and the experience node u. newThe second associated edge between; where K4 is a positive integer, and its specific value can be configured according to actual application requirements. This embodiment does not limit this.
[0151] like Figure 5 As shown, the knowledge graph can include experience nodes u1, u2, etc.; among them, the experience node u1 and sentence node v2 have a high degree of correlation, so there is an experience-related edge between them, namely the second correlation edge mentioned above; the experience node u2 and sentence node v3 have a high degree of correlation, so there is an experience-related edge between them.
[0152] In some embodiments, the aforementioned correlation tightness can be used as the weight of the corresponding second correlation edge, i.e., for any sentence node v i If it is related to the experience node u new If there is a second associated edge between them, then the weight w of that second associated edge is... exp (u new ,v i )=R(u new ,v i ).
[0153] For example, each experience node and the second associated edge can be recorded and stored in the form of an experience node set and an experience edge set, respectively; based on this, constructing the second associated edge is to add an element representing the second associated edge to the experience edge set.
[0154] The knowledge graph constructed in the above embodiments includes not only a basic layer graph structure generated from the original document and constructed based on sentence nodes, but also an experience layer graph structure constructed based on historical experience. That is, after each question-and-answer reasoning based on the knowledge graph, a new experience node can be generated based on the result of this question-and-answer reasoning and added to the experience layer of the knowledge graph. This experience node is then associated with at least one sentence node in the basic layer, enabling dynamic self-evolution and incremental updates of the knowledge graph. This achieves a closed-loop evolution mechanism of "use-learning-enhancement" for the knowledge graph. As the number of times the knowledge graph is used increases, the knowledge coverage of the knowledge graph can be continuously enriched, thereby improving the question-and-answer reasoning ability based on the knowledge graph.
[0155] This specification also provides a knowledge question answering method in one or more embodiments, which can be implemented based on a knowledge graph constructed in any of the above embodiments. Figure 6 This is a flowchart illustrating the knowledge-based question-and-answer method.
[0156] Reference Figure 6 The knowledge question answering method provided in one or more embodiments of this specification may include the following steps: Step S210: Based on the current question to be answered, search the knowledge graph to obtain answering assistance information. The knowledge graph can be constructed based on the knowledge graph construction method described in any embodiment of this specification. Step S220: Generate the current answer to the current question based on the above answer assistance information.
[0157] Since the knowledge graph constructed based on the method described in the embodiments of this specification uses sentences as the smallest granularity node, the above-mentioned knowledge question answering method can perform retrieval in the knowledge graph according to the current question, which can achieve more refined information positioning, make the matching degree between the retrieved answer assistance information and the current question higher, and reduce noise information. As a result, the quality of the current answer generated based on the answer assistance information is also higher, reducing errors, illusions and other problems in the answer, improving the performance of the relevant knowledge question answering system, and enhancing the user experience.
[0158] Figure 7 This is a schematic diagram illustrating the principle of the knowledge question-and-answer method provided in one or more embodiments of this specification.
[0159] In some embodiments, refer to Figure 7 In step S210 above, based on the current question to be answered, a search is performed in the knowledge graph to obtain answer-aiding information, which may specifically include: Step S212: Decompose the current problem to obtain at least one subproblem; Step S214: For each sub-question, a search is performed in the knowledge graph to obtain the target seed set corresponding to the sub-question, and a sub-answer corresponding to the sub-question is generated based on the target seed set. The target seed set includes at least one sentence node related to the sub-question in the knowledge graph, and the above-mentioned answering assistance information includes at least one of the sub-question and the sub-answer.
[0160] Based on this, in step S220 above, the current answer corresponding to the current question is generated according to the answer assistance information. Specifically, this may include: integrating the sub-answers corresponding to each sub-question to obtain the current answer corresponding to the current question.
[0161] In practical applications, for complex problems, direct retrieval from the knowledge graph may not yield accurate information, affecting the quality of the final generated answer. Therefore, this embodiment of the specification decomposes the received current problem Q into M (M is a positive integer) sub-problems {q1, q2, ..., q...}. M Then, each sub-question is processed separately, sentence nodes related to the sub-question are retrieved from the knowledge graph, and corresponding sub-answers are generated based on the retrieval results. Finally, the current answer corresponding to the current question is obtained by integrating these sub-answers.
[0162] For example, the current problem is "Which club do most of Zhang San's teammates in the 2026 XX Cup football tournament play for?", which can be broken down into several sub-problems such as "Who are Zhang San's teammates in the 2026 XX Cup football tournament?", "Which club does [teammate 1] play for?", "Which club does [teammate 2] play for?", etc.
[0163] Then, based on the knowledge graph, relevant information is retrieved for each sub-question and corresponding sub-answers are generated, such as "Zhang San's teammates in the 2026 XX Cup football tournament are Li Si, Wang Wu, Zhao Liu, ...", "Li Si is in Club A", "Wang Wu is in Club B", etc.
[0164] Finally, combining the current question and its sub-questions, we integrate these sub-answers to obtain the current answer, such as "Most of Zhang San's teammates in the 2026 XX Cup football tournament are in Club A, a total of 5 people, including Li Si, Wang Wu... and there are 2 others in Club B, such as Zhao Liu...".
[0165] In the above embodiments, the current problem is broken down into multiple simple sub-problems. This allows for more targeted and accurate information retrieval in the knowledge graph based on each sub-problem. Furthermore, based on the retrieved information (i.e., the target seed set), accurate and high-quality sub-answers can be generated. Subsequently, these sub-answers can be fused to obtain the current answer corresponding to the current problem, thereby improving the quality of the final answer.
[0166] In some embodiments, step S212 above decomposes the current problem to obtain at least one sub-problem. Specifically, it may include: analyzing the current problem through a large language model to determine whether it is a multi-hop problem; if it is a multi-hop problem, decomposing it to obtain multiple sub-problems (i.e., m > 1 in this case); if it is not a multi-hop problem, the current problem can be treated as a sub-problem (i.e., m = 1 in this case) and the subsequent processing steps can continue to be executed.
[0167] In some embodiments, the current problem can be decomposed based on at least one of the following decomposition principles: decomposition based on information source, separation of definition and implementation, decomposition of parallel relationships, and priority of preconditions.
[0168] The principle of information source decomposition refers to breaking down a problem based on the data or knowledge sources required to obtain the answer. If a question requires the integration of data from multiple different channels and of different types to answer, it is broken down into multiple sub-questions according to the information source. Each sub-question can correspond to a database, API interface, document, or tool.
[0169] The principle of separation of definition and implementation means separating "what to do (What / goal)" from "how to do it (How / execution)". First, clarify the boundaries of the problem and the expected results, and then plan the specific execution path.
[0170] The principle of parallel decomposition refers to breaking down a problem containing multiple parallel dimensions into multiple non-interfering and equal sub-problems.
[0171] The principle of prioritizing prerequisites refers to identifying the "prerequisites" that need to be met to solve a problem based on logical dependencies, and treating these "prerequisites" as prerequisite sub-problems.
[0172] In the above embodiments, the multiple sub-problems obtained by decomposition may be parallel or dependent. In step S214, the processing order of each sub-problem can be controlled based on the relationship between these sub-problems. For example, for sub-problems with parallel relationships, they can be processed in parallel to improve processing efficiency. For sub-problems with dependent relationships, the sub-problem that is a "prerequisite" needs to be processed first, and then other problems that depend on the sub-problem need to be processed.
[0173] In some embodiments, refer to Figure 7 In step S210 above, based on the current question to be answered, a search is performed in the knowledge graph to obtain answer-supporting information, which may also include: Step S216: Determine an experience subset based on the first similarity between the current question and each experience node in the knowledge graph. The experience subset includes at least one associated experience node, and the first similarity corresponding to the associated experience node satisfies a first preset condition. The answering assistance information also includes the experience subset.
[0174] Suppose the experience layer of the knowledge graph consists of G experience nodes, and these G experience nodes can be recorded as a set V of experience nodes. e That is, any empirical node u g ∈V e (Where, g∈{1, 2, ..., G}). For the current problem Q, the semantic similarity between it and each experience node can be calculated, i.e., the first similarity. Experience nodes whose first similarity satisfies the first preset condition are taken as associated experience nodes related to the current problem Q and recorded in the experience subset. .
[0175] For example, the first similarity mentioned above can be calculated based on the cosine similarity of the vectors. That is, for any empirical node u g The first similarity between it and the current problem Q is Sim(Q,u). g The calculation formula for ) is as follows: ;in, This is the embedding vector corresponding to the current problem Q. For experience node u g The corresponding embedding vector, Representing vectors Length, Representing vectors The length.
[0176] For example, the above-mentioned selection of experience nodes whose first similarity satisfies the first preset condition as associated experience nodes can specifically be: selecting experience nodes whose first similarity is greater than the preset similarity threshold as associated experience nodes, or selecting the K5 experience nodes with the highest first similarity as associated experience nodes (where K5 is a positive integer, and its specific value can be configured according to actual application requirements, and this embodiment does not limit it).
[0177] In the above embodiments, since the associated experience nodes have a high semantic similarity to the current question, the associated experience nodes can serve as historical experience to assist in reasoning and answering the current question, thereby improving the quality of the final answer.
[0178] In some embodiments, any associated experience node (where f∈{1,2,...,F}, and F is an empirical subset) The number of associated experience nodes included (can include a set of experience entities) And notes on answering x f Among them, the set of experiential entities It can be used to enhance search queries and answer notes. f It can be incorporated into the prompts used to indicate answer generation, that is, injected as historical experience into the reasoning and answering process of the current question.
[0179] In some embodiments, the aforementioned empirical subset can also be determined based on the first similarity described above. The corresponding comprehensive experience weight w exp The higher the weight of the comprehensive experience, the stronger the subset of experience. The higher the overall relevance of the associated experience nodes to the current question, the higher the level of experience support for the current question. Thus, in the subsequent process of reasoning and answering the current question, it is possible to determine whether to use these associated experience nodes based on the magnitude of the overall experience weight, such as whether to inject answer notes into the prompt words.
[0180] For example, the above-mentioned comprehensive experience weight w exp The following calculation formula can be used: ;in, Represents the above subset of experience The number of entities contained in the experience entity set corresponding to the f-th associated experience node.
[0181] In some embodiments, refer to Figure 7 Based on the experience subset obtained in step S216 and its comprehensive experience weight w exp The step S214 above, which generates sub-answers for each sub-question, may specifically include: Step S2146, for any subproblem, in the empirical subset Comprehensive experience weight w exp If the weight exceeds the preset experience weight threshold, the target seed set corresponding to the sub-question is integrated with the answer notes corresponding to each associated experience node in the experience subset to obtain the context information corresponding to the sub-question, and the sub-answer corresponding to the sub-question is generated based on the context information.
[0182] In the above embodiments, the answer notes in the experience nodes related to the current question are incorporated into the context information of each sub-question. This allows the use of historical experience to help generate sub-answers corresponding to each sub-question, which helps to bypass erroneous reasoning paths, improve answer quality, and enhance reasoning stability.
[0183] In some embodiments, based on the subset of experiences obtained in step S216, entity augmentation can be performed on each sub-problem separately. Specifically, referring to... Figure 7 In step S214 above, for each sub-problem, a search is performed in the knowledge graph to obtain the target seed set corresponding to the sub-problem, which may include: Step S2142: For any subproblem, concatenate it with the set of experience entities corresponding to each associated experience node in the experience subset to generate an enhanced query statement corresponding to the subproblem. Step S2144: Based on the enhanced query statement, retrieve sentence nodes related to the sub-problem in the knowledge graph to obtain the target seed set corresponding to the sub-problem.
[0184] In the above embodiments, multiple experience entities corresponding to experience nodes related to the current problem are used as entities to be retrieved and added to the query statements corresponding to each sub-problem to form enhanced query statements. This allows for the use of historical experience to more accurately and comprehensively locate relevant sentence nodes in the knowledge graph, obtain a target seed set, and then more accurately infer and generate sub-answers corresponding to each sub-problem based on the target seed set. This helps to bypass erroneous reasoning paths and improve reasoning efficiency and answer quality.
[0185] For example, refer to Figure 7 The enhanced query statements generated in step S2142 above for each sub-problem can specifically include: For each subproblem, the referential resolution is performed to generate an initial query statement. This initial query statement is then concatenated with the set of experience entities corresponding to each associated experience node to obtain the enhanced query statement corresponding to the subproblem.
[0186] In practical applications, the sub-problems obtained from decomposition may contain pronouns such as "it" or "the configuration," or, as in the example above, "[teammate 1] in which club is he / she in?" If knowledge retrieval and sub-answer generation are performed directly based on the decomposed sub-problems, the unclear pronoun references may lead to deviations in retrieval and reasoning, or introduce more noise information, affecting the quality of sub-answers and the stability of reasoning.
[0187] In view of this, in the above embodiments, before performing knowledge retrieval on each sub-problem, the pronouns in the current sub-problem are replaced with the full names of specific entities based on the sub-answers corresponding to other sub-problems that have a dependency relationship with the current sub-problem, and / or based on the context of the current sub-problem within the current problem, to obtain an initial query statement that can be independently retrieved. Then, by concatenating it with the set of experience entities, an enhanced query statement can be obtained.
[0188] For example, in the previous example, in the subproblem "[Teammate 1] is in which club", "teammate 1" is a pronoun. Based on the sub-answer of another subproblem that is dependent on this subproblem, "Who are Zhang San's teammates in the 2026 XX Cup football tournament?", we can determine that "teammate 1" specifically refers to "Li Si". Therefore, the subproblem "[Teammate 1] is in which club" can be rewritten as "Li Si is in which club".
[0189] In the above embodiments, after the problem is decomposed, the sub-problems are resolved by substitution. This can reduce the complexity of the problem while ensuring the semantic integrity of each sub-problem. As a result, each sub-problem can be independently retrieved and sub-answer reasoning can be generated, reducing the accumulation of errors between different sub-problems and improving the quality of the answer.
[0190] In some embodiments, the process of retrieving the corresponding target seed set based on the enhanced query statement for each sub-problem in step S2144 above may specifically include: An initial seed set is determined based on the second similarity between the enhanced query statement and each sentence node in the knowledge graph. The initial seed set includes at least one associated sentence node, and the second similarity of the associated sentence node satisfies a second preset condition. If the information contained in the initial seed set is insufficient to answer the corresponding sub-question, an extended search is performed in the knowledge graph based on each associated sentence node in the initial seed set to obtain the target seed set; If the information contained in the initial seed set is sufficient to answer the corresponding sub-question, the initial seed set can be used as the target seed set.
[0191] For example, suppose the current problem Q is decomposed into M subproblems. For the current subproblem q to be processed... m (m∈{1,2,...,M}), its enhanced query statement can be calculated. With each sentence node v in the knowledge graph i The semantic similarity between Sim( ,v i The second similarity is used to filter out subproblems q based on the magnitude of this second similarity. m One or more semantically related sentence nodes v' form an initial seed set Z0, which realizes the subproblem q. m The initial search.
[0192] For example, the formula for calculating the second similarity mentioned above can be: ;in, To enhance query statements The corresponding embedding vector, For sentence node v i The corresponding embedding vector, Representing vectors Length, Representing vectors The length.
[0193] For example, the sentence nodes whose second similarity satisfies the second preset condition are recorded as associated sentence nodes v' and added to the initial seed set Z0. This may include recording sentence nodes whose second similarity is greater than the corresponding threshold as associated sentence nodes and adding them to the initial seed set; or, it may include taking the K6 sentence nodes with the highest second similarity as associated sentence nodes and adding them to the initial seed set (where K6 is a positive integer, and its specific value can be configured according to actual application requirements, which is not limited in this embodiment).
[0194] In the above embodiments, the sub-problem q to be processed is completed based on the enhanced query statement. m After the initial retrieval and obtaining the initial seed set Z0, it can be determined whether the information contained in the initial seed set Z0 is sufficient to answer the subquestion q. m If the answer is sufficient, then the initial seed set Z0 is directly used as the subproblem q. m The target seed set is used to generate the corresponding sub-answer through step S2146; conversely, if the initial seed set Z0 contains insufficient information, the sub-question q cannot be answered.m Then, one or more extended searches can be performed, that is, more related sentence nodes are found from the knowledge graph and added to the initial seed set Z0 to form a new seed set, until the information in the current seed set is sufficient to answer the subquestion q. m The current seed set is the subproblem q. m The corresponding target seed set Z tar .
[0195] For example, to determine whether the information contained in the initial seed set or the current seed set is sufficient to answer the corresponding sub-question, at least one of the following criteria can be used based on LLM: information completeness (e.g., whether the relevant entities, configuration items, and process steps are complete), strict dependence (e.g., prohibiting the use of external knowledge in the training data), and rejection of ambiguity (e.g., judging information as insufficient if only nouns are mentioned without specific actions).
[0196] In the above embodiments, for each sub-question, by performing an information sufficiency judgment on the seed set formed by multiple related sentence nodes obtained from the retrieval, that is, by performing an "whether it can be answered" judgment, the number of expansion searches can be dynamically controlled. When the information is insufficient, the expansion can continue, and when the information is sufficient, the expansion search can be stopped in time. This can reduce blind expansion, improve retrieval efficiency, and ensure the quality of the sub-answers corresponding to each sub-question.
[0197] In some embodiments, step S2144 above, where the information contained in the initial seed set is insufficient to answer the corresponding sub-question, involves obtaining the target seed set through extended retrieval, which may specifically include: If the information contained in the current jump seed set is sufficient to answer the corresponding subquestion, the current jump seed set is used as the target seed set, wherein the current jump seed set includes the initial seed set; If the information contained in the current jump seed set is insufficient to answer the corresponding sub-question, obtain the first-order neighbor nodes of each associated sentence node in the current jump seed set in the knowledge graph; Based on the weight of the first associated edge between the associated sentence node and the first-order neighbor node, and / or the entity matching degree between the first-order neighbor node and the corresponding sub-problem, multiple first-order neighbor nodes are filtered, and the filtered first-order neighbor nodes are added to the current hop seed set to obtain the next hop seed set. Use the next hop seed set as the new current hop seed set, and determine whether it is sufficient to answer the corresponding sub-question.
[0198] The following uses subproblem q m Taking this as an example, the extended search process will be illustrated.
[0199] First, after obtaining the subproblem q mAfter obtaining the corresponding initial seed set Z0, this initial seed set Z0 can be used as the current jump seed set Z. t=0 Determine whether the information it contains is sufficient to answer the subquestion q. m .
[0200] If the current jump seed set Z t=0 Insufficient to answer subquestion q m Then obtain the current jump seed set Z. t=0 The first-order neighbors of each related sentence node v' in the knowledge graph are identified, and these first-order neighbors are filtered and deduplicated. The selected first-order neighbors are then added as new related sentence nodes to the current jump seed set Z. t=0 Expand the hop count by 1 to obtain the next hop seed set Z. t=t+1=1 This enables one-hop proximity expansion.
[0201] The selection of these first-order neighbor nodes can specifically include: selecting based on the weight of the first association edge (such as similarity edge and entity edge) between these first-order neighbor nodes and the corresponding associated sentence node v', such as selecting first-order neighbor nodes whose first association edge weight is greater than a certain threshold as new associated sentence nodes, or selecting the K7 first-order neighbor nodes with the highest first association edge weight as new associated sentence nodes. Alternatively, selection can also be based on the relationship between the first-order neighbor nodes and the subproblem q. m The entities are filtered based on their matching degree, such as first-order neighbor nodes and subproblems q. m The more identical entities a pair contains, the higher the entity matching degree between them.
[0202] After obtaining the above next-hop seed set Z t=t+1=1 Then, set the next hop seed Z t=t+1=1 As the new current jump seed set, i.e., the current jump seed set is updated to Z1, we re-evaluate whether it is sufficient to answer the subproblem q. m If this is still insufficient to answer sub-question q m Then continue to retrieve the current jump seed set Z from the knowledge graph. t=1 All neighboring sentence nodes of each related sentence node v' are selected and added to the current jump seed set Z after filtering and deduplication based on edge weights (such as the weights of similarity edges, entity edges, position edges, etc.). t=1 The number of hops is increased by 1, i.e., t=2, thus updating the current hop seed set to Z. t=2 This process is repeated to achieve multi-hop expansion until the current hop seed set Z is reached. t The information contained is sufficient to answer the subquestion q. m Then the current jump seed set Z t That is, the subproblem q mThe corresponding target seed set Z tar .
[0203] For example, during the extended retrieval process, any sentence node v in the knowledge graph can be calculated. i To the current jump seed set Z t The comprehensive reachability score of a related sentence node v' And use this comprehensive reachability score as the sentence node v i The expansion priority can then be used to determine whether to extend the message to the sentence node v. i Expand, that is, whether to extend the sentence node v i As a new related sentence node.
[0204] The above-mentioned comprehensive accessibility score can be calculated using the following formula: ;in, Sentence nodes in a knowledge graph and The weights of edges between them (such as the weights of similarity edges, entity edges, position edges, etc.). Sentence node The set of sentence entities and subproblems q m The degree of matching between the included entities.
[0205] In the above embodiments, after completing the initial retrieval based on the enhanced query statement and obtaining the seed sentence set, the retrieval can be gradually expanded through one-hop proximity expansion and multi-hop breadth-first traversal until the information is sufficient or the maximum number of hops is reached. This realizes a multi-hop graph traversal and dynamic expansion mechanism, which flexibly performs one-hop or multi-hop expansion retrieval according to the needs of each sub-question, and obtains a target seed set sufficient to answer the corresponding sub-question, thereby balancing retrieval efficiency and retrieval result quality.
[0206] Furthermore, in the process of expanding and determining new related sentence nodes, the expanded sentence nodes are also screened based on the edge weights between sentence nodes and the entity matching degree between sentence nodes and sub-questions. This achieves a comprehensive determination of the expansion priority of each candidate sentence node based on two dimensions: graph structure reachability and question semantic relevance. This ensures that the expansion direction follows both the graph association path and question semantic matching, reduces blind expansion, and improves the quality of expansion retrieval. As a result, based on the final target seed set, higher-quality sub-answers can be inferred and generated, and then higher-quality current answers can be obtained based on the sub-answers.
[0207] In some embodiments, refer to Figure 7 In step S214 above, each sub-problem is processed to obtain the corresponding sub-answer. Specifically, the following process can be adopted: For any subproblem qm This involves resolving the subproblem q through denotation and entity enhancement. m Replace pronouns with the full names of specific entities and concatenate them with the empirical subset retrieved based on the current question Q. The experience entities of each associated experience node form an enhanced query statement. (i.e., step S2142); Based on the above enhanced query statement Initial and / or extended searches are performed within the knowledge graph, i.e., retrieval of sub-question q. m The relevant associated sentence node v' is used to obtain a seed set, and the information sufficiency of the seed set obtained in each retrieval is judged, that is, whether it is sufficient to answer the sub-question q. m (i.e., step S2144), until the number of extended hops reaches the corresponding threshold or sufficient to answer the subquestion q. m Target seed set Z tar ; After obtaining the above target seed set Z tar Then, based on the empirical subset The corresponding comprehensive empirical weights will be used to determine the target seed set Z. tar with subset of experience By concatenating the notes on the answers from each related experience node, we obtain the sub-problem q. m The corresponding context information is used to generate the subproblem q. m The corresponding sub-answer.
[0208] By processing each sub-question according to the above process, we can improve retrieval efficiency and obtain high-quality sub-answers.
[0209] Additionally, refer to Figure 7 After obtaining the subproblem q m After identifying the corresponding sub-answers, you can also manage and maintain the context and sub-answers of each sub-question retrieved, such as determining whether the sub-question q is dependent. m Another subproblem q m ', and based on subproblem q m The corresponding sub-answer corresponds to another sub-problem q m By eliminating related pronouns in the text, we can achieve reasonable control over the processing order of multiple sub-problems, and ensure the processing effect of each sub-problem and the quality of the corresponding sub-answers.
[0210] In some embodiments, the step S220 above, which generates the current answer to the current question based on the answer assistance information, may specifically include the following steps.
[0211] Step S222: Based on the current question, integrate the multiple sub-answers to obtain the first answer.
[0212] Step S222 above is equivalent to the logical integration of the sub-answers corresponding to each sub-question. Specifically, the original current question Q, the sub-questions obtained based on Q decomposition, and their corresponding sub-answers can be input into the large language model. The large language model then logically concatenates the multiple sub-answers according to the intent of the current question Q to obtain the first answer that can answer the current question Q.
[0213] Step S224: Generate the second answer based on the current problem, each subproblem, and the target seed set corresponding to each subproblem.
[0214] Step S224 above is equivalent to reading comprehension based on the question and all retrieved context. Specifically, the current question Q, the sub-questions obtained by decomposing Q, and the target seed set corresponding to each sub-question can be input into the large language model, allowing the large language model to directly read and understand this information and infer to generate a second answer that can answer the current question Q.
[0215] Step S226: Integrate the first answer and the second answer to obtain the current answer.
[0216] In step S226 above, the two answers to the current question Q obtained through steps S222 and S224, namely the first answer and the second answer, are further integrated to combine the advantages of the two answers and obtain a third answer as the final answer, which is the current answer to the current question.
[0217] In other words, after processing each sub-problem and obtaining the corresponding sub-answers, the first answer is obtained by logically integrating these sub-answers, and the second answer is obtained by reading comprehension reasoning on the context of these sub-problems and the target seed set. The two answers are then integrated to retain the unique information of each answer and remove contradictory or inconsistent parts, resulting in a final answer with a clearer structure and more complete logic.
[0218] In the above embodiments, for the current question Q, two versions of the answer are generated: one based on the logical integration of sub-questions and the other based on direct reading comprehension of the full text. The quality of the two answers may differ for different questions. By integrating these two answers to generate the final answer, the advantages of the two answers can be combined to improve the robustness and information completeness of the final answer, thereby improving the accuracy and stability of the knowledge question answering.
[0219] In some embodiments, the knowledge graph-based question answering method described above can be implemented in the form of an agent, which can be deployed on different computing devices in different application scenarios to achieve intelligent knowledge question answering in the corresponding application scenario or corresponding field.
[0220] It is understood that the above embodiments are merely examples, and modifications can be made to the above embodiments in actual implementation. Those skilled in the art will understand that any modifications to the above embodiments that do not require creative effort fall within the protection scope of one or more embodiments of this specification, and will not be described again in the embodiments.
[0221] Based on the same inventive concept, one or more embodiments of this specification also provide a knowledge graph construction apparatus. Figure 8 A structural block diagram of the device for constructing this knowledge graph.
[0222] like Figure 8 As shown, the knowledge graph construction device 300 may include: The document sentence segmentation module 301 is configured to segment each original document in the original document collection into sentences, resulting in multiple sentences. The knowledge graph construction module 302 is configured to treat each sentence as a sentence node, and construct a first association edge for the first sentence node and the second sentence node among the multiple sentence nodes to obtain a knowledge graph. The first association edge includes at least one of similarity edge, position edge and entity edge. The similarity edge represents the semantic similarity between the first sentence corresponding to the first sentence node and the second sentence corresponding to the second sentence node. The position edge represents that the first sentence and the second sentence belong to the same original document. The entity edge represents that the first sentence and the second sentence contain at least one common entity.
[0223] In one possible implementation, the knowledge graph construction device 300 may further include: an experience update module 303, configured to generate an experience node based on the current answer corresponding to the current question and add it to the knowledge graph when the current answer is generated based on the knowledge graph; and to construct a second association edge between the experience node and at least one sentence node.
[0224] In one possible implementation, to construct entity edges, the graph construction module 302 is specifically configured to perform the following operations: Entity extraction is performed on the first sentence and the second sentence to obtain the first sentence entity set corresponding to the first sentence node and the second sentence entity set corresponding to the second sentence node; If the intersection of the first sentence entity set and the second sentence entity set is not an empty set, generate entity edges between the first sentence node and the second sentence node; The weights of the entity edges are determined based on the importance scores of each entity in the intersection, wherein the importance scores characterize the importance of the corresponding entity in the multiple sentences, and the importance scores are related to the number of times the corresponding entity appears in the multiple sentences.
[0225] In one possible implementation, to construct location edges, the graph construction module 302 is specifically configured to perform the following operations: If both the first sentence and the second sentence belong to the first original document, generate a positional edge between the first sentence node and the second sentence node; The weight of the position edge is determined based on the distance between the first sentence and the second sentence in the first original document.
[0226] In one possible implementation, to construct similarity edges, the graph construction module 302 is specifically configured to perform the following operations: If the semantic similarity between the first sentence and the second sentence meets the preset conditions, a similarity edge is generated between the first sentence node and the second sentence node. The weights of the similarity edges are determined based on the semantic similarity between the first sentence and the second sentence.
[0227] In one possible implementation, to generate experience nodes, the aforementioned experience update module 303 is specifically configured to perform the following operations: Determine the quality score of the current answer; If the quality score is greater than a preset quality score threshold, a standard experience node is generated based on the current answer and the retrieval context. The retrieval context includes information related to the current question retrieved based on the knowledge graph. The standard experience node includes a first set of experience entities and answer notes. The first set of experience entities includes entities obtained based on at least one of the current answer and the retrieval context. If the quality score is not greater than a preset quality score threshold, a reflective experience node is generated based on the current answer and the retrieval context. The reflective experience node includes a second set of experience entities, which includes entities that need to be retrieved to answer the current question, determined based on at least one of the current answer and the retrieval context.
[0228] In one possible implementation, to construct a second association edge between an experience node and at least one sentence node, the aforementioned experience update module 303 is specifically configured to perform the following operations: The degree of association between the experience node and each sentence node is determined based on the set of experience entities corresponding to the experience node and the set of sentence entities corresponding to each sentence node. For a third sentence node whose association density is greater than a preset association density threshold, a second association edge is generated between the experience node and the third sentence node.
[0229] Since the principle of the problem solved by the knowledge graph construction device 300 is similar to that of the aforementioned knowledge graph construction method, the implementation and principle of each module in the knowledge graph construction device 300 can be found in the relevant embodiments of the aforementioned knowledge graph construction method, and the repeated parts will not be described again.
[0230] Based on the same inventive concept, one or more embodiments of this specification also provide a knowledge question-answering device. Figure 9 This is a structural block diagram of the knowledge-answering device.
[0231] like Figure 9 As shown, the knowledge question-and-answer device 400 may include: The knowledge retrieval module 401 is configured to retrieve answering assistance information from a knowledge graph based on the current question to be answered, wherein the knowledge graph is constructed based on the method of any one of claims 1 to 7; The answer generation module 402 is configured to generate the current answer corresponding to the current question based on the answer assistance information.
[0232] In one possible implementation, to obtain answer-aiding information, the knowledge retrieval module 401 is specifically configured to perform the following operations: The current problem is decomposed into at least one sub-problem; For the sub-question, a search is performed in the knowledge graph to obtain the target seed set corresponding to the sub-question, and a sub-answer corresponding to the sub-question is generated based on the target seed set; wherein, the target seed set includes at least one sentence node in the knowledge graph related to the sub-question, and the answer assistance information includes at least one of the sub-question and the sub-answer.
[0233] In one possible implementation, the answer generation module 402 is specifically configured to perform the following operations: Based on the current question, the multiple sub-answers are integrated to obtain the first answer; A second answer is generated based on the current problem, the sub-problems, and the target seed set; The first answer and the second answer are combined to obtain the current answer.
[0234] In one possible implementation, to obtain answer-aiding information, the knowledge retrieval module 401 is further configured to perform the following operations: An experience subset is determined based on the first similarity between the current question and each experience node in the knowledge graph. The experience subset includes at least one associated experience node, and the first similarity corresponding to the associated experience node satisfies a first preset condition. The answer-answering assistance information also includes the experience subset.
[0235] In one possible implementation, based on the aforementioned subset of experience, to obtain the target seed set corresponding to each sub-problem, the knowledge retrieval module 401 is specifically configured to perform the following operations: For the sub-problem, the sub-problem is concatenated with the set of experience entities corresponding to each associated experience node in the experience subset to generate an enhanced query statement corresponding to the sub-problem; Based on the enhanced query statement, a search is performed in the knowledge graph to obtain the target seed set.
[0236] In one possible implementation, to obtain the target seed set based on the enhanced query statement, the knowledge retrieval module 401 is specifically configured to perform the following operations: An initial seed set is determined based on the second similarity between the enhanced query statement and each sentence node in the knowledge graph, wherein the initial seed set includes at least one associated sentence node, and the second similarity corresponding to the associated sentence node satisfies a second preset condition; If the information contained in the initial seed set is insufficient to answer the corresponding sub-question, an extended search is performed in the knowledge graph based on each associated sentence node in the initial seed set to obtain the target seed set.
[0237] In one possible implementation, to achieve extended retrieval, the knowledge retrieval module 401 is specifically configured to perform the following operations: If the information contained in the current jump seed set is sufficient to answer the corresponding sub-question, the current jump seed set is used as the target seed set, wherein the current jump seed set includes the initial seed set; If the information contained in the current jump seed set is insufficient to answer the corresponding sub-question, obtain the first-order neighbor nodes of each associated sentence node in the current jump seed set in the knowledge graph; Based on the weight of the first associated edge between the associated sentence node and the first-order neighbor node, and / or the entity matching degree between the first-order neighbor node and the corresponding sub-problem, multiple first-order neighbor nodes are filtered, and the filtered first-order neighbor nodes are added to the current hop seed set to obtain the next hop seed set. Use the next hop seed set as the new current hop seed set to determine whether it is sufficient to answer the corresponding sub-question.
[0238] In one possible implementation, to generate enhanced query statements corresponding to each sub-problem, the knowledge retrieval module 401 is specifically configured to perform the following operations: The sub-problems are resolved by substitution to generate an initial query statement; The initial query statement is concatenated with the set of experience entities corresponding to each of the associated experience nodes to obtain the enhanced query statement corresponding to the sub-problem.
[0239] In one possible implementation, to generate corresponding sub-answers based on the target seed set, the knowledge retrieval module 401 is specifically configured to perform the following operations: For the sub-question, if the comprehensive experience weight corresponding to the experience subset is greater than the preset experience weight threshold, the target seed set and the answer notes corresponding to the associated experience node are integrated to obtain the context information corresponding to the sub-question, wherein the comprehensive experience weight represents the degree of relevance between the experience subset and the current question; The sub-answers corresponding to the sub-questions are generated based on the context information.
[0240] Since the principle of the problem solved by the knowledge question-answering device 400 is similar to that of the aforementioned knowledge question-answering method, the implementation and principle of each module in the knowledge question-answering device 400 can be found in the relevant embodiments of the aforementioned knowledge question-answering method, and the repeated parts will not be described again.
[0241] See Figure 10 , Figure 10 This is a structural block diagram of an electronic device provided for one or more embodiments of this specification. Figure 10 As shown, the electronic device 500 may include a processor 501 and a memory 502; the memory 502 may be coupled to the processor 501. It is worth noting that... Figure 10 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0242] In one possible implementation, the functions of the knowledge graph construction device 300 and / or the knowledge question answering device 400 can be integrated into the processor 501, enabling the processor 501 to execute the aforementioned knowledge graph construction method and / or knowledge question answering method.
[0243] In another possible implementation, the knowledge graph construction device 300 and / or the knowledge question answering device 400 can be configured separately from the processor 501. For example, the knowledge graph construction device 300 and / or the knowledge question answering device 400 can be configured as a chip connected to the processor 501, and the knowledge graph construction and / or knowledge question answering based on the knowledge graph can be realized through the control of the processor 501.
[0244] Furthermore, in some alternative implementations, the electronic device 500 may also include: a communication module, an input unit, an audio processor, a display, a power supply, etc. It is worth noting that the electronic device 500 is not necessarily required to include these components. Figure 10 All components shown; in addition, the electronic device 500 may also include Figure 10 For components not shown, please refer to existing technologies.
[0245] In some alternative implementations, the processor 501, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device 500.
[0246] The memory 502 may be, for example, one or more of a cache, flash memory, hard drive, removable medium, volatile memory, non-volatile memory, or other suitable devices. It may store information related to the knowledge graph construction device 300 and / or the knowledge question-answering device 400, and may also store programs for executing the information. The processor 501 may execute the program stored in the memory 502 to perform information storage or processing, etc.
[0247] An input unit can provide input to the processor 501. This input unit may be, for example, a button or touch input device. A power supply can be used to provide power to the electronic device 500. A display can be used to display images and text, etc. This display may be, for example, an LCD display, but is not limited to this.
[0248] Memory 502 can be a solid-state memory, such as read-only memory (ROM), random access memory (RAM), SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROM, etc. Memory 502 can also be some other type of device. Memory 502 includes buffer memory (sometimes referred to as a buffer). Memory 502 may include an application / function storage unit for storing application programs and function programs or processes for executing the operation of electronic device 500 via processor 501.
[0249] The memory 502 may also include a data storage unit for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit of the memory 502 may include various drivers for the computer device for communication functions and / or for performing other functions of the computer device (such as messaging applications, address book applications, etc.).
[0250] The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor 501 to provide input signals and receive output signals, which is the same as in a conventional mobile communication terminal.
[0251] Based on different communication technologies, multiple communication modules can be configured in the same computer device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) is also coupled to a speaker and microphone via an audio processor to provide audio output through the speaker and receive audio input from the microphone, thereby enabling typical telecommunications functions. The audio processor may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor is coupled to processor 501, enabling on-device recording via the microphone and on-device playback of stored sound via the speaker.
[0252] This specification also provides a computer program product in one or more embodiments, the computer program product comprising: a computer program or instructions that, when run on a computer, cause the computer to perform the method of any one of the method embodiments.
[0253] This specification also provides a computer storage medium in one or more embodiments that stores a computer program or instructions that, when executed on a computer, cause the computer to perform the method of any one of the method embodiments.
[0254] While one or more embodiments of this specification provide the operational steps of the methods described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual device or client product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0255] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, apparatus (system), or computer program product. Therefore, one or more embodiments of this specification can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0256] This specification describes one or more embodiments of a method, apparatus (system), and computer program product according to one or more embodiments of this specification with reference to flowchart illustrations and / or block diagrams. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0257] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0258] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0259] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and system embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0260] In this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Those skilled in the art will understand the specific meaning of the above terms in one or more embodiments of this specification, depending on the specific circumstances.
[0261] It should be noted that, unless otherwise specified, one or more embodiments and features thereof in this specification can be combined with each other. This specification is not limited to any single aspect, nor to any single embodiment, nor to any combination and / or substitution of such aspects and / or embodiments. Furthermore, each aspect and / or embodiment of one or more embodiments of this specification can be used alone or in combination with one or more other aspects and / or embodiments thereof.
[0262] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of one or more embodiments of this specification, and are not intended to limit them. Although one or more embodiments of this specification have 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 one or more embodiments of this specification, and they should all be covered within the scope of the claims and the specification of one or more embodiments of this specification.
[0263] The foregoing description of one or more embodiments of this specification has been provided in conjunction with optional implementation methods. However, these embodiments are merely exemplary and serve only an illustrative purpose. Based on this, various substitutions and modifications can be made to one or more embodiments of this specification, all of which fall within the protection scope of one or more embodiments of this specification.
Claims
1. A method for constructing a knowledge graph, characterized in that, include: Segment each original document in the original document collection to obtain multiple sentences; Each of the sentences is taken as a sentence node, and a first association edge is constructed for the first sentence node and the second sentence node among the multiple sentence nodes to obtain a knowledge graph. The first association edge includes at least one of similarity edge, position edge and entity edge. The similarity edge represents the semantic similarity between the first sentence corresponding to the first sentence node and the second sentence corresponding to the second sentence node. The position edge represents that the first sentence and the second sentence belong to the same original document. The entity edge represents that the first sentence and the second sentence contain at least one common entity.
2. The method according to claim 1, characterized in that, Also includes: If the current answer to the current question is generated based on the knowledge graph, an experience node is generated based on the current answer and added to the knowledge graph. Construct a second association edge between the experience node and at least one sentence node.
3. The method according to claim 1, characterized in that, For the first sentence node and the second sentence node among multiple sentence nodes, construct the first association edge, including: Entity extraction is performed on the first sentence and the second sentence to obtain the first sentence entity set corresponding to the first sentence node and the second sentence entity set corresponding to the second sentence node; If the intersection of the first sentence entity set and the second sentence entity set is not an empty set, generate entity edges between the first sentence node and the second sentence node; The weights of the entity edges are determined based on the importance scores of each entity in the intersection, wherein the importance scores characterize the importance of the corresponding entity in the multiple sentences, and the importance scores are related to the number of times the corresponding entity appears in the multiple sentences.
4. The method according to claim 1, characterized in that, For the first sentence node and the second sentence node among multiple sentence nodes, construct the first association edge, including: If both the first sentence and the second sentence belong to the first original document, generate a positional edge between the first sentence node and the second sentence node; The weight of the position edge is determined based on the distance between the first sentence and the second sentence in the first original document.
5. The method according to claim 1, characterized in that, For the first sentence node and the second sentence node among multiple sentence nodes, construct the first association edge, including: If the semantic similarity between the first sentence and the second sentence meets the preset conditions, a similarity edge is generated between the first sentence node and the second sentence node. The weights of the similarity edges are determined based on the semantic similarity between the first sentence and the second sentence.
6. The method according to claim 2, characterized in that, Based on the current answer, experience nodes are generated, including: Determine the quality score of the current answer; If the quality score is greater than a preset quality score threshold, a standard experience node is generated based on the current answer and the retrieval context. The retrieval context includes information related to the current question retrieved based on the knowledge graph. The standard experience node includes a first set of experience entities and answer notes. The first set of experience entities includes entities obtained based on at least one of the current answer and the retrieval context. If the quality score is not greater than a preset quality score threshold, a reflective experience node is generated based on the current answer and the retrieval context. The reflective experience node includes a second set of experience entities, which includes entities that need to be retrieved to answer the current question, determined based on at least one of the current answer and the retrieval context.
7. The method according to claim 2, characterized in that, Constructing a second association edge between the experience node and at least one sentence node includes: The degree of association between the experience node and each sentence node is determined based on the set of experience entities corresponding to the experience node and the set of sentence entities corresponding to each sentence node. For a third sentence node whose association density is greater than a preset association density threshold, a second association edge is generated between the experience node and the third sentence node.
8. A knowledge-based question-and-answer method, characterized in that, include: Based on the current question to be answered, a search is performed in the knowledge graph to obtain answer-supporting information, wherein the knowledge graph is constructed based on the method of any one of claims 1 to 7; Based on the answer assistance information, generate the current answer to the current question.
9. The method according to claim 8, characterized in that, Based on the current question to be answered, a search is performed in the knowledge graph to obtain answer-supporting information, including: The current problem is decomposed into at least one sub-problem; For the sub-question, a search is performed in the knowledge graph to obtain the target seed set corresponding to the sub-question, and a sub-answer corresponding to the sub-question is generated based on the target seed set; wherein, the target seed set includes at least one sentence node in the knowledge graph related to the sub-question, and the answer assistance information includes at least one of the sub-question and the sub-answer.
10. The method according to claim 9, characterized in that, Based on the answer assistance information, generate the current answer to the current question, including: Based on the current question, the multiple sub-answers are integrated to obtain the first answer; A second answer is generated based on the current problem, the sub-problems, and the target seed set; The first answer and the second answer are combined to obtain the current answer.
11. The method according to claim 9, characterized in that, Based on the current question to be answered, a search is performed in the knowledge graph to obtain answer-supporting information, including: An experience subset is determined based on the first similarity between the current question and each experience node in the knowledge graph. The experience subset includes at least one associated experience node, and the first similarity corresponding to the associated experience node satisfies a first preset condition. The answer-answering assistance information also includes the experience subset.
12. The method according to claim 11, characterized in that, For the sub-problem, a search is performed in the knowledge graph to obtain the target seed set corresponding to the sub-problem, including: For the sub-problem, the sub-problem is concatenated with the set of experience entities corresponding to each associated experience node in the experience subset to generate an enhanced query statement corresponding to the sub-problem; Based on the enhanced query statement, a search is performed in the knowledge graph to obtain the target seed set.
13. The method according to claim 12, characterized in that, Based on the enhanced query statement, a search is performed in the knowledge graph to obtain the target seed set, including: An initial seed set is determined based on the second similarity between the enhanced query statement and each sentence node in the knowledge graph, wherein the initial seed set includes at least one associated sentence node, and the second similarity corresponding to the associated sentence node satisfies a second preset condition; If the information contained in the initial seed set is insufficient to answer the corresponding sub-question, an extended search is performed in the knowledge graph based on each associated sentence node in the initial seed set to obtain the target seed set.
14. The method according to claim 13, characterized in that, Based on the associated sentence nodes in the initial seed set, an extended retrieval is performed in the knowledge graph to obtain the target seed set, including: If the information contained in the current jump seed set is sufficient to answer the corresponding sub-question, the current jump seed set is used as the target seed set, wherein the current jump seed set includes the initial seed set; If the information contained in the current jump seed set is insufficient to answer the corresponding sub-question, obtain the first-order neighbor nodes of each associated sentence node in the current jump seed set in the knowledge graph; Based on the weight of the first associated edge between the associated sentence node and the first-order neighbor node, and / or the entity matching degree between the first-order neighbor node and the corresponding sub-problem, multiple first-order neighbor nodes are filtered, and the filtered first-order neighbor nodes are added to the current hop seed set to obtain the next hop seed set. Use the next hop seed set as the new current hop seed set to determine whether it is sufficient to answer the corresponding sub-question.
15. The method according to claim 12, characterized in that, For the sub-problem, the sub-problem is concatenated with the set of experience entities corresponding to each associated experience node in the experience subset to generate an enhanced query statement corresponding to the sub-problem, including: The sub-problems are resolved by substitution to generate an initial query statement; The initial query statement is concatenated with the set of experience entities corresponding to each of the associated experience nodes to obtain the enhanced query statement corresponding to the sub-problem.
16. The method according to claim 11, characterized in that, Based on the target seed set, generate sub-answers corresponding to the sub-questions, including: For the sub-question, if the comprehensive experience weight corresponding to the experience subset is greater than the preset experience weight threshold, the target seed set and the answer notes corresponding to the associated experience node are integrated to obtain the context information corresponding to the sub-question, wherein the comprehensive experience weight represents the degree of relevance between the experience subset and the current question; The sub-answers corresponding to the sub-questions are generated based on the context information.
17. A knowledge graph construction device, characterized in that, include: The document sentence segmentation module is configured to segment each original document in the original document collection into sentences; The knowledge graph construction module is configured to treat each sentence as a sentence node, and to construct a first association edge for the first sentence node and the second sentence node among the multiple sentence nodes to obtain a knowledge graph. The first association edge includes at least one of similarity edge, position edge and entity edge. The similarity edge represents the semantic similarity between the first sentence corresponding to the first sentence node and the second sentence corresponding to the second sentence node. The position edge represents that the first sentence and the second sentence belong to the same original document. The entity edge represents that the first sentence and the second sentence contain at least one common entity.
18. A knowledge-based question-and-answer device, characterized in that, include: The knowledge retrieval module is configured to retrieve answer-aiding information from a knowledge graph based on the current question to be answered, wherein the knowledge graph is constructed based on the method of any one of claims 1 to 7; The answer generation module is configured to generate the current answer to the current question based on the answer assistance information.
19. An electronic device, characterized in that, The electronic device includes: Memory, used to store computer program products; A processor is configured to execute a computer program product stored in the memory, wherein, when the computer program product is executed, it implements the method described in any one of claims 1 to 16.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed, implement the method described in any one of claims 1 to 16.