Knowledge question-answering method and device for long thinking chain, electronic equipment and storage medium
By constructing a long-chain knowledge base and utilizing keyword-vector similarity hybrid matching, combined with ACT-R theory to dynamically call knowledge blocks, the problems of insufficient semantic understanding and low knowledge matching accuracy in professional fields of open-domain question answering systems have been solved, achieving high accuracy and intelligent question answering results.
Patent Information
- Application Number
- CN202511112275.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-14
Smart Images

Figure CN120952017A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent dialogue technology, and in particular to a knowledge question-and-answer method, device, electronic device, and storage medium for long thought chains. Background Technology
[0002] With the continuous advancement of artificial intelligence and natural language processing technologies, open-domain question answering systems have been widely applied in various fields such as information retrieval, intelligent customer service, and educational assistance. However, in practical applications, especially in complex question-answering tasks involving specialized domain knowledge, traditional open-domain question answering systems still have many limitations, mainly reflected in insufficient deep contextual understanding capabilities and low answer content matching accuracy.
[0003] Currently, most mainstream question-answering systems are based on the Retrieval-Augmented Generation (RAG) framework. A typical process involves: first, using a large-scale pre-trained language model to semantically parse the user's question; then, retrieving relevant information from massive pre-processed data sources; and finally, outputting the answer through a generative model. While these systems have a certain generalization ability in general domains, they often struggle to accurately capture the deep semantics of complex questions in specialized domains, leading to a decline in answer quality.
[0004] Specifically, existing RAG systems generally employ a unified vector space model for semantic retrieval, relying on vector similarity for matching. However, when processing domain-specific knowledge, the presence of a large amount of noise or redundant information in the corpus makes a single vector matching mechanism prone to insufficient relevance of search results, thus affecting the overall search performance.
[0005] To improve system performance in specific domains, some existing solutions attempt to build knowledge bases geared towards teaching or professional fields, aiming to enhance the accuracy and efficiency of knowledge acquisition. However, most of these knowledge bases only implement static storage and structured query functions, limiting their adaptability and intelligence in complex question-answering tasks.
[0006] Therefore, how to solve the problems of insufficient semantic understanding depth and low knowledge matching accuracy of existing open-domain question answering systems in professional applications is an important issue that urgently needs to be addressed in the field of intelligent dialogue. Summary of the Invention
[0007] This invention provides a knowledge question-answering method, device, electronic device, and storage medium for long thought chains, which overcomes the shortcomings of existing open-domain question-answering systems in professional field applications, such as insufficient semantic understanding depth and low knowledge matching accuracy, and achieves a significant improvement in the accuracy and intelligence of the system in complex contexts.
[0008] In a first aspect, the present invention provides a knowledge question answering method for long thought chains, comprising: receiving user input; determining the target knowledge block corresponding to the user input based on a pre-constructed long thought chain knowledge base by using a keyword-vector similarity hybrid matching method; wherein, the long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections; and determining the target response to the user input based on the target knowledge block.
[0009] Furthermore, constructing the long thought chain knowledge base includes: acquiring target domain knowledge text, and segmenting and structuring the target domain knowledge text to obtain a long thought chain containing multiple knowledge blocks; extracting keywords from each knowledge block to obtain a retrieval block corresponding to each knowledge block; retaining the detailed description content in each knowledge block to obtain a content block corresponding to each knowledge block; and constructing the long thought chain knowledge base based on the long thought chain containing multiple knowledge blocks, as well as the retrieval block and content block corresponding to each knowledge block.
[0010] Furthermore, the step of determining the target knowledge block corresponding to the user input based on the pre-constructed long thought chain knowledge base and using a keyword-vector similarity hybrid matching method includes: extracting key information from the user input; matching retrieval blocks from the long thought chain knowledge base according to the key information to obtain multiple candidate retrieval blocks with different keyword matching scores; and determining the target knowledge block corresponding to the user input based on the multiple candidate retrieval blocks.
[0011] Further, determining the target knowledge block corresponding to the user input based on the plurality of candidate retrieval blocks includes: calculating the semantic similarity between the plurality of candidate retrieval blocks and the user input to obtain a semantic similarity matching score between each candidate retrieval block and the user input; determining the target retrieval block from the plurality of candidate retrieval blocks based on the keyword matching score and semantic similarity matching score corresponding to the plurality of candidate retrieval blocks respectively; and determining the target knowledge block based on the target retrieval block.
[0012] Further, determining the target retrieval block from the plurality of candidate retrieval blocks based on the keyword matching score and semantic similarity matching score corresponding to each of the plurality of candidate retrieval blocks includes: determining the weight values corresponding to the keyword matching score and semantic similarity matching score of each candidate retrieval block; calculating the target matching score of each candidate retrieval block based on the keyword matching score and semantic similarity matching score of each candidate retrieval block, and the weight values corresponding to the keyword matching score and semantic similarity matching score respectively; and determining the target retrieval block based on the target matching scores corresponding to the plurality of candidate retrieval blocks respectively.
[0013] Furthermore, the number of target knowledge blocks is at least two; correspondingly, determining the target response input by the user based on the target knowledge blocks includes: linking the target knowledge blocks together according to their inherent logical connections to form a target long thought chain; the target long thought chain represents a multi-step reasoning process from question to answer; and determining the target response based on the target long thought chain.
[0014] Secondly, the present invention also provides a knowledge question answering device for long thought chains, comprising: a user input receiving module for receiving user input; a target knowledge block determination module for determining the target knowledge block corresponding to the user input based on a pre-built long thought chain knowledge base by using a keyword-vector similarity hybrid matching method; wherein the long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections; and a target response determination module for determining the target response to the user input based on the target knowledge block.
[0015] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the knowledge question-answering method for long thought chains as described above.
[0016] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the knowledge question-answering method for long thought chains as described above.
[0017] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the knowledge question-answering method for long thought chains as described above.
[0018] This invention provides a knowledge-based question-answering method for long thought chains. It receives user input and, based on a pre-built long thought chain knowledge base, determines the target knowledge block corresponding to the user input through a keyword-vector similarity hybrid matching method. The long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections. Then, based on the target knowledge block, it determines the target response to the user input. This method matches target knowledge blocks from the pre-built long thought chain knowledge base using a keyword-vector similarity hybrid matching method to integrate and determine the target response to the user input. This not only effectively improves the problem of insufficient understanding of deep contexts but also effectively avoids the retrieval of irrelevant information, ensuring the accuracy and relevance of the answer content, and significantly improving the accuracy and intelligence of question-answering in complex contexts. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the knowledge question-answering method for long thought chains provided in an embodiment of the present invention.
[0021] Figure 2 This is a schematic diagram of the structure of the knowledge question-answering device for long thought chains provided in an embodiment of the present invention.
[0022] Figure 3 This is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0024] It's worth noting that most mainstream question-answering systems are based on retrieval-enhanced generative frameworks. Their typical process includes: first, using a large-scale pre-trained language model to semantically parse the user's question; then, retrieving relevant information from massive open data sources; and finally, outputting the answer through a generative model. While these systems have a certain generalization ability in general domains, they often struggle to accurately capture the deep semantics of complex questions in specialized domains, leading to a decline in answer quality.
[0025] To improve system performance in specific domains, some existing solutions attempt to build knowledge bases geared towards teaching or professional fields, aiming to enhance the accuracy and efficiency of knowledge acquisition. However, most of these knowledge bases only implement static storage and structured query functions, lacking the ability to further transform knowledge into a combination of procedural and declarative knowledge. At the same time, existing systems have not established effective mechanisms for dynamic knowledge organization and retrieval, making it difficult to flexibly invoke relevant knowledge modules based on the question context, thus limiting their adaptability and intelligence in complex question-answering tasks.
[0026] In view of this, the present invention proposes a knowledge question-answering method for long thought chains, specifically, Figure 1The diagram illustrates a flowchart of a knowledge question-answering method for long thought chains provided in an embodiment of the present invention.
[0027] like Figure 1 As shown, the method includes: S110, receiving user input; S120, determining the target knowledge block corresponding to the user input based on a pre-built long thought chain knowledge base by using a keyword-vector similarity hybrid matching method; wherein, the long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections; S130, determining the target response of the user input based on the target knowledge block.
[0028] It should be noted that the knowledge question-answering method for long thought chains provided in this embodiment can be executed by any electronic device. The electronic device here can be not only smart home devices such as smart speakers and smart TVs, but also personal devices such as smartphones, tablets / computers, smartwatches, and smart bracelets, etc., without specific limitations.
[0029] For ease of understanding, the following will take the electronic device as the execution subject and provide a detailed description of steps S110-S130 and related steps.
[0030] S110 receives user input.
[0031] It is easy to understand that electronic devices can receive user input in real time via voice, text, or images. That is to say, the received user input can be voice input, text input, or image input, without being specifically limited here.
[0032] The professional knowledge field involved in the user input can be psychological counseling, education, or medical fields, and no specific limitation is made here.
[0033] Based on receiving user input in step S110, step S120 is further executed.
[0034] S120, based on a pre-built long thought chain knowledge base, the target knowledge block corresponding to the user input is determined by keyword-vector similarity hybrid matching; wherein, the long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections.
[0035] It is easy to understand that this embodiment pre-constructs a long thought chain knowledge base, which includes multiple knowledge blocks in the target domain, and these multiple knowledge blocks have inherent logical connections and / or contextual relationships. Specifically, multiple knowledge blocks can be extracted from target domain knowledge texts, and then these multiple knowledge blocks can be linked together according to their inherent logical order to form the long thought chain knowledge base.
[0036] The target areas include, but are not limited to, any one or more combinations of the fields of psychological counseling, education, medicine, and law.
[0037] In actual knowledge-based question answering, after receiving user input, key information is extracted from the user input. Based on the key information, it is matched in the long thought chain knowledge base to obtain multiple candidate knowledge blocks. Then, a secondary matching is performed by calculating the semantic similarity between the user input and multiple candidate knowledge blocks to obtain one or more knowledge blocks that are most relevant or relatively relevant to the user input, i.e., the target knowledge block.
[0038] In step S120, based on the pre-built long thought chain knowledge base, and after determining the target knowledge block corresponding to the user input through keyword-vector similarity hybrid matching, step S130 is further executed.
[0039] S130, determine the target response input by the user based on the target knowledge block.
[0040] The process is straightforward: based on the content of a defined target knowledge block, the target response input by the user is obtained. Specifically, when there is only one target knowledge block, the target response input by the user can be obtained directly from the content of this single target knowledge block; when there are two or more target knowledge blocks, the content of multiple target knowledge blocks is linked together according to their inherent logical connections and contextual relationships, thereby obtaining the target response input by the user.
[0041] The target response includes the reasoning process from the question to the answer, as well as the final answer.
[0042] In this embodiment, by receiving user input and using a pre-built long thought chain knowledge base, the target knowledge block corresponding to the user input is determined through a keyword-vector similarity hybrid matching method. The long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections. Then, based on the target knowledge block, the target response for the user input is determined. This method matches target knowledge blocks from the pre-built long thought chain knowledge base using a keyword-vector similarity hybrid matching method to integrate and determine the target response for the user input. This not only effectively improves the problem of insufficient deep context understanding but also effectively avoids the retrieval of irrelevant information, ensuring the accuracy and relevance of the answer content, and achieving a significant improvement in question-and-answer accuracy and intelligence in complex contexts.
[0043] Based on the above embodiments, the following will further describe in detail the construction process of the long thought chain knowledge base.
[0044] The construction of a long-thinking chain knowledge base includes: acquiring knowledge texts in the target domain, segmenting and structuring the target domain knowledge texts to obtain a long-thinking chain containing multiple knowledge blocks; extracting keywords from each knowledge block to obtain the retrieval block corresponding to each knowledge block; retaining the detailed descriptions in each knowledge block to obtain the content block corresponding to each knowledge block; and constructing the long-thinking chain knowledge base based on the long-thinking chain containing multiple knowledge blocks, as well as the retrieval block and content block corresponding to each knowledge block.
[0045] The target fields in this embodiment include, but are not limited to, natural sciences (e.g., physics, chemistry, biology, astronomy), engineering and technology (computer science and information technology, electrical engineering, mechanical engineering, civil engineering), medicine and health (e.g., clinical medicine, public health, nutrition), social sciences (e.g., economics, psychology, sociology, political science), humanities and arts (e.g., history, literature, philosophy, art), law and ethics (jurisprudence, ethics), and education and training.
[0046] The target domain knowledge texts include at least textbooks in the target domain, which can be obtained from online websites, libraries, and other channels.
[0047] For knowledge texts in a single target domain, natural language processing and advanced machine learning techniques are used to achieve full-process scanning and digital processing of the target domain knowledge texts. This automatically identifies page structure, chapter distribution, and text boundaries, thereby enabling segmented and structured processing of the target domain knowledge texts. This results in a long thought chain / reasoning chain containing multiple knowledge blocks. This long thought chain fully captures the inherent logic and contextual connections across topics and chapters in the target domain knowledge texts, similar to the process of integrating fragmented knowledge when humans think.
[0048] For knowledge texts in multiple target domains, the aforementioned method can yield multiple long thought chains containing multiple knowledge blocks, with each long thought chain corresponding to a target domain.
[0049] Each long thought chain contains both detailed content descriptions and keywords representing the core content of that knowledge block. In this embodiment, by extracting keywords representing the core content of each knowledge block in a long thought chain, a retrieval block corresponding to each knowledge block can be obtained; by retaining detailed content descriptions of each knowledge block in a long thought chain, a content block corresponding to each knowledge block can be obtained.
[0050] For each long thought chain, a long thought chain knowledge base can be constructed based on the long thought chain, its multiple knowledge blocks, and the retrieval block and content block corresponding to each knowledge block. Multiple long thought chain knowledge bases can be constructed further.
[0051] It should be noted that the long thought chain knowledge base described in this embodiment can be a single long thought chain knowledge base corresponding to a single target domain, or it can be a large and high-quality comprehensive knowledge base formed by the convergence of multiple long thought chain knowledge bases corresponding to multiple target domains. No specific limitation is made here.
[0052] In this embodiment, by acquiring target domain knowledge text and segmenting and structuring it, a long thought chain containing multiple knowledge blocks is obtained. Keywords are then extracted from each knowledge block to obtain a corresponding retrieval block, and detailed descriptions within each knowledge block are retained to obtain a corresponding content block. Based on the long thought chain containing multiple knowledge blocks, and the retrieval and content blocks corresponding to each knowledge block, a long thought chain knowledge base is constructed. Finally, the target knowledge block is matched against the pre-constructed long thought chain knowledge base to determine the user's target response. This method uses a keyword-vector similarity hybrid matching approach to match target knowledge blocks from the pre-constructed long thought chain knowledge base to integrate and determine the user's target response. This not only effectively improves the problem of insufficient deep context understanding but also effectively avoids the retrieval of irrelevant information, ensuring the accuracy and relevance of the answer content, and significantly improving the accuracy and intelligence of question answering in complex contexts.
[0053] Based on the above embodiments, the following will further describe in detail the process of matching target knowledge blocks from the long mind chain knowledge base.
[0054] Based on a pre-built long-thinking chain knowledge base, the target knowledge block corresponding to the user input is determined by a keyword-vector similarity hybrid matching method, including: extracting key information from the user input; matching retrieval blocks from the long-thinking chain knowledge base according to the key information to obtain multiple candidate retrieval blocks with different keyword matching scores; and determining the target knowledge block corresponding to the user input based on the multiple candidate retrieval blocks.
[0055] The straightforward approach is to use a large language model to extract key information from the user input after receiving it. Then, this key information is used to match search blocks in a long-chain knowledge base, quickly locating a set of potentially relevant search blocks, i.e., multiple candidate search blocks. This step eliminates obviously irrelevant content, narrowing down the candidate range for subsequent matching.
[0056] It should be noted that the degree of matching between each candidate search block and the key information varies, therefore each candidate search block corresponds to a different keyword matching score. The higher the keyword matching score, the more relevant the corresponding candidate search block is to the user input.
[0057] Then, the semantic similarity between multiple candidate search blocks and the user input is calculated to obtain a semantic similarity matching score for each candidate search block. Specifically, a pre-trained semantic embedding model can be used to convert the question-and-answer input and each candidate search block into vectors, and then the semantic similarity between each candidate search block vector and the question-and-answer input vector is calculated to obtain a semantic similarity matching score for each candidate search block. This step can, to some extent, compensate for the limitations of keyword matching and capture the deep semantics of the text.
[0058] It should be noted that the user input in this embodiment can be various modal data such as text, image, and voice. When the user input is model data other than text, it is necessary to first convert the user input into a text modality and then calculate the semantic similarity.
[0059] Furthermore, the weight values corresponding to the keyword matching score and semantic similarity matching score of each candidate retrieval block are determined. Specifically, based on different question-answering scenarios, the characteristics of the target domain knowledge text, and historical weight data, the first weight corresponding to the keyword matching score of each candidate retrieval block and the second weight corresponding to the semantic similarity matching score of each candidate retrieval block are dynamically adjusted, without specific limitations here.
[0060] For example, when there is a strong semantic implicit relationship between user input and knowledge blocks rather than explicit keyword coverage, the first weight of keyword matching score can be appropriately reduced, and the second weight of semantic similarity matching score can be increased; conversely, the first weight of keyword matching score can be increased, and the second weight of semantic similarity matching score can be reduced.
[0061] In one specific embodiment, the first weight of the keyword matching score of the candidate retrieval block is set to 0.6, and the second weight of the semantic similarity matching score of the candidate retrieval block is set to 0.4, indicating that in the current target domain, keyword matching is more important than semantic similarity matching.
[0062] Next, based on the keyword matching score and semantic similarity matching score of each candidate retrieval block, and the corresponding weight values for each score, the target matching score for each candidate retrieval block is calculated. Specifically, the keyword matching score and semantic similarity matching score are first normalized to ensure they are on the same order of magnitude. Then, the keyword matching score and semantic similarity matching score are weighted and summed to determine the target matching score for each candidate retrieval block.
[0063] Finally, based on the target matching scores corresponding to the multiple candidate search blocks, the target search block is determined, and based on the target search block, the target knowledge block is determined. Specifically, the candidate search block with the highest target matching score can be determined as the target search block. In this case, the knowledge block corresponding to the target search block is a unique target knowledge block. Alternatively, multiple candidate search blocks with target matching scores reaching a certain value or ranked first in target matching scores can be determined as the target search block. In this case, the knowledge blocks corresponding to each of the multiple target search blocks are all target knowledge blocks.
[0064] After identifying the target knowledge block, the target response for the user's input is determined based on the target knowledge block and then fed back to the user. Specifically, when there is only one target knowledge block, the target response for the user's input can be obtained directly from the content of this single target knowledge block; when there are two or more target knowledge blocks, the content of multiple target knowledge blocks is linked together according to their inherent logical connections and contextual relationships to form a long target thought chain, and then the target response for the user's input is obtained by integrating the long target thought chain.
[0065] In this embodiment, key information is extracted from the user input. Based on this key information, retrieval blocks are matched from a long-chain knowledge base to obtain multiple candidate retrieval blocks with different keyword matching scores. The semantic similarity between the multiple candidate retrieval blocks and the user input is calculated to obtain a semantic similarity matching score for each candidate retrieval block. Then, based on the keyword matching scores and semantic similarity matching scores corresponding to the multiple candidate retrieval blocks, a target retrieval block is determined from the multiple candidate retrieval blocks. Based on the target retrieval block, a target knowledge block is determined, and based on the target knowledge block, the target answer input by the user is determined. This method matches target knowledge blocks from a pre-constructed long-chain knowledge base using a keyword-vector similarity hybrid matching approach to integrate and determine the target answer input by the user. This not only effectively improves the problem of insufficient deep context understanding but also effectively avoids the retrieval of irrelevant information, ensuring the accuracy and relevance of the answer content, and achieving a significant improvement in the accuracy and intelligence of question answering in complex contexts.
[0066] In some other embodiments, the beneficial technical effects of the knowledge question-answering method for long thought chains provided by the embodiments of the present invention are described in detail.
[0067] Specifically, by implementing the knowledge question-answering method for long thought chains provided in the embodiments of the present invention, the following five beneficial technical effects can be achieved.
[0068] Firstly, it significantly improves the accuracy of question answering. This invention preprocesses the content of the target professional field into structured knowledge blocks and combines them with keyword-vector similarity hybrid matching, thereby improving the accuracy of knowledge question answering by about 20% compared with traditional knowledge question answering, effectively addressing the problem of insufficient understanding of deep context.
[0069] Secondly, it reduces interference from redundant information. This invention utilizes a rigorous retrieval block design and a combination of keyword matching and vector similarity matching to greatly reduce the retrieval of irrelevant information, ensuring that the answer content is more accurate and relevant.
[0070] Thirdly, it improves the application effect of small models. By structuring and dynamically calling professional domain knowledge, this invention enables even models with small parameter sizes to generate high-quality answers using intelligent knowledge, providing a new path for open-domain knowledge question answering tasks in professional domains.
[0071] Fourthly, it enhances the system's flexibility and adaptability. This invention establishes a dynamic knowledge organization framework based on ACT-R theory, which can dynamically adjust knowledge retrieval strategies according to actual consultation scenarios, adapting to multi-domain and multi-scenario question-answering tasks.
[0072] Fifthly, the system has good scalability. The modular design and distributed architecture facilitate subsequent functional expansion. For example, knowledge graphs can be introduced to further hierarchically cluster knowledge blocks, thereby enabling community-level knowledge summarization and retrieval.
[0073] ACT-R (Adaptive Control of Thought–Rational) is a cognitive framework that primarily describes the cognitive mechanisms of humans in information retrieval, memory activation, and multi-step reasoning. In this invention, the applicability of ACT-R theory is reflected in the following three aspects.
[0074] First, modeling the cognitive activation mechanism. Each knowledge block has an "activation value," or target matching score, when it is invoked. This activation value comprehensively considers keyword matching score, vector similarity score, and historical usage frequency. Similar to the activation formula in ACT-R, the system dynamically sorts candidate knowledge blocks based on their activation values, selecting the knowledge block most suitable for the current question-and-answer context.
[0075] Secondly, the simulation of working memory and long-term memory. Knowledge blocks in professional textbooks can be regarded as "long-term memory" storage, while question-and-answer input calls up some content in "working memory" through the retrieval module. ACT-R theory helps simulate this dynamic retrieval and integration process, enabling the system to "associate" multiple knowledge nodes related to the current problem during multi-step reasoning.
[0076] Thirdly, adaptive learning and optimization. Utilizing the descriptions of learning and adaptation in ACT-R theory, the weights between keyword matching scores and semantic similarity matching scores can be continuously adjusted during system operation. This makes the prediction of knowledge block activation levels more closely resemble actual question-and-answer scenarios, thereby improving the accuracy of thought chain construction.
[0077] Corresponding to the knowledge question-answering methods for long thought chains described in the above embodiments, the present invention also provides a knowledge question-answering device for long thought chains.
[0078] Specifically, Figure 2 A schematic diagram of the structure of the knowledge question-answering device for long thought chains provided in an embodiment of the present invention is shown.
[0079] like Figure 2 As shown, the device includes: a user input receiving module 210 for receiving user input; a target knowledge block determination module 220 for determining the target knowledge block corresponding to the user input based on a pre-built long thought chain knowledge base and through keyword-vector similarity hybrid matching; wherein the long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections; and a target response determination module 230 for determining the target response to the user input based on the target knowledge block.
[0080] In this embodiment, user input is received by the user input receiving module 210, and the target knowledge block determination module 220 determines the target knowledge block corresponding to the user input based on a pre-built long thought chain knowledge base using a keyword-vector similarity hybrid matching method. The long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections. Then, the target response determination module 230 determines the target response based on the target knowledge block. This device matches target knowledge blocks from the pre-built long thought chain knowledge base using a keyword-vector similarity hybrid matching method to integrate and determine the target response to the user input. This not only effectively improves the problem of insufficient deep context understanding but also effectively avoids the retrieval of irrelevant information, ensuring the accuracy and relevance of the answer content, and significantly improving the accuracy and intelligence of question-and-answer in complex contexts.
[0081] It should be noted that the knowledge question answering device for long thought chains provided in the embodiments of the present invention can be referred to in correspondence with the knowledge question answering methods for long thought chains described in the above embodiments, and will not be repeated here.
[0082] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3As shown, the electronic device may include a processor 310, a communications interface 320, a memory 330, and a communication bus 340, wherein the processor 310, communications interface 320, and memory 330 communicate with each other via the communication bus 340. The processor 310 can invoke logical instructions in the memory 330 to execute a knowledge-based question-answering method oriented towards long thought chains. This method includes: receiving user input; determining the target knowledge block corresponding to the user input based on a pre-built long thought chain knowledge base using a keyword-vector similarity hybrid matching method; wherein the long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections; and determining the target response to the user input based on the target knowledge block.
[0083] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0084] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the knowledge question-answering method for long thought chains provided by the above methods. The method includes: receiving user input; determining the target knowledge block corresponding to the user input based on a pre-built long thought chain knowledge base by using a keyword-vector similarity hybrid matching method; wherein the long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections; and determining the target response to the user input based on the target knowledge block.
[0085] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a knowledge question-answering method for long thought chains provided by the above methods. The method includes: receiving user input; determining the target knowledge block corresponding to the user input based on a pre-constructed long thought chain knowledge base by using a keyword-vector similarity hybrid matching method; wherein the long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections; and determining the target response to the user input based on the target knowledge block.
[0086] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0087] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A knowledge question-answering method oriented towards long thought chains, characterized in that, include: Receive user input; Based on a pre-built long thought chain knowledge base, the target knowledge block corresponding to the user input is determined by keyword-vector similarity hybrid matching; wherein, the long thought chain knowledge base includes multiple knowledge blocks with inherent logical connections; Based on the target knowledge block, determine the target response input by the user.
2. The knowledge question-answering method for long thought chains according to claim 1, characterized in that, Constructing the long thought chain knowledge base includes: Obtain target domain knowledge text, and perform segmentation and structuring processing on the target domain knowledge text to obtain a long thought chain containing multiple knowledge blocks; Extract keywords from each knowledge block to obtain the retrieval block corresponding to each knowledge block; By retaining the detailed description in each knowledge block, the content block corresponding to each knowledge block is obtained; The long thought chain knowledge base is constructed based on the long thought chain containing multiple knowledge blocks, as well as the retrieval block and content block corresponding to each knowledge block.
3. The knowledge question-answering method for long thought chains according to claim 2, characterized in that, The pre-built long thought chain knowledge base determines the target knowledge block corresponding to the user input through a keyword-vector similarity hybrid matching method, including: Extract key information from the user input; Based on the key information, a search block is matched from the long thought chain knowledge base to obtain multiple candidate search blocks with different keyword matching scores; Based on the multiple candidate retrieval blocks, the target knowledge block corresponding to the user input is determined.
4. The knowledge question-answering method for long thought chains according to claim 3, characterized in that, The step of determining the target knowledge block corresponding to the user input based on the plurality of candidate retrieval blocks includes: Calculate the semantic similarity between the multiple candidate retrieval blocks and the user input to obtain a semantic similarity matching score between each candidate retrieval block and the user input; The target retrieval block is determined from the multiple candidate retrieval blocks based on the keyword matching score and semantic similarity matching score corresponding to each of the multiple candidate retrieval blocks. The target knowledge block is determined based on the target retrieval block.
5. The knowledge question-answering method for long thought chains according to claim 4, characterized in that, The step of determining the target retrieval block from the plurality of candidate retrieval blocks based on the keyword matching score and semantic similarity matching score corresponding to the plurality of candidate retrieval blocks includes: Determine the weight values corresponding to the keyword matching score and semantic similarity matching score of each candidate retrieval block; The target matching score for each candidate retrieval block is calculated based on the keyword matching score and semantic similarity matching score of each candidate retrieval block, as well as the weight values corresponding to the keyword matching score and the semantic similarity matching score. The target retrieval block is determined based on the target matching scores corresponding to multiple candidate retrieval blocks.
6. The knowledge question-answering method for long thought chains according to any one of claims 1-5, characterized in that, The number of target knowledge blocks is at least two; Accordingly, determining the target response input by the user based on the target knowledge block includes: The target knowledge blocks are linked together according to their inherent logical connections to form a long target thinking chain; the long target thinking chain represents a multi-step reasoning process from question to answer; Based on the target's long thought chain, determine the target response.
7. A knowledge question-and-answer device for long thought chains, characterized in that, include: The user input receiving module is used to receive user input. The target knowledge block determination module is used to determine the target knowledge block corresponding to the user input based on a pre-built long thought chain knowledge base and through keyword-vector similarity hybrid matching; wherein, the long thought chain knowledge base includes multiple knowledge blocks that have an inherent logical relationship; The target response determination module is used to determine the target response input by the user based on the target knowledge block.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the knowledge question-answering method for long thought chains as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the knowledge question-answering method for long thought chains as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the knowledge question-answering method for long thought chains as described in any one of claims 1 to 6.
Citation Information
Cited By
Device operation and maintenance intelligent question answering method and system based on knowledge graph context fusion
CN122019733A