Question and answer method, system and device, medium and program product

By adaptively selecting a retrieval method based on knowledge granularity, this approach solves the semantic fragmentation problem caused by knowledge base construction in existing RAG technologies, thereby improving the accuracy and reliability of answer generation. It is suitable for professional fields and complex query scenarios.

CN121144489APending Publication Date: 2025-12-16CHINA UNIONPAY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511250230.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

Existing Retrieval Augmentation (RAG) technologies employ fixed-length or rule-driven text segmentation methods when building knowledge bases, resulting in a disconnect between semantic association and logical structure, which affects the accuracy and reliability of answers generated by Large Language Models (LLM).

Method used

By adaptively selecting the knowledge base with the best knowledge granularity for retrieval, and dynamically matching the retrieval granularity according to the question intent, a multi-granularity knowledge base is constructed, including proposition-level, sentence-level, and paragraph-level knowledge bases, thereby enhancing the contextual integrity of knowledge retrieval and the focus on key information.

Benefits of technology

It improves the accuracy and reliability of answer generation, especially in professional fields and complex query scenarios, significantly improving the accuracy and contextual completeness of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144489A_ABST
    Figure CN121144489A_ABST
Patent Text Reader

Abstract

The invention provides a question and answer method, system and device, a medium and a program product. Relates to the technical field of computer processing. The method is applied to a question and answer system, the question and answer system is pre-configured with a plurality of knowledge bases, and each knowledge base has different knowledge granularities; the method comprises the steps of obtaining a to-be-processed question input by a user, and determining a question intention corresponding to the to-be-processed question and a retrieval granularity corresponding to the question intention; according to the retrieval granularity, a target knowledge base matched with the retrieval granularity is determined from the multiple knowledge bases, and different retrieval granularities correspond to the knowledge bases of different knowledge granularities; performing retrieval according to the target knowledge base to obtain prompt knowledge related to the to-be-processed question; and according to the prompt knowledge, generating an answer corresponding to the to-be-processed question. According to the method provided by the invention, the retrieval quality is improved, so that the accuracy and reliability of answer generation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer processing technology, and in particular to a question-and-answer method, system, device, medium, and program product. Background Technology

[0002] In recent years, Large Language Model (LLM) technology has developed rapidly and has been widely applied in many industries, demonstrating outstanding capabilities in various natural language processing tasks. However, it still has limitations such as "illusions," weak interpretability, insufficient professional knowledge, and poor knowledge timeliness.

[0003] To address these issues, Retrieval-Augmented Generation (RAG) technology has emerged. This technology effectively improves the accuracy, richness, and timeliness of text by retrieving relevant information from external knowledge bases in real time and combining it with the LLM generation process, quickly becoming a focal solution in the industry.

[0004] However, existing RAGs mostly use fixed-length or rule-driven text segmentation to build knowledge bases for retrieval, which easily severs the semantic connections and logical structure of the text, resulting in insufficient reasoning ability and thus affecting the accuracy and reliability of LLM-generated answers. Summary of the Invention

[0005] This application provides a question-answering method, system, device, medium, and program product to solve the technical problem of poor knowledge expansion effect in the prior art, thereby improving the retrieval quality and thus improving the accuracy and reliability of answer generation.

[0006] Firstly, this application provides a question-answering method applied to a question-answering system, wherein the question-answering system is pre-configured with multiple knowledge bases, each of which has a different level of knowledge granularity;

[0007] The method includes:

[0008] Obtain the user-inputted question to be processed, determine the question intent corresponding to the question to be processed, and the retrieval granularity corresponding to the question intent;

[0009] Based on the retrieval granularity, a target knowledge base matching the retrieval granularity is determined from the plurality of knowledge bases, wherein different retrieval granularities correspond to knowledge bases with different knowledge granularities;

[0010] Based on the target knowledge base, retrieve relevant hints and knowledge related to the problem to be addressed.

[0011] Based on the provided information, generate an answer to the question to be addressed.

[0012] In one optional implementation, determining the problem intent corresponding to the problem to be processed, and the retrieval granularity corresponding to the problem intent, includes:

[0013] Obtain the preset intent recognition model;

[0014] The question to be processed is input into the intent recognition model to obtain the question intent corresponding to the question to be processed;

[0015] Based on the question intent and the preset first mapping relationship, the retrieval granularity corresponding to the question intent is determined; wherein, the first mapping relationship is the mapping relationship between the question intent and the retrieval granularity.

[0016] In one optional implementation, the intent type of the question intent includes fact query intent, multi-hop question-and-answer intent, cause analysis intent, summary intent, and comparison analysis intent; wherein, the comparison analysis intent corresponds to paragraph-level retrieval granularity; the cause analysis intent and the summary intent correspond to statement-level retrieval granularity; the fact query intent and the multi-hop question-and-answer intent both correspond to proposition-level retrieval granularity; wherein, the paragraph-level retrieval granularity is higher than the statement-level retrieval granularity, and the statement-level retrieval granularity is higher than the proposition-level retrieval granularity.

[0017] In one optional implementation, the knowledge base includes a paragraph-level knowledge base, a statement-level knowledge base, and a proposition-level knowledge base; wherein the granularity of the paragraph-level knowledge base is higher than that of the statement-level knowledge base; and the granularity of the statement-level knowledge base is higher than that of the proposition-level knowledge base.

[0018] Based on the retrieval granularity, a target knowledge base matching the retrieval granularity is determined from the plurality of knowledge bases, including:

[0019] If the retrieval granularity is paragraph-level retrieval granularity, then the paragraph-level knowledge base is determined as the target knowledge base corresponding to the problem to be processed;

[0020] If the retrieval granularity is a statement-level retrieval granularity, then the statement-level knowledge base is determined as the target knowledge base corresponding to the problem to be processed;

[0021] If the retrieval granularity is a proposition-level retrieval granularity, then the proposition-level knowledge base is determined as the target knowledge base corresponding to the problem to be processed.

[0022] In one optional implementation, the target knowledge base is a proposition-level knowledge base; the proposition-level knowledge base includes multiple propositions;

[0023] Based on the target knowledge base, a search is performed to obtain suggestive knowledge related to the problem to be addressed, including:

[0024] Based on the problem to be processed, each of the propositions in the target knowledge base is retrieved to obtain the first hint knowledge;

[0025] Determine the problem keywords corresponding to the problem to be processed, and obtain the set of propositional keywords corresponding to the target knowledge base;

[0026] Based on the set of question keywords, a search is performed on the set of proposition keywords to obtain the second hint knowledge;

[0027] Based on the first and second hints, hints related to the problem to be addressed are obtained.

[0028] In one optional implementation, based on the problem to be processed, each of the propositions in the target knowledge base is retrieved to obtain first hint knowledge, including:

[0029] Calculate the semantic similarity between the problem to be processed and each of the propositions;

[0030] The target knowledge base is filtered based on the semantic similarity to construct a lightweight knowledge sub-base;

[0031] Based on the problem to be processed, the propositions in the knowledge sub-base are retrieved to generate the first hint knowledge.

[0032] In one optional implementation, calculating the semantic similarity between the problem to be processed and each of the propositions includes:

[0033] For each proposition, obtain the problem entity of the problem to be processed, and obtain the proposition entity corresponding to the proposition;

[0034] Calculate the semantic similarity between the problem entity and the proposition entity to obtain the semantic similarity between the problem to be processed and the proposition.

[0035] In one optional implementation, there are connection paths between propositions in the knowledge sub-base, and the connection paths are the association relationships between the propositions.

[0036] Based on the problem to be processed, the propositions in the knowledge sub-base are retrieved to generate the first hint knowledge, including:

[0037] The proposition with the highest semantic similarity to the problem to be processed is determined from the knowledge sub-base and used as the starting proposition.

[0038] Based on the connection path, a path traversal is performed starting from the initial proposition until the termination proposition is located;

[0039] The first hint knowledge is generated by combining the starting proposition, the ending proposition, and the intermediate propositions encountered during the traversal.

[0040] In one optional implementation, obtaining the set of propositional keywords corresponding to the target knowledge base includes:

[0041] Extract the proposition keywords for each proposition in the target knowledge base;

[0042] Based on the extracted propositional keywords, a set of propositional keywords is generated; wherein, the set of propositional keywords is used to construct a second mapping relationship with each proposition; the second mapping relationship is in the form of a bipartite graph.

[0043] In one optional implementation, the set of propositional keywords is retrieved based on the question keywords to obtain second hint knowledge, including:

[0044] The question keywords are matched with the set of proposition keywords to obtain proposition keywords that are consistent with the question keywords;

[0045] Based on the second mapping relationship, determine the propositions corresponding to the matched propositional keywords;

[0046] The propositions are combined to generate the second hint knowledge.

[0047] In one optional implementation, generating an answer to the question to be processed based on the provided knowledge includes:

[0048] Obtain the pre-defined large language model;

[0049] The problem to be processed and the hint knowledge are input into the large language model to obtain the answer corresponding to the problem to be processed.

[0050] In one alternative implementation, before determining the target knowledge base matching the retrieval granularity from the plurality of knowledge bases, the method further includes:

[0051] Construct a proposition-level knowledge base; the construction process includes:

[0052] Retrieve multiple original documents;

[0053] For each original document, it is split into multiple text blocks; each text block contains at least one statement.

[0054] Proposition extraction is performed on each text block to obtain multiple propositions;

[0055] Determine whether there is a relationship between any two propositions; if so, construct the original corresponding proposition-level knowledge sub-base based on the two propositions and their corresponding relationship.

[0056] The proposition-level knowledge base is generated based on the proposition-level knowledge sub-bases corresponding to each of the original documents.

[0057] In one alternative implementation, the document is segmented to obtain multiple text blocks, including:

[0058] The original document is parsed using a preset document parsing tool to obtain a formatted document that conforms to the preset format.

[0059] The document in the specified format is divided into paragraphs to obtain multiple paragraph texts;

[0060] A preset semantic segmentation model is used to segment the text of each paragraph, resulting in multiple text blocks.

[0061] In one optional implementation, a preset semantic segmentation model is used to segment the text of each paragraph to obtain multiple text blocks, including:

[0062] Obtain the preset segmentation constraints;

[0063] Based on the semantic segmentation model and the segmentation constraints, the paragraph text is segmented to obtain multiple text blocks.

[0064] In one alternative implementation, determining whether any two propositions are related includes:

[0065] Determine the weight of the first relation based on the propositional entities contained in each of the two propositions;

[0066] The weight of the second relation is determined based on the semantic similarity between the two propositions.

[0067] Based on the first relationship and the second relationship, the association weight between the two propositions is obtained;

[0068] If the correlation weight is higher than a preset threshold, then it is determined that there is a correlation between the two propositions.

[0069] In one optional implementation, the original corresponding proposition-level knowledge sub-base is constructed based on the two propositions and their corresponding relationships, including:

[0070] Construct triples based on the propositions and their corresponding relationships;

[0071] Based on each of the triples, construct the original corresponding propositional-level knowledge sub-base.

[0072] Secondly, this application provides a question-answering system, which is pre-configured with multiple knowledge bases, each with a different level of knowledge granularity;

[0073] The system includes:

[0074] The retrieval granularity determination module is used to obtain the user-input question to be processed, determine the question intent corresponding to the question to be processed, and the retrieval granularity corresponding to the question intent;

[0075] The target knowledge base determination module is used to determine a target knowledge base that matches the retrieval granularity from the plurality of knowledge bases, wherein different retrieval granularities correspond to knowledge bases with different knowledge granularities.

[0076] The prompt knowledge determination module is used to retrieve prompt knowledge related to the problem to be processed based on the target knowledge base;

[0077] The answer generation module is used to generate an answer to the question to be processed based on the provided prompts.

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

[0079] The memory stores computer-executed instructions;

[0080] The processor executes computer execution instructions stored in the memory to implement the method as described in the first aspect.

[0081] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in the first aspect.

[0082] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.

[0083] The question-answering method provided in this application obtains the user's input question, determines the question intent and corresponding retrieval granularity, matches a target knowledge base with the appropriate granularity from multiple knowledge bases based on the retrieval granularity, retrieves relevant hints and knowledge, and generates a corresponding answer based on these hints. In this approach, adaptively selecting the knowledge base with the optimal granularity based on the question intent enhances the completeness of the context or focuses key information during knowledge retrieval, thereby improving retrieval quality and ultimately increasing the accuracy and reliability of the generated answer. Attached Figure Description

[0084] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0085] Figure 1 A diagram illustrating an application scenario of the question-answering method provided in this application;

[0086] Figure 2 A flowchart illustrating a question-and-answer method provided in an embodiment of this application;

[0087] Figure 3 A flowchart illustrating another question-and-answer method provided in an embodiment of this application;

[0088] Figure 4 A schematic diagram illustrating the process of generating a proposition-level knowledge base, provided in an embodiment of this application;

[0089] Figure 5 A schematic diagram illustrating a proposition-level knowledge base retrieval process provided in an embodiment of this application;

[0090] Figure 6 This is a schematic diagram of the structure of a question-and-answer system provided in an embodiment of this application;

[0091] Figure 7 This is a block diagram of an electronic device provided in this application.

[0092] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0093] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of systems and methods consistent with some aspects of this application as detailed in the appended claims.

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

[0095] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0096] In recent years, Large Language Model (LLM) technology has developed rapidly and has been widely applied in various industries, demonstrating outstanding capabilities in many natural language processing tasks. However, despite its excellent performance, it still has limitations such as generating false information ("illusions"), lack of interpretability in the generation process, insufficient understanding of domain-specific knowledge, and limited grasp of the latest knowledge after the training data deadline.

[0097] To address these issues, Retrieval-Augmented Generation (RAG) technology emerged and quickly became a focal solution in the industry. RAG improves the accuracy, richness, and timeliness of the generated text by retrieving relevant information and document fragments from external knowledge bases in real time and combining them with the generation process of a large language model.

[0098] However, existing RAGs mostly use fixed-length or rule-driven text segmentation to build knowledge bases, such as using paragraphs or sentences as the smallest unit for retrieval. Although some systems have begun to explore more granular retrieval mechanisms, there are still certain limitations in actual retrieval scheduling and integration. For example, different types of queries have significantly different requirements for information granularity, resulting in a mismatch between search results and user intent. Current systems cannot dynamically match appropriate granularity for different question types, affecting retrieval accuracy, contextual completeness, and the credibility of question-and-answer results.

[0099] The question-answering method provided in this application aims to solve the aforementioned technical problems of existing technologies. Specifically, it involves acquiring the user-input question, determining the question's intent and corresponding retrieval granularity, matching a target knowledge base with the appropriate granularity from multiple knowledge bases based on the retrieval granularity, retrieving relevant hints, and generating a corresponding answer based on these hints. In this approach, adaptively selecting the knowledge base with the optimal granularity based on the question's intent enhances the completeness of the context or focuses key information during knowledge retrieval, thereby improving retrieval quality and ultimately increasing the accuracy and reliability of the generated answer.

[0100] The question-answering methods provided can be widely applied in large-scale question-answering systems where multi-granularity knowledge retrieval and adaptive intent matching are required. They are particularly suitable for professional fields that require high accuracy and contextual completeness of answers. Specific scenarios include, but are not limited to, the following: scenarios in enterprise knowledge base systems where users submit complex query intents that require precise matching of knowledge granularity; scenarios in vertical fields such as finance, healthcare, and law where there is a strong demand for multi-level knowledge retrieval and credible answer generation; and scenarios where RAG service providers need to flexibly adapt knowledge structures for different clients.

[0101] Furthermore, this method can be extended to the intelligent retrieval enhancement module in our self-developed large language model platform, significantly improving the reliability and scenario adaptability of complex question answering by dynamically selecting knowledge granularity. For example, in government consultation systems, it can automatically distinguish different intentions such as laws and regulations, service guides, and policy interpretations based on user questions, and call the corresponding knowledge base to generate a well-structured and well-supported response. In intelligent customer service scenarios, it can simultaneously handle multiple query types such as product inquiries, troubleshooting, and operation guidance, significantly reducing the false positive rate while ensuring accurate responses.

[0102] In summary, this technical solution is applicable to all application scenarios involving complex question answering with multiple intents, multi-granularity knowledge organization, and adaptive retrieval.

[0103] For ease of understanding, the following is based on Figure 1 The application scenarios applicable to the embodiments of this application are described below. Figure 1 A diagram illustrating an application scenario of the question-answering method provided in this application. See also... Figure 1 This application's solution is applicable to question-answering system scenarios. It mainly includes the RAG system and a large language model. The RAG system comprises multiple knowledge bases, each with different levels of knowledge granularity.

[0104] The question-answering scheme proposed in this application mainly includes two stages: a knowledge base generation stage and a question retrieval and answer generation stage.

[0105] In the knowledge base construction phase, the first step is to acquire multiple original documents. For each document, it is first segmented into multiple text blocks, each containing at least one complete sentence. Then, proposition extraction is performed on each text block to obtain multiple propositional units. Further analysis is conducted to determine the relationships between different propositions. Based on these propositions and their interrelationships, a proposition-level knowledge sub-base corresponding to the original document is constructed. Finally, the proposition-level knowledge sub-bases corresponding to all original documents are integrated to form the proposition-level knowledge base.

[0106] In addition, this stage also includes the construction process of statement-level and paragraph-level knowledge bases. This process can refer to existing publicly available technologies and will not be described in detail here.

[0107] By constructing a knowledge base with multiple granularities, such as proposition-level and statement-level, the system can adapt to different levels of granularity in retrieval needs, thereby achieving more accurate retrieval and improving retrieval quality.

[0108] In the question retrieval and answer generation stage, the system first receives the user's input question and identifies the question's intent and its corresponding retrieval granularity. Based on the retrieval granularity, it selects a target knowledge base from multiple knowledge bases to match the retrieval requirements, thus enabling different granularity retrieval needs to correspond to different knowledge bases with different granularity. Subsequently, it performs a retrieval based on the target knowledge base to obtain hints related to the question. Finally, it combines the retrieved hints to generate an answer to the question.

[0109] Through the above approach, the system can adaptively select the knowledge base with the optimal knowledge granularity for retrieval based on the question's intent, thereby improving retrieval quality by enhancing contextual completeness or focusing on key information, and ultimately improving the accuracy and reliability of answer generation.

[0110] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0111] Figure 2 This is a flowchart illustrating a question-and-answer method provided in an embodiment of this application. The method can be executed by a question-and-answer system, which can be a server or an electronic device. The following description uses an electronic device as an example. The method in this embodiment can be implemented through software, hardware, or a combination of both. Figure 2 As shown, the method includes the following steps:

[0112] S201. Obtain the user-input question to be processed, determine the question intent corresponding to the question to be processed, and the retrieval granularity corresponding to the question intent.

[0113] In this embodiment, the problem to be processed includes, but is not limited to, content input by the user via voice, text, or a graphical interface. The problem intent represents the information the user truly wants to obtain or the core need they hope to resolve when asking the question. The retrieval granularity corresponding to the problem intent can be understood as the level of detail or unit size of information used by the system when matching and retrieving knowledge based on the specificity of the user's question and their information needs.

[0114] Optionally, natural language understanding technology can be used to perform semantic analysis and intent recognition on the question to determine the user's question intent category. Based on this, according to predefined intent-granularity mapping rules, the retrieval granularity matching the intent can be automatically determined, and then a target knowledge base with the corresponding knowledge granularity can be selected for retrieval, thereby improving the targeting and accuracy of knowledge retrieval and thus improving the quality of answer generation.

[0115] Based on this, an optional implementation method provided in this embodiment includes: obtaining a preset intent recognition model; inputting the question to be processed into the intent recognition model to obtain the question intent corresponding to the question to be processed; determining the retrieval granularity corresponding to the question intent according to the question intent and a preset first mapping relationship; wherein, the first mapping relationship is the mapping relationship between the question intent and the retrieval granularity.

[0116] See details Figure 3 A pre-trained intent recognition model is obtained. This model can be trained by supervised learning based on question samples labeled with intent categories, or the intent recognition model can be obtained by fine-tuning the large language model with instructions using the above question samples. This embodiment does not limit the model architecture and training method of the intent recognition model.

[0117] The user-inputted question is fed into the intent recognition model described above. Through model inference, the intent category to which the question belongs is obtained, which is then used as the question intent. Optionally, the intent categories obtained through inference include, but are not limited to, fact-finding intents, multi-hop question-and-answer intents, cause-analysis intents, summary intents, and comparison-analysis intents, among others.

[0118] It should be noted that: fact-finding intent can be understood as users wanting to obtain clear and specific factual information, such as definitions, attributes, time, and location; multi-hop question-and-answer intent can be understood as users' questions requiring multiple inferences or combining multiple information sources to arrive at an answer; causal analysis intent can be understood as users focusing on the causes, mechanisms, or causal relationships behind events or phenomena; summarizing intent can be understood as users requesting a summary, refinement, or overview of a certain topic or content; and comparative analysis intent can be understood as users wanting to compare the similarities, differences, advantages, disadvantages, or relationships between two or more objects.

[0119] In addition, the system pre-stores a first mapping table, which predefines the correspondence between different question intentions and search granularities; the search granularity includes, but is not limited to, multiple levels such as proposition level, sentence level, and paragraph level. Among them, paragraph-level search granularity is higher than sentence-level search granularity, and sentence-level search granularity is higher than proposition-level search granularity.

[0120] Based on this, the system can query the first mapping table according to the identified question intent to determine the retrieval granularity that matches the identified question intent, thereby providing a basis for the accurate selection of the knowledge base in the future.

[0121] Specifically, for fact-finding intents that require precise answers, such as fact-finding queries and multi-hop question-and-answer queries, the system can match proposition-level retrieval granularity to obtain fine-grained knowledge units; for explanatory intents that require understanding contextual relationships, such as causal analysis and summary, it matches sentence-level retrieval granularity to obtain more coherent semantic information fragments; and for intents that require macro-level information summarization or multiple comparisons, such as comparative analysis, it can match paragraph-level retrieval granularity to retrieve knowledge blocks containing more complete arguments.

[0122] In this way, by aligning the granularity with the intent as described above, the system can adaptively select the appropriate retrieval granularity based on the user's intent, thereby improving the matching accuracy between the acquired knowledge and the problem requirements while ensuring retrieval efficiency.

[0123] S202. Based on the retrieval granularity, determine the target knowledge base that matches the retrieval granularity from multiple knowledge bases.

[0124] In this embodiment, the system is pre-configured with multiple knowledge bases of different granularities, including proposition-level knowledge bases, statement-level knowledge bases, and paragraph-level knowledge bases. Each knowledge base constructs a retrieval index based on its corresponding smallest knowledge unit, such as a proposition, a complete statement, or a paragraph, to support efficient retrieval at the corresponding granularity.

[0125] Based on this, a knowledge base whose knowledge granularity matches the retrieval granularity determined in the preceding steps can be selected as the target knowledge base.

[0126] In one optional implementation, if the retrieval granularity is paragraph-level, then the paragraph-level knowledge base is determined as the target knowledge base corresponding to the question to be processed; if the retrieval granularity is statement-level, then the statement-level knowledge base is determined as the target knowledge base corresponding to the question to be processed; if the retrieval granularity is proposition-level, then the proposition-level knowledge base is determined as the target knowledge base corresponding to the question to be processed. This ensures the consistency between the retrieval operation and the user's question intent at the knowledge granularity, thereby improving the accuracy of subsequent knowledge retrieval and the relevance of answer generation.

[0127] S203. Search the target knowledge base to obtain relevant hints about the problem to be addressed.

[0128] In this embodiment, the problem to be processed can be converted into a query vector. For example, embedding models such as BERT and Sentence-BERT can be used for vector conversion to obtain the problem vector corresponding to the problem to be processed.

[0129] Then, in the selected target knowledge base, vector similarity retrieval is performed to retrieve the Top-K knowledge units that are most similar to the query vector from the target knowledge base, which are then used as candidate hint knowledge.

[0130] In some scenarios, candidate results can be reordered and filtered based on relevance scores, and a predetermined number of the most relevant candidates can be selected as hints for generating answers.

[0131] S204. Based on the provided information, generate the answers to the questions to be processed.

[0132] In this embodiment, if the hint knowledge is retrieved, the answer can be generated by using a large language model and combining it with the hint knowledge. Optionally, one possible implementation may include: obtaining a preset large language model; inputting the question to be processed and the hint knowledge into the large language model to obtain the answer corresponding to the question to be processed.

[0133] Specifically, the problem to be processed can be combined with the retrieved hints to construct an enhanced input context. This enhanced input is then provided to a pre-trained large language model, which generates a natural language answer that is closely related to the problem, semantically coherent, and accurate based on the provided information.

[0134] Optionally, in certain application scenarios, the generated results can be post-processed before the final answer is output. Processing methods include, but are not limited to, factual accuracy verification, logical consistency checks, and standardization and readability optimization of the answer structure. After processing, the final answer is returned to the user.

[0135] In the above technical solution, the user-inputted question is obtained, and its intent and corresponding retrieval granularity are determined. Based on the retrieval granularity, a target knowledge base with the appropriate granularity is matched from multiple knowledge bases. Then, relevant hints are retrieved, and a corresponding answer is generated based on these hints. This solution, by adaptively selecting the knowledge base with the optimal granularity based on the question intent, enhances the completeness of the context or focuses key information during knowledge retrieval, thereby improving retrieval quality and ultimately increasing the accuracy and reliability of the generated answer.

[0136] Before delving into the detailed question retrieval and answer generation process, this article will use examples to illustrate the construction process of the proposition-level knowledge base involved in the retrieval process. As for the statement-level knowledge base mentioned in the examples, its construction can employ any publicly available implementation method, which will not be elaborated upon here.

[0137] In one optional implementation, the process of constructing a proposition-level knowledge base includes: acquiring multiple original documents; for each original document, performing document segmentation to obtain multiple text blocks; each text block containing at least one statement; extracting propositions from each text block to obtain multiple propositions; determining whether any two propositions have a correlation; if so, constructing an original corresponding proposition-level knowledge sub-base based on the two propositions and their corresponding correlation; and generating a proposition-level knowledge base based on the proposition-level knowledge sub-bases corresponding to each original document.

[0138] In this embodiment, the original document may be derived from professional literature in the field, technical manuals, product specifications, or other relevant text resources.

[0139] To facilitate understanding, the following detailed explanation uses any single original document as an example. The processing of other original documents is similar and can be implemented using the following procedure.

[0140] See details Figure 4 The obtained original document is segmented into multiple consecutive text blocks. Optionally, the segmentation can be based on semantic boundaries, punctuation rules, or predefined lengths to ensure that each text block is semantically independent, meaning that each segmented text block will contain at least one semantically complete sentence.

[0141] Next, proposition extraction is performed on each segmented text block. Specifically, rule-based or deep learning methods can be used to identify text blocks and extract one or more core propositions expressed in the text blocks. It is understood that each proposition usually corresponds to an atomic fact or assertion.

[0142] In this embodiment, the association relationship may include semantic similarity, logical inference, temporal relationship, or contextual co-occurrence. Based on this, the semantic association strength is determined by calculating the cosine similarity between the embedding vectors of two propositions; if the similarity is higher than a preset threshold, it is determined that the two are associated.

[0143] After determining the relationships between propositions, for each original document, a proposition-level knowledge sub-base corresponding to that document can be constructed based on the propositions it contains and the relationships between them. This sub-base can store propositions and their relationships in a structured form, such as by organizing them in a graph structure or relational data table.

[0144] Building upon this foundation, all original documents can be integrated into a proposition-level knowledge sub-base. Through unified indexing and storage management, a proposition-level knowledge base can be generated for the system. This knowledge base supports efficient retrieval and knowledge reuse at the proposition level, providing underlying data support for proposition-level knowledge retrieval tasks.

[0145] In the above implementation process, one optional implementation method for segmenting the original document to obtain multiple text blocks may include: using a preset document parsing tool to parse the original document to obtain a formatted document that conforms to a preset format; performing paragraph segmentation processing on the formatted document to obtain multiple paragraph texts; and using a preset syntax tool. Specifically, for an original document of any format, the document parsing tool is first used to identify and preliminarily segment the structural information such as paragraph marks, heading levels, and encoding formats to obtain a formatted document that conforms to preset structured requirements, such as converting it to a Markdown format file.

[0146] Furthermore, based on the structural features of the converted document, such as paragraph marks and heading levels, the formatted document can be divided into paragraphs to obtain multiple paragraph texts.

[0147] Optionally, in certain application scenarios, the converted formatted document can be cleaned and filtered before paragraph division, such as removing non-subject semantic content such as footnotes, headers and footers, and irrelevant annotations, in order to improve the efficiency of subsequent text processing stages and the accuracy of proposition extraction.

[0148] Optionally, in some scenarios, the converted formatted document can be filtered before paragraph text division to remove content such as footnotes that are semantically irrelevant to the document, thereby improving the efficiency and accuracy of subsequent proposition extraction.

[0149] Based on this, each paragraph of text is input into the semantic segmentation model for processing, resulting in multiple corresponding text blocks.

[0150] Optionally, one possible implementation of segmenting paragraph text may include: obtaining preset segmentation constraints; and segmenting the paragraph text based on a semantic segmentation model and the segmentation constraints to obtain multiple text blocks.

[0151] In this embodiment, the semantic segmentation model can fine-tune the large model based on instructions. Furthermore, to ensure that the output text blocks have independent and complete semantic content, a prompt template can be pre-designed for the large model, explicitly setting segmentation constraints within the template. For example, each text block should contain 1 to 3 semantically related sentences, with a length controlled within the range of 200 to 500 tokens, ensuring that the segmentation results possess both semantic independence and appropriate length. In this way, the large model can intelligently segment the input paragraph according to the above constraints, outputting text blocks that meet the requirements.

[0152] Based on the above implementation methods, an alternative implementation method for extracting propositions from text blocks may include: using a large model to perform the proposition generation task; specifically, prompt words can be used to guide the model to semantically decompose the input paragraph and output a set of proposition lists with atomicity and self-containment, and the model's output is organized in units of natural language propositions, without the need for structured fields or entity annotations.

[0153] It should be noted that in some application scenarios, the acquired original document may contain content in multiple languages, including Chinese and English. In such cases, during the text block segmentation process, the content can be differentiated based on language type, splitting it into English text blocks and Chinese text blocks. Subsequently, proposition extraction can be performed on the English and Chinese text blocks separately, generating corresponding proposition lists for each to ensure the semantic integrity of the text in different languages ​​and the accuracy of proposition extraction.

[0154] For example, the list of propositions corresponding to a block of English text may include:

[0155] Input text block:

[0156] "In 2020, Company A launched the XX chip, which improved performance and battery life in Product A."

[0157] Output proposition:

[0158] " Company A launched the XX chip in 2020."

[0159] "The XX chip improved performance in Product A."

[0160] "The XX chip improved battery life in Product A."

[0161] The list of propositions corresponding to Chinese text blocks can include:

[0162] Input text block: "Company A released the XX chip in 2020, which improved the performance and battery life of product A."

[0163] Output proposition:

[0164] Company A released the XX chip in 2020.

[0165] "Chip XX improves the performance of product A."

[0166] "The XX chip improves the battery life of product A."

[0167] Based on the extraction of all propositions, determine whether there is a relationship between any two propositions, and store each proposition in relation to the other.

[0168] Optionally, an alternative implementation for determining whether two propositions have an association relationship includes: determining a first relationship weight based on the proposition entities contained in each of the two propositions; determining a second relationship weight based on the semantic similarity of the two propositions; obtaining the association relationship weight between the two propositions based on the first and second relationships; and determining that the two propositions have an association relationship if the association relationship weight is higher than a preset threshold.

[0169] In this embodiment, propositional entities include, but are not limited to, core semantic elements such as subject, object, predicate, time, and place, such as names, organizations, products, and times.

[0170] Specifically, for any entity, named entity recognition technology and dependency parsing technology can be used to extract entities and obtain multiple propositional entities. For example, for proposition 1, the corresponding entity set P1 is obtained, and for proposition 2, the corresponding entity set P2 is obtained.

[0171] On this basis, the first relationship weight w1 can be determined according to the number of identical entities in the entity sets of the two propositions and in combination with a preset threshold condition.

[0172] Specifically, the number of identical entities in the entity sets of the two propositions is N, and a first quantity threshold T1 and a second quantity threshold T2 are preset, where T1 < T2. For example, T1 = 0, T2 = 5.

[0173] The first relationship weight w1 can be determined by the following rules: if N ≤ T1, then w1 = 0; if N ≥ T2, then w1 = 1; if T1 < N < T2, then N is normalized, and w1 is calculated by linear interpolation, specifically: w1 = (N - T1) / (T2 - T1).

[0174] Exemplarily, when T1 = 0, T2 = 5: if there are no identical entities in the two sets (N = 0), then w1 = 0; if the number of identical entities is 3, then w1 = (3 - 0) / (5 - 0) = 0.6; if the number of identical entities reaches or exceeds 5 (N ≥ 5), then w1 = 1.

[0175] During this period, a pre-trained deep learning model can also be used to encode the two proposition sets into vector representations and calculate the cosine similarity between the two vectors to obtain the second relationship weight w2. <000037​​​​​​​​​​​​Specifically, propositions with relationships are extracted from the original documents and triples are constructed in the form of "subject proposition, relation, object proposition". After the triples are constructed, consistency checks and redundancy eliminations are performed on all triples, and the resulting set of triples is organized into a structured knowledge base, thus forming a proposition-level knowledge sub-base.

[0181] In the above implementation, storing related propositions in the form of triples not only improves the structuring of the knowledge sub-base, but also facilitates subsequent knowledge retrieval and reasoning applications based on logical relationships.

[0182] It should also be noted that in the proposition-level knowledge base, each original document corresponds to an independent knowledge sub-base. This facilitates subsequent updates and expansions of the knowledge base. That is, when adding a new document, only the corresponding knowledge sub-base needs to be generated for the new original document according to the above implementation method, and then integrated into the existing knowledge base. This storage and expansion method not only effectively reduces redundant operations and improves the efficiency of knowledge base construction, but also facilitates document-based management, maintenance, and traceability of knowledge content, thereby enhancing the scalability and maintainability of the knowledge base.

[0183] Based on the proposition-level knowledge base constructed according to the above implementation methods, the following is an exemplary description of the retrieval process using this knowledge base. It should be noted that the following description is merely illustrative and does not constitute a limitation on the technical solution of this application.

[0184] Optionally, if the target knowledge base is a proposition-level knowledge base, one possible implementation of retrieving and obtaining hint knowledge may include: retrieving each proposition in the target knowledge base according to the problem to be processed to obtain first hint knowledge; determining the problem keywords corresponding to the problem to be processed, and obtaining the set of proposition keywords corresponding to the target knowledge base; retrieving the set of proposition keywords according to the set of problem keywords to obtain second hint knowledge; and obtaining hint knowledge related to the problem to be processed based on the first hint knowledge and the second hint knowledge.

[0185] See details Figure 5 Based on the problem to be processed, semantic search is performed on each proposition contained in the proposition-level knowledge base, and the initial search results are used as the first hint knowledge.

[0186] At the same time, keywords for the problems to be processed are extracted to form a set of problem keywords; and a set of pre-constructed proposition keywords in the proposition-level knowledge base is obtained; wherein, the set contains the proposition keywords corresponding to each proposition in the knowledge base.

[0187] Based on this, the problem keyword set and the proposition keyword set are matched and retrieved. Based on the degree of matching, relevant propositions are selected to form second hint knowledge. The first knowledge and the second knowledge are then merged. Optionally, in some scenarios, deduplication and sorting can also be performed. The processed hint knowledge is used as hint knowledge related to the problem to be processed for subsequent question answering or reasoning tasks.

[0188] By constructing a lightweight knowledge sub-base and a set of propositional keywords, and performing propositional retrieval on this basis, the scale of text to be processed during the retrieval process is effectively controlled. This reduces the amount of token input and the corresponding calling cost when reasoning with large language models. While fully preserving the reasoning ability, it improves the operating efficiency and deployment flexibility of the retrieval system when facing large-scale corpora.

[0189] In the above implementation process, an optional implementation method for obtaining the first hint knowledge may include: calculating the semantic similarity between the problem to be processed and each proposition; filtering the target knowledge base based on the semantic similarity to construct a lightweight knowledge sub-base; and retrieving propositions in the knowledge sub-base according to the problem to be processed to generate the first hint knowledge.

[0190] Specifically, a pre-trained semantic model can be used to map natural language questions and propositions into semantic vectors, and the degree of semantic association can be measured by methods such as cosine similarity or Euclidean distance. Based on the obtained semantic similarity, propositions in the knowledge base can be filtered. For example, a similarity threshold can be set to retain only propositions with similarity higher than the threshold, or the Top-K propositions can be selected from high to low similarity to construct a lightweight knowledge sub-base that is highly relevant to the current question.

[0191] Furthermore, based on the problem to be addressed, the propositions in the lightweight knowledge sub-base are further searched and ranked to generate initial suggestion knowledge. Optionally, the search process can be implemented based on keyword matching, semantic matching, or a combination thereof, thereby improving the accuracy and relevance of the suggestion knowledge.

[0192] In the above implementation, an optional implementation of calculating the semantic similarity between propositions may include: for each proposition, obtaining the problem entity of the problem to be processed, and obtaining the proposition entity corresponding to the proposition; calculating the semantic similarity between the problem entity and the proposition entity to obtain the semantic similarity between the problem to be processed and the proposition.

[0193] Specifically, at least one problem entity in the problem to be processed can be identified and extracted using named entity recognition tools, dictionary matching, or rule-based methods; at the same time, at least one proposition entity can be extracted from the corresponding proposition in the proposition-level knowledge base based on the above methods; wherein, the above two entities can be named entities, key terms, or phrases with specific semantic meanings.

[0194] Based on a pre-trained word vector model or semantic representation model, the two types of entities mentioned above are mapped to vector representations. Similarity is calculated using cosine similarity, Euclidean distance, or a matching function based on attention mechanism to obtain the semantic similarity score of each entity pair. Then, the overall semantic similarity between the problem to be processed and the proposition is obtained by fusion through weighted averaging, max pooling, or attention aggregation.

[0195] In the above implementation, calculating proposition similarity through entity semantic matching can effectively improve the accuracy and interpretability of knowledge retrieval, while enhancing the ability to represent complex semantic relationships.

[0196] As can be seen from the above implementation method, each proposition in the proposition-level knowledge base is stored in the form of triples. Based on this structured representation, each proposition in the lightweight knowledge sub-base constructed in the aforementioned manner has a connection path.

[0197] Based on this, an optional implementation of retrieval in the knowledge sub-base may include: determining the proposition with the highest semantic similarity to the problem to be processed from the knowledge sub-base as the starting proposition; traversing the path from the starting proposition according to the connection path until the ending proposition is located; and combining the starting proposition, the ending proposition, and the intermediate propositions passed during the traversal to generate the first hint knowledge.

[0198] Specifically, based on the aforementioned semantic similarity calculation method, the proposition with the highest similarity score can be selected as the starting point for traversal. A structured traversal is then performed starting from the initial proposition, based on the connection paths between propositions stored in the knowledge sub-base as triples.

[0199] Optionally, a beam search algorithm can be used for path exploration; that is, at each step of expansion, the K most likely paths, i.e., the beam width, are retained and sorted and selected based on the semantic relevance between the propositions and questions on the path, the path weight, or a predefined scoring function, and the search range is gradually expanded until the termination condition is met. At this point, the last proposition in the current path is determined as the termination proposition. Optionally, the termination condition includes, but is not limited to, reaching the preset path length, hitting a specific type of proposition, or the similarity being lower than a threshold.

[0200] Based on this, the initial proposition, the final proposition, and the intermediate propositions and their relational paths traversed during the bundle search process are combined to form a coherent semantic reasoning chain, which is used as the first hint knowledge.

[0201] The above implementation method can efficiently extract multi-hop reasoning paths related to the question from the knowledge sub-base while maintaining semantic coherence. This reduces the token consumption and computational cost of large-scale language models and improves the accuracy and interpretability of knowledge retrieval.

[0202] It should be noted that the beam search algorithm and its parameters used in this embodiment can be adjusted according to the actual application scenario, or can be replaced with other path search algorithms, such as breadth-first search, depth-first search or random walk algorithms. The specific implementation method described above is not intended to limit the scope of protection of this application.

[0203] In the process of implementing the above method, an optional implementation method for obtaining the set of propositional keywords in the target knowledge base may include: extracting the propositional keywords of each proposition in the target knowledge base; generating a set of propositional keywords based on the extracted propositional keywords; wherein, the set of propositional keywords is used to construct a second mapping relationship with each proposition; the second mapping relationship is in the form of a bipartite graph.

[0204] Specifically, core keywords or key phrases can be identified from propositional texts based on semantic extraction methods using pre-trained models or by matching rules with dictionaries, resulting in multiple propositional keywords. All extracted propositional keywords are then deduplicated and normalized to form a set of propositional keywords.

[0205] Based on this, a second mapping relationship between propositions and keywords is constructed. Optionally, this mapping relationship can be represented in the form of a bipartite graph; that is, one set of nodes represents propositions and the other set represents keywords. If a proposition contains a keyword, an edge connection is established between the proposition node and the keyword node. This enables fast keyword-based retrieval and association reasoning, providing a data structure foundation for subsequent fast matching and improving retrieval efficiency.

[0206] Based on this, an optional implementation method for generating second hint knowledge may include: matching the question keywords with a set of proposition keywords to obtain proposition keywords that are consistent with the question keywords; determining each proposition corresponding to the matched proposition keywords according to the second mapping relationship; and combining the propositions to generate second hint knowledge.

[0207] Specifically, based on string exact matching, edit distance calculation, or semantic similarity matching based on word vectors, the question keywords corresponding to the problem to be processed are matched with the set of proposition keywords to identify proposition keywords that are consistent with or semantically similar to the question keywords. Then, according to the second mapping relationship represented in the form of a bipartite graph, all proposition nodes connected to the matched proposition keywords are queried and determined, thereby obtaining the set of propositions associated with the question keywords and generating the second hint knowledge.

[0208] Optionally, in some scenarios, the acquired related propositions can be sorted, filtered, or fused. For example, they can be prioritized based on the number, weight, or semantic relevance of matching keywords and combined to generate second hint knowledge.

[0209] The above implementation method, through keyword matching and bipartite graph mapping, can quickly and accurately retrieve propositions closely related to the question from the knowledge base, thereby improving the generation efficiency and retrieval accuracy of prompt knowledge, while also reducing the dependence on large language models and computational overhead.

[0210] Based on the above implementation method, the first prompt knowledge and the second prompt knowledge are integrated to obtain the prompt knowledge corresponding to the problem to be processed, and then the answer corresponding to the problem to be processed is generated based on the prompt knowledge.

[0211] Figure 6 This is a schematic diagram of the structure of a question-and-answer system provided in an embodiment of this application. See also... Figure 6 The question-and-answer system has 60 pre-configured knowledge bases, each with different knowledge granularity;

[0212] The question-answering system 60 includes: a retrieval granularity determination module 601, a target knowledge base determination module 602, a prompt knowledge determination module 603, and an answer generation module 604; wherein,

[0213] The retrieval granularity determination module 601 is used to obtain the user-input question to be processed, determine the question intent corresponding to the question to be processed, and the retrieval granularity corresponding to the question intent;

[0214] The target knowledge base determination module 602 is used to determine the target knowledge base that matches the retrieval granularity from multiple knowledge bases based on the retrieval granularity, wherein different retrieval granularities correspond to knowledge bases with different knowledge granularities.

[0215] The prompt knowledge determination module 603 is used to retrieve prompt knowledge related to the problem to be processed based on the target knowledge base;

[0216] The answer generation module 604 is used to generate answers to the questions to be processed based on the provided information.

[0217] In one optional implementation, the retrieval granularity determination module 601 is specifically used for:

[0218] Obtain the preset intent recognition model;

[0219] The question to be processed is input into the intent recognition model to obtain the question intent corresponding to the question to be processed;

[0220] Based on the question intent and the preset first mapping relationship, the retrieval granularity corresponding to the question intent is determined; wherein, the first mapping relationship is the mapping relationship between the question intent and the retrieval granularity.

[0221] In one optional implementation, the intent types include fact query intents, multi-hop question-and-answer intents, causal analysis intents, summary intents, and comparison analysis intents; wherein, comparison analysis intents correspond to paragraph-level retrieval granularity; causal analysis intents and summary intents correspond to statement-level retrieval granularity; fact query intents and multi-hop question-and-answer intents both correspond to proposition-level retrieval granularity; wherein, paragraph-level retrieval granularity is higher than statement-level retrieval granularity, and statement-level retrieval granularity is higher than proposition-level retrieval granularity.

[0222] In one optional implementation, the knowledge base includes a paragraph-level knowledge base, a statement-level knowledge base, and a proposition-level knowledge base; wherein the granularity of the paragraph-level knowledge base is higher than that of the statement-level knowledge base; and the granularity of the statement-level knowledge base is higher than that of the proposition-level knowledge base.

[0223] Target knowledge base determination module 602 is specifically used for:

[0224] If the retrieval granularity is paragraph-level, then the paragraph-level knowledge base will be determined as the target knowledge base corresponding to the problem to be processed.

[0225] If the retrieval granularity is at the statement level, then the statement-level knowledge base will be determined as the target knowledge base corresponding to the problem to be processed.

[0226] If the retrieval granularity is at the propositional level, then the propositional knowledge base will be determined as the target knowledge base corresponding to the problem to be processed.

[0227] In one optional implementation, the target knowledge base is a proposition-level knowledge base; the proposition-level knowledge base includes multiple propositions;

[0228] The prompt knowledge determination module 603 is specifically used to: search for each proposition in the target knowledge base based on the problem to be processed, and obtain the first prompt knowledge;

[0229] Identify the keywords corresponding to the problem to be addressed, and obtain the set of propositional keywords corresponding to the target knowledge base;

[0230] Based on the keywords in the question, a search is conducted on the set of keywords in the proposition to obtain the second hint knowledge;

[0231] Based on the first and second hints, relevant hints are obtained regarding the problem to be addressed.

[0232] In one alternative implementation, the knowledge determination module 603 is specifically used for:

[0233] Calculate the semantic similarity between the problem to be processed and each proposition;

[0234] The target knowledge base is filtered based on semantic similarity to construct a lightweight knowledge sub-base;

[0235] Based on the problem to be addressed, the propositions in the knowledge sub-base are retrieved to generate the first hint knowledge.

[0236] In one alternative implementation, the knowledge determination module 603 is specifically used for:

[0237] Calculate the semantic similarity between the problem to be processed and each proposition, including:

[0238] For each proposition, obtain the problem entity of the problem to be processed, and obtain the proposition entity corresponding to the proposition;

[0239] Calculate the semantic similarity between the problem entity and the proposition entity to obtain the semantic similarity between the problem to be processed and the proposition.

[0240] In one alternative implementation, there are connection paths between propositions in the knowledge sub-base;

[0241] The knowledge determination module 603 is specifically used for:

[0242] The proposition with the highest semantic similarity to the problem to be processed is identified from the knowledge sub-base and used as the starting proposition.

[0243] Based on the connection path, traverse the path starting from the initial proposition until the ending proposition is located;

[0244] The initial proposition, the final proposition, and the intermediate propositions encountered during the traversal are combined to generate the first hint knowledge.

[0245] In one alternative implementation, the knowledge determination module 603 is specifically used for:

[0246] Extract the proposition keywords for each proposition in the target knowledge base;

[0247] Based on the extracted propositional keywords, a set of propositional keywords is generated; the set of propositional keywords is used to construct a second mapping relationship with each proposition; the second mapping relationship is in the form of a bipartite graph.

[0248] In one alternative implementation, the knowledge determination module 603 is specifically used for:

[0249] Match the question keywords with the set of proposition keywords to obtain proposition keywords that are consistent with the question keywords;

[0250] Based on the second mapping relationship, determine the propositions corresponding to the matched propositional keywords;

[0251] The propositions are combined to generate a second set of hints.

[0252] In one alternative implementation, the answer generation module 604 is specifically used for:

[0253] Obtain the pre-defined large language model;

[0254] The problem to be processed and the hints are input into the large language model to obtain the answer to the problem.

[0255] In one alternative implementation, the system is also used for:

[0256] Construct a proposition-level knowledge base; the construction process includes:

[0257] Retrieve multiple original documents;

[0258] For each original document, it is split into multiple text blocks; each text block contains at least one statement.

[0259] Proposition extraction is performed on each text block to obtain multiple propositions;

[0260] Determine whether there is a relationship between any two propositions; if so, construct the original corresponding proposition-level knowledge sub-base based on the two propositions and their corresponding relationship.

[0261] A proposition-level knowledge base is generated based on the proposition-level knowledge sub-bases corresponding to each original document.

[0262] In one alternative implementation, the system is further specifically used for:

[0263] The original document is parsed using a preset document parsing tool to obtain a formatted document that conforms to the preset format.

[0264] The formatted document is divided into paragraphs to obtain multiple paragraph texts;

[0265] A pre-defined semantic segmentation model is used to segment the text of each paragraph, resulting in multiple text blocks.

[0266] In one alternative implementation, the system is further specifically used for:

[0267] Obtain the preset segmentation constraints;

[0268] Based on the semantic segmentation model and segmentation constraints, paragraph text is segmented to obtain multiple text blocks.

[0269] In one alternative implementation, the system is further specifically used for:

[0270] Determine the weight of the first relation based on the propositional entities contained in each of the two propositions;

[0271] The weight of the second relation is determined based on the semantic similarity between the two propositions.

[0272] Based on the first and second relations, the association weights between the two propositions are obtained;

[0273] If the association weight is higher than the preset threshold, then the two propositions are determined to be related.

[0274] In one alternative implementation, the system is further specifically used for:

[0275] Construct triples based on propositions and their corresponding relationships;

[0276] Based on each triple, construct the original corresponding propositional-level knowledge sub-base.

[0277] Figure 7 This is a block diagram of an electronic device provided in this application. The device can be a client terminal device or a cloud server, etc. See also... Figure 7 The device 700 may include one or more of the following components: processing component 702, memory 704, power supply component 706, multimedia component 708, audio component 710, input / output interface 712, sensor component 714, and communication component 716.

[0278] Processing component 702 typically controls the overall operation of device 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 702 may include one or more modules to facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.

[0279] Memory 704 is configured to store various types of data to support the operation of device 700. Examples of this data include instructions for any application or method operating on device 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0280] Power supply component 706 provides power to various components of device 700. Power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 700.

[0281] Multimedia component 708 includes a screen that provides an output interface between device 700 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When device 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0282] Audio component 710 is configured to output and / or input audio signals. For example, audio component 710 includes a microphone (MIC) configured to receive external audio signals when device 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 704 or transmitted via communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.

[0283] Input / output interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, start buttons, and lock buttons.

[0284] Sensor assembly 714 includes one or more sensors for providing state assessments of various aspects of device 700. For example, sensor assembly 714 may detect the on / off state of device 700, the relative positioning of components such as the display and keypad of device 700, changes in the position of device 700 or a component of device 700, the presence or absence of user contact with device 700, the orientation or acceleration / deceleration of device 700, and temperature changes of device 700. Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 714 may also include optical sensors, such as complementary metal-oxide-semiconductor (CMOS) sensors or charge-coupled device (CCD) sensors, for use in imaging applications. In some embodiments, sensor assembly 714 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0285] Communication component 716 is configured to facilitate wired or wireless communication between device 700 and other devices. Device 700 can access wireless networks based on communication standards, such as WiFi, 4G, or 5G, or combinations thereof. In one exemplary embodiment, communication component 716 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 716 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.

[0286] In an exemplary embodiment, device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processors (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0287] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, which can be executed by a processor 720 of the device 700 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0288] A non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a server's processor, enable the server to perform the aforementioned large model data processing method.

[0289] This application also provides a chip for executing instructions, which is used to execute the technical solution of the large model data processing method in the above embodiments.

[0290] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer performs the technical solution of the large model data processing method described in the above embodiments.

[0291] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the large model data processing method described in the above embodiments.

[0292] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0293] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

[0294] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0295] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A question-and-answer method, characterized in that, This is applied to a question-answering system, which is pre-configured with multiple knowledge bases, each with a different level of knowledge granularity. The method includes: Obtain the user-inputted question to be processed, determine the question intent corresponding to the question to be processed, and the retrieval granularity corresponding to the question intent; Based on the retrieval granularity, a target knowledge base matching the retrieval granularity is determined from the plurality of knowledge bases, wherein different retrieval granularities correspond to knowledge bases with different knowledge granularities; Based on the target knowledge base, retrieve relevant hints and knowledge related to the problem to be addressed. Based on the provided information, generate an answer to the question to be addressed.

2. The method according to claim 1, characterized in that, Determining the question intent corresponding to the question to be processed, and the retrieval granularity corresponding to the question intent, includes: Obtain the preset intent recognition model; The question to be processed is input into the intent recognition model to obtain the question intent corresponding to the question to be processed; Based on the question intent and the preset first mapping relationship, the retrieval granularity corresponding to the question intent is determined; wherein, the first mapping relationship is the mapping relationship between the question intent and the retrieval granularity.

3. The method according to claim 2, characterized in that, The intent types of the question intent include fact query intent, multi-hop question-and-answer intent, cause analysis intent, summary intent, and comparison analysis intent; wherein, the comparison analysis intent corresponds to paragraph-level retrieval granularity; the cause analysis intent and the summary intent correspond to statement-level retrieval granularity; the fact query intent and the multi-hop question-and-answer intent both correspond to proposition-level retrieval granularity; wherein, the paragraph-level retrieval granularity is higher than the statement-level retrieval granularity, and the statement-level retrieval granularity is higher than the proposition-level retrieval granularity.

4. The method according to claim 3, characterized in that, The knowledge base includes a paragraph-level knowledge base, a statement-level knowledge base, and a proposition-level knowledge base; wherein, the granularity of the paragraph-level knowledge base is higher than that of the statement-level knowledge base; and the granularity of the statement-level knowledge base is higher than that of the proposition-level knowledge base. Based on the retrieval granularity, a target knowledge base matching the retrieval granularity is determined from the plurality of knowledge bases, including: If the retrieval granularity is paragraph-level retrieval granularity, then the paragraph-level knowledge base is determined as the target knowledge base corresponding to the problem to be processed; If the retrieval granularity is a statement-level retrieval granularity, then the statement-level knowledge base is determined as the target knowledge base corresponding to the problem to be processed; If the retrieval granularity is a proposition-level retrieval granularity, then the proposition-level knowledge base is determined as the target knowledge base corresponding to the problem to be processed.

5. The method according to claim 4, characterized in that, If the target knowledge base is a proposition-level knowledge base; the proposition-level knowledge base includes multiple propositions; Based on the target knowledge base, a search is performed to obtain suggestive knowledge related to the problem to be addressed, including: Based on the problem to be processed, each of the propositions in the target knowledge base is retrieved to obtain the first hint knowledge; Determine the problem keywords corresponding to the problem to be processed, and obtain the set of propositional keywords corresponding to the target knowledge base; Based on the set of question keywords, a search is performed on the set of proposition keywords to obtain the second hint knowledge; Based on the first and second hints, hints related to the problem to be addressed are obtained.

6. The method according to claim 5, characterized in that, Based on the problem to be solved, each proposition in the target knowledge base is retrieved to obtain first hint knowledge, including: Calculate the semantic similarity between the problem to be processed and each of the propositions; The target knowledge base is filtered based on the semantic similarity to construct a lightweight knowledge sub-base; Based on the problem to be processed, the propositions in the knowledge sub-base are retrieved to generate the first hint knowledge.

7. The method according to claim 6, characterized in that, Calculating the semantic similarity between the problem to be processed and each of the propositions includes: For each proposition, obtain the problem entity of the problem to be processed, and obtain the proposition entity corresponding to the proposition; Calculate the semantic similarity between the problem entity and the proposition entity to obtain the semantic similarity between the problem to be processed and the proposition.

8. The method according to claim 6, characterized in that, There are connection paths between the propositions in the knowledge sub-base, and the connection paths are the associations between the propositions. Based on the problem to be processed, the propositions in the knowledge sub-base are retrieved to generate the first hint knowledge, including: The proposition with the highest semantic similarity to the problem to be processed is determined from the knowledge sub-base and used as the starting proposition. Based on the connection path, a path traversal is performed starting from the initial proposition until the termination proposition is located; The first hint knowledge is generated by combining the starting proposition, the ending proposition, and the intermediate propositions encountered during the traversal.

9. The method according to claim 5, characterized in that, Obtain the set of propositional keywords corresponding to the target knowledge base, including: Extract the proposition keywords for each proposition in the target knowledge base; Based on the extracted propositional keywords, a set of propositional keywords is generated; wherein, the set of propositional keywords is used to construct a second mapping relationship with each proposition; the second mapping relationship is in the form of a bipartite graph.

10. The method according to claim 9, characterized in that, Based on the question keywords, a search is performed on the set of proposition keywords to obtain the second hint knowledge, including: The question keywords are matched with the set of proposition keywords to obtain proposition keywords that are consistent with the question keywords; Based on the second mapping relationship, determine the propositions corresponding to the matched propositional keywords; The propositions are combined to generate the second hint knowledge.

11. The method according to any one of claims 1-10, characterized in that, Based on the provided information, generate an answer to the question to be processed, including: Obtain the pre-defined large language model; The problem to be processed and the hint knowledge are input into the large language model to obtain the answer corresponding to the problem to be processed.

12. The method according to any one of claims 1-10, characterized in that, Before determining the target knowledge base that matches the retrieval granularity from the plurality of knowledge bases, the method further includes: Construct a proposition-level knowledge base; the construction process includes: Retrieve multiple original documents; For each original document, it is split into multiple text blocks; each text block contains at least one statement. Proposition extraction is performed on each text block to obtain multiple propositions; Determine whether there is a relationship between any two propositions; if so, construct the original corresponding proposition-level knowledge sub-base based on the two propositions and their corresponding relationship. The proposition-level knowledge base is generated based on the proposition-level knowledge sub-bases corresponding to each of the original documents.

13. The method according to claim 12, characterized in that, For each original document, it is split into multiple text blocks, including: The original document is parsed using a preset document parsing tool to obtain a formatted document that conforms to the preset format. The document in the specified format is divided into paragraphs to obtain multiple paragraph texts; A preset semantic segmentation model is used to segment the text of each paragraph, resulting in multiple text blocks.

14. The method according to claim 13, characterized in that, Using a pre-defined semantic segmentation model, the text of each paragraph is segmented to obtain multiple text blocks, including: Obtain the preset segmentation constraints; Based on the semantic segmentation model and the segmentation constraints, the paragraph text is segmented to obtain multiple text blocks.

15. The method according to claim 12, characterized in that, Determining whether there is a relationship between any two propositions includes: Determine the weight of the first relation based on the propositional entities contained in each of the two propositions; The weight of the second relation is determined based on the semantic similarity between the two propositions. Based on the first relationship and the second relationship, the association weight between the two propositions is obtained; If the correlation weight is higher than a preset threshold, then it is determined that there is a correlation between the two propositions.

16. The method according to claim 12, characterized in that, Based on the two propositions and their corresponding relationships, the original corresponding proposition-level knowledge sub-base is constructed, including: Construct triples based on the propositions and their corresponding relationships; Based on each of the triples, construct the original corresponding propositional-level knowledge sub-base.

17. A question-and-answer system, characterized in that, The question-answering system is pre-configured with multiple knowledge bases, each with a different level of knowledge granularity. The system includes: The retrieval granularity determination module is used to obtain the user-input question to be processed, determine the question intent corresponding to the question to be processed, and the retrieval granularity corresponding to the question intent; The target knowledge base determination module is used to determine a target knowledge base that matches the retrieval granularity from the plurality of knowledge bases, wherein different retrieval granularities correspond to knowledge bases with different knowledge granularities. The prompt knowledge determination module is used to retrieve prompt knowledge related to the problem to be processed based on the target knowledge base; The answer generation module is used to generate an answer to the question to be processed based on the provided prompts.

18. An electronic device, characterized in that, include: A processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor, when executing the computer execution instructions, is used to implement the question-and-answer method as described in any one of claims 1 to 16.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the question-and-answer method as described in any one of claims 1 to 16.

20. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the question-and-answer method as described in any one of claims 1 to 16.

Citation Information

Cited By

  • Data query method and device, equipment, storage medium and program product

    CN122173635A