An intelligent question and answer method and system based on large model and retrieval enhancement

By introducing product and version identifiers into the intelligent question-answering system, combined with large language models and retrieval enhancement technology, the accuracy problem of cross-version queries for insurance products was solved, high-quality answer generation was achieved, and user experience and system adaptability were improved.

CN121597805BActive Publication Date: 2026-04-21BEIJING ZHIBAO HUIZHONG DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ZHIBAO HUIZHONG DIGITAL TECHNOLOGY CO LTD
Filing Date
2025-12-03
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing intelligent question-answering systems are unable to accurately handle cross-version query requests when faced with the complex and ever-changing situation of insurance products, resulting in incorrect answers and failing to meet users' personalized needs.

Method used

By introducing product and version identifiers, combining user query intent analysis and version consistency score calculation, and utilizing large language models and retrieval enhancement technologies, accurate version filtering and information matching are performed, including vector retrieval and secondary knowledge base retrieval, to generate high-quality answers.

Benefits of technology

It significantly improves the accuracy, consistency, and relevance of Q&A, optimizes the user experience, adapts to the rapid iteration characteristics of insurance products, and ensures the accuracy of answers and compatibility with the latest version.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121597805B_ABST
    Figure CN121597805B_ABST
Patent Text Reader

Abstract

A method and system for intelligent question answering based on a large model and retrieval enhancement is disclosed, relating to the field of intelligent question answering. In this method, a preliminary retrieval is performed on a preset knowledge base to obtain document fragments and construct a candidate version set. If it is determined that the query request does not belong to the cross-version query type, a version consistency score is calculated to determine the target version with the highest score. The target document fragment corresponding to the target version is obtained, and the query request is vectorized to generate a question vector. Based on the question vector, a vector retrieval is performed in a preset vector knowledge base to obtain the question vector result. A secondary retrieval is then performed in the preset knowledge base based on the target version to obtain the document retrieval result. The question vector result and the document retrieval result are merged to obtain initial candidate documents. A first final prompt word is generated and input into a preset large language model to obtain the first target answer. Implementing the technical solution provided in this application improves the accuracy of intelligent question answering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent question answering, specifically to an intelligent question answering method and system based on large models and retrieval enhancement. Background Technology

[0002] In the insurance industry, traditional intelligent customer service or marketing assistant systems often rely on fixed rule engines or small models for question and answer. These systems can only handle some structured and standardized simple queries. When faced with complex and ever-changing insurance policy inquiries, in-depth product comparison analysis, and personalized insurance advice, they often fail to provide accurate and effective answers due to insufficient semantic understanding and lack of multi-turn dialogue capabilities, resulting in low work efficiency for marketing personnel and a poor user experience.

[0003] To address these issues, an intelligent question-answering method combining a large language model has been proposed. Upon receiving a user's question, this method first retrieves relevant text fragments from a pre-built knowledge base. These text fragments, along with the original question, are then provided to the large language model as contextual information. The large language model then generates a more accurate and natural answer based on this rich context. This approach significantly enhances the question-answering system's ability to handle complex questions and improves the accuracy and relevance of the answers.

[0004] However, the inventors discovered in practice that the aforementioned existing technologies still have a deep-seated problem that urgently needs to be solved. Insurance products are characterized by rapid updates and numerous versions; the same insurance product may have versions from multiple years (e.g., "XX Fortune 2022 Edition" and "XX Fortune 2023 Edition"), and there may be significant differences between different versions in key details such as insurance liability, exclusions, and waiting periods. Existing retrieval-enhanced generation methods mainly rely on semantic similarity for retrieval. When the user's question is ambiguous and does not explicitly specify the product version, the system may simultaneously retrieve semantically similar clause fragments belonging to different versions from the knowledge base. For example, the system might provide the waiting period clause of the 2022 version and the sum assured clause of the 2023 version as relevant context to the large language model, causing the model to stitch together the clause content from different versions when generating the answer, ultimately outputting incorrect policy information that does not exist in reality, resulting in low accuracy of intelligent question answering for insurance products. Summary of the Invention

[0005] This application provides an intelligent question answering method and system based on large models and retrieval enhancement, which improves the accuracy of intelligent question answering.

[0006] The first aspect of this application provides an intelligent question answering method based on a large model and retrieval enhancement. The method includes: receiving a user's query request; performing a preliminary retrieval of a preset knowledge base based on the query request to obtain document fragments related to the query request, the document fragments containing a product identifier and a version identifier of an insurance product; for any given product identifier, determining at least one corresponding target version identifier and constructing a candidate version set; performing query intent analysis on the text content of the query request to determine whether the query request belongs to a cross-version query type; if it is determined that the query request does not belong to the cross-version query type, calculating a version consistency score for each version in the candidate version set, and selecting a version from the candidate version set based on the version consistency score. The target version with the highest score is determined, and the version consistency score is composed of a semantic relevance aggregate score and a time factor weighting. The target document fragment corresponding to the target version is obtained, and the query request is vectorized to generate a question vector. Based on the question vector, a vector retrieval is performed in a preset vector knowledge base to obtain the question vector result. A secondary retrieval is then performed in the preset knowledge base based on the target version to obtain the document retrieval result. The question vector result and the document retrieval result are merged to obtain initial candidate documents. The query request, the initial candidate documents, and preset prompt words are combined to generate a first final prompt word, which is then input into the preset large language model to obtain the first target answer for the query request.

[0007] By adopting the above technical solution, user query requests are received, and a preliminary search is performed on the preset knowledge base to obtain document fragments related to the query request. These document fragments contain product and version identifiers, enabling rapid location of insurance product information relevant to the user's query. For any product identifier, the corresponding target version identifier is determined, and a candidate version set is constructed, allowing for comprehensive collection of insurance product information from different versions related to the query. Intent analysis of the query request determines whether it is a cross-version query, thus determining the subsequent processing strategy. If it is not a cross-version query, a version consistency score is calculated for each version in the candidate version set. This score comprehensively considers semantic relevance and time factors, allowing the selection of the most relevant and up-to-date target version from the candidate versions. The target document fragment corresponding to the target version is obtained, and the query request is vectorized. Searching in the vector knowledge base and the preset knowledge base yields question vector results and document retrieval results, expanding the knowledge information related to the query from different perspectives. This method merges question vector results and document retrieval results into initial candidate documents, combines them with the query request and preset prompts to generate final prompts, and inputs these prompts into a preset large language model to obtain the target answer. This combination of knowledge base retrieval and large language model generation yields richer, higher-quality question-and-answer results, improving the overall effectiveness of intelligent question answering. By introducing product and version identifiers and combining user query intent analysis with version consistency score calculation, this method achieves precise screening of insurance product versions, avoiding errors caused by mixing different version clauses. Simultaneously, by weighting semantic relevance and time factors, it improves the adaptability of search results to the latest version and user intent. The combination of vector retrieval and secondary knowledge base retrieval ensures full utilization of multi-dimensional information. Finally, the combination of large language model generation enhances the system's ability to handle complex questions. The technical effects are a significant improvement in the accuracy, consistency, and relevance of question answering, optimized user experience, and adaptation to the rapid iteration characteristics of insurance products.

[0008] Optionally, after performing query intent analysis on the text content of the query request to determine whether the query request belongs to a cross-version query type, the method further includes: if it is determined that the query request belongs to a cross-version query type, then based on preset version query rules, selecting a baseline version and a comparison version from the candidate version set; for the baseline version, based on the query request, performing a first targeted search in the preset knowledge base to obtain baseline document content related to the query request; for the comparison version, based on the query request, performing a second targeted search in the preset knowledge base to obtain comparison document content related to the query request; constructing a structured differential knowledge context, the differential knowledge context including the baseline document content and the comparison document content; combining the query request, the differential knowledge context, and the preset prompt words to generate a second final prompt word, and inputting the second final prompt word into the preset large language model to generate a second target answer for the query request.

[0009] By adopting the above technical solution, when the query request is a cross-version query, based on preset version query rules, a baseline version and a comparison version are selected from the candidate version set, thus identifying two key versions for cross-version comparison analysis. For the baseline and comparison versions, two targeted searches are performed in the preset knowledge base based on the query request, obtaining the baseline and comparison document content related to the query request. This achieves precise location and extraction of the content of insurance product terms from different versions. Based on this, a structured differential knowledge context is constructed, containing the baseline and comparison document content, providing a structured and easily processed data foundation for subsequent version difference comparison analysis. The query request, differential knowledge context, and preset prompt words are combined to generate a second final prompt word, which is then input into a preset large language model to obtain the second target answer. This fully utilizes the difference information, generating a high-quality answer that highlights version changes and explains the differences through the large language model, better meeting the user's needs for cross-version comparison queries.

[0010] Optionally, calculating the version consistency score for each version in the candidate version set specifically includes: for each version in the candidate version set, traversing the document fragments, identifying all target fragments corresponding to the version, and forming a target fragment subset; extracting the semantic relevance score obtained by each target fragment in the preliminary retrieval from the target fragment subset, and performing an aggregation operation based on the semantic relevance score to obtain a semantic relevance aggregation score corresponding to each version; determining the generation time of each version identifier according to a preset version identifier naming rule and a preset business release time rule, and determining the corresponding time factor based on the generation time; for each version in the candidate version set, multiplying the semantic relevance aggregation score by the time factor to obtain the version consistency score.

[0011] By employing the above technical solution, for each version in the candidate version set, by traversing document fragments, all target fragments corresponding to the version are identified and formed into a target fragment subset, comprehensively collecting relevant information fragments for each version. The semantic relevance score of each target fragment in the target fragment subset, obtained in the initial retrieval, is extracted, and aggregation is performed based on the semantic relevance score to obtain the semantic relevance aggregation score for each version, which can comprehensively evaluate the overall relevance of each version to the query request. According to preset version identifier naming rules and preset business release time rules, the generation time of each version identifier is determined, and the corresponding time factor is determined based on the generation time, which can objectively measure the timeliness of each version. Multiplying the semantic relevance aggregation score by the time factor yields the version consistency score, which can simultaneously consider version relevance and timeliness to select the optimal target version. By comprehensively considering multiple dimensions such as semantic relevance and time factor to calculate the version consistency score, the accuracy and rationality of target version selection can be improved, thereby providing a higher quality and more user-relevant knowledge source for subsequent question answering.

[0012] Optionally, the step of performing vector retrieval in a preset vector knowledge base based on the question vector to obtain the question vector result specifically includes: calculating the cosine similarity between each knowledge vector in the preset vector knowledge base and the question vector; sorting the knowledge vectors in the preset vector knowledge base in descending order according to the cosine similarity; selecting a preset number of target knowledge vectors from the sorting results, and using the knowledge fragments corresponding to the target knowledge vectors as candidate knowledge fragments; calculating the semantic relevance score between each candidate knowledge fragment and the query request, wherein the semantic relevance score is calculated by the following formula: score=α*si m(q, s) + β*cov(q, s); where s represents the candidate knowledge fragment, q represents the query request, score represents the semantic relevance score between the candidate knowledge fragment and the query request, sim(q, s) represents the cosine similarity between the candidate knowledge fragment and the query request, cov(q, s) represents the proportion of keywords in the query request covered by the candidate knowledge fragment, and α and β are preset weight parameters that satisfy α + β = 1; the candidate knowledge fragments are sorted in descending order according to the semantic relevance score, and the candidate knowledge fragment with the highest semantic relevance score is selected as the question vector result.

[0013] By employing the above technical solution, vector retrieval is performed in a pre-defined vector knowledge base based on the question vector. The cosine similarity between each knowledge vector and the question vector in the pre-defined vector knowledge base is calculated. The knowledge vectors are then sorted in descending order based on the cosine similarity, quickly identifying a batch of knowledge vectors most similar to the question vector. A predetermined number of target knowledge vectors are selected from the sorted results, and the corresponding knowledge fragments are used as candidate knowledge fragments, obtaining a preliminary set of knowledge fragments highly relevant to the query request. Further, the semantic relevance score of each candidate knowledge fragment to the query request is calculated. The score is obtained by weighted summing the cosine similarity between the candidate knowledge fragment and the query request and the proportion of the query request keywords covered by the candidate knowledge fragments, allowing for a more comprehensive evaluation of the relevance between the candidate knowledge fragments and the query request. The candidate knowledge fragments are then sorted in descending order based on the semantic relevance score, and the candidate knowledge fragment with the highest score is selected as the question vector result, allowing for the selection of the most relevant fragments from the preliminary selection. By combining vector retrieval and semantic relevance calculation, highly relevant knowledge fragments can be quickly and accurately matched from a massive knowledge base, providing a high-quality knowledge source for subsequent question answering.

[0014] Optionally, the step of performing a secondary search in the preset knowledge base based on the target version to obtain document search results specifically includes: obtaining key attribute information corresponding to the target version, the key attribute information including the underwriting conditions, exclusions, cooling-off period, and waiting period of the insurance product; constructing a structured search statement based on the key attribute information, and using the structured search statement to search in the preset knowledge base to obtain preliminary document search results; ranking the preliminary document search results by relevance, and selecting a preset number of documents as the document search results based on the ranking score.

[0015] By employing the aforementioned technical solution, key attribute information corresponding to the target version is obtained, including the insurance product's underwriting conditions, exclusions, cooling-off period, and waiting period. This clarifies the key attributes that subsequent secondary searches should focus on. Based on this key attribute information, a structured search statement is constructed and used to search a pre-defined knowledge base, yielding preliminary document search results. This allows for further focused key attribute-based, more refined document matching, improving the targeting and effectiveness of secondary searches. The preliminary document search results are then ranked by relevance, and a predetermined number of documents are selected as the final search results based on the ranking scores. This allows for the selection of the most relevant and high-quality documents from the initially matched documents. Through structured retrieval based on key attributes and relevance ranking, the structured information of insurance products can be fully utilized, improving the accuracy of document matching and providing highly relevant and focused knowledge materials for subsequent question-and-answer sessions, further enhancing the quality of question-and-answer responses.

[0016] Optionally, after inputting the second final prompt word into the preset large language model to generate a second target answer for the query request, the method further includes: extracting key entities related to the insurance product from the first target answer or the second target answer; performing structured query verification on each key entity and its corresponding entity value in the initial candidate document on which the first target answer is based or the differential knowledge context on which the second target answer is based; if the structured query verification fails, correcting the error values ​​of the key entities in the first target answer based on the initial candidate document, or correcting the error values ​​of the key entities in the second target answer based on the differential knowledge context.

[0017] By employing the above technical solution, after obtaining the first or second target answer, key entities related to the insurance product can be extracted from the target answer, identifying the core information elements in the answer. For each key entity and its corresponding entity value, a structured query verification is performed in the initial candidate document or differential knowledge context upon which the target answer is generated. By comparing the answer information with the original knowledge material, errors or inconsistencies in the answer can be discovered. If the query verification fails, it indicates that there are errors in the key entities in the answer, requiring correction. Correcting error values ​​of key entities in the target answer based on the initial candidate document or differential knowledge context allows for the replacement or correction of erroneous entity values ​​in the answer by referring to accurate information in the original knowledge material, thereby improving the accuracy and reliability of the answer. Through key entity extraction and query verification, errors in the answer can be automatically identified, and targeted corrections can be made using original knowledge, forming a closed loop from generation to verification. This effectively improves the accuracy of the answers generated by the question-answering system and reduces the spread of erroneous information.

[0018] Optionally, for each key entity and its corresponding entity value, structured query verification is performed in the initial candidate document on which the first target answer is based or the differential knowledge context on which the second target answer is based. Specifically, this includes: converting the initial candidate document or the differential knowledge context into a structured triplet form to construct a knowledge verification database; constructing a structured query statement based on each key entity and its corresponding entity value; executing the structured query statement in the knowledge verification database to obtain query results; if the query result is empty, the structured query verification fails; if the query result is not empty, it is determined whether the actual entity value in the query result is consistent with the entity value of the key entity; if the actual entity value in the query result is consistent with the entity value of the key entity, the structured query verification passes; if the actual entity value in the query result is inconsistent with the entity value of the key entity, the structured query verification fails.

[0019] By employing the aforementioned technical solution, initial candidate documents or differential knowledge contexts are transformed into structured triples, and a knowledge verification database is constructed. This transforms unstructured text materials into a structured form that facilitates querying and comparison. Based on each key entity and its corresponding entity value, structured query statements are constructed, enabling precise matching queries for specific entity attribute values. Executing the structured query statements in the knowledge verification database yields query results. These results determine whether the entity values ​​in the answer exist in the original knowledge material and whether they are consistent. If the query result is empty, it indicates that the entity in the answer does not exist in the original material, and the query verification fails. If the query result is not empty, the actual entity values ​​in the query result are compared with the entity values ​​in the answer. If they match, the query verification passes; otherwise, it fails. By structuring the original knowledge material into triples and constructing structured query statements, efficient and accurate verification of answer information can be achieved, automatically identifying entity errors in the answer, providing a reliable basis for subsequent error correction, and improving the self-verification and error correction capabilities of the question-answering system.

[0020] Secondly, embodiments of this application provide an intelligent question-answering system based on a large model and retrieval enhancement. The intelligent question-answering system based on a large model and retrieval enhancement includes: one or more processors and a memory; the memory is coupled to the one or more processors and is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the intelligent question-answering system based on a large model and retrieval enhancement to perform the methods described in the first aspect and any possible implementation thereof.

[0021] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a large-model-based and retrieval-enhanced intelligent question-answering system, cause the large-model-based and retrieval-enhanced intelligent question-answering system to perform the method described in the first aspect and any possible implementation thereof.

[0022] Fourthly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a large model-based and retrieval-enhanced intelligent question-answering system, cause the large model-based and retrieval-enhanced intelligent question-answering system to perform the method described in the first aspect and any possible implementation thereof.

[0023] In summary, one or more technical solutions provided in this application have at least the following technical effects or advantages:

[0024] 1. By introducing product and version identifiers, and combining user query intent analysis with version consistency score calculation, precise filtering of insurance product versions is achieved, avoiding incorrect answers caused by mixing different version terms. Simultaneously, semantic relevance and time factor weighting improve the adaptability of search results to the latest version and user intent. The combination of vector retrieval and secondary knowledge base retrieval ensures full utilization of multi-dimensional information. Finally, combining a large language model to generate answers enhances the system's ability to handle complex problems. The technical effects are a significant improvement in the accuracy, consistency, and relevance of question answering, optimized user experience, and adaptation to the rapid iteration characteristics of insurance products. Attached Figure Description

[0025] Figure 1 This is a flowchart illustrating an intelligent question-answering method based on a large model and retrieval enhancement disclosed in an embodiment of this application;

[0026] Figure 2 This is another flowchart illustrating an intelligent question-answering method based on a large model and retrieval enhancement disclosed in an embodiment of this application;

[0027] Figure 3 This is a schematic diagram of the structure of a system provided in an embodiment of this application.

[0028] Explanation of reference numerals in the attached drawings: 301, Central Processing Unit; 302, Read-Only Memory; 303, Random Access Memory; 304, Bus; 305, Input / Output Interface; 306, Input Section; 307, Output Section; 308, Storage Section; 309, Communication Section; 310, Driver; 311, Removable Media. Detailed Implementation

[0029] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0030] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.

[0031] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple systems means two or more systems, and multiple screen terminals means two or more screen terminals. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0032] This application provides an intelligent question answering method based on large models and retrieval enhancement, referring to... Figure 1 , Figure 1 This is a flowchart illustrating a method provided in an embodiment of this application. The method is applied to a system that can execute an intelligent question-answering program based on a large model and enhanced retrieval. The method includes steps S101 to S108, as follows:

[0033] Step S101: Receive the user's query request, perform a preliminary search on the preset knowledge base based on the query request, and obtain document fragments related to the query request. The document fragments contain the product identifier and version identifier of the insurance product.

[0034] In step S101, a query request represents a text question entered by the user to obtain information, such as "What is the waiting period for a certain insurance policy?" The pre-built knowledge base refers to a pre-constructed database storing a large amount of structured and unstructured information about insurance products, including insurance terms, product descriptions, and rate tables. Preliminary retrieval refers to using a basic search technique, such as keyword matching or text matching algorithms, to perform a broad initial search within the pre-built knowledge base. Document fragments refer to small chunks of text content segmented from the original documents in the knowledge base; these fragments are considered relevant to the query request during the preliminary retrieval. A product identifier is a name or code used to uniquely identify an insurance product series, such as "Ping An Fu Whole Life Insurance." A version identifier is an identifier used to distinguish different versions of the same product series released at different times, such as "2023 version" or "Upgrade II."

[0035] Specifically, when the system receives a query request from a user, it first invokes a preliminary retrieval module. This module is typically based on full-text search engine technology, such as Elasticsearch or the BM25 algorithm. The system takes the user's query text as input and performs a search in a pre-defined knowledge base. Each document in the pre-defined knowledge base has been pre-processed and associated with metadata, which includes at least the product identifier and version identifier of the insurance product to which the document belongs. The goal of the preliminary retrieval is to quickly recall all potentially relevant document fragments, without excessively pursuing precision. Therefore, the system returns a list containing multiple document fragments, each with its original product identifier and version identifier; these document fragments collectively form the basis for subsequent processing.

[0036] Step S102: For any product identifier, determine at least one corresponding target version identifier and construct a candidate version set.

[0037] In step S102, the target version identifier refers to all known versions associated with a product identifier initially retrieved. The candidate version set refers to a set formed by aggregating all target version identifiers corresponding to one or more product identifiers; this set represents all product versions that may be involved in this query.

[0038] Specifically, the system analyzes the list of document fragments generated in step S101. It iterates through this list, extracting all unique product identifiers. For example, if the initial search results contain information on both "Ping An Fu Whole Life Insurance" and "Chang Xiang An Endowment Insurance," the system will identify these two product identifiers. Subsequently, for each identified product identifier, the system queries a pre-defined product version management table or metadata database to find all version identifiers that the product has historically released. For example, for "Ping An Fu Whole Life Insurance," the system might find three versions: "2022 Version," "2023 Version," and "2024 Version." The system aggregates all the found version identifiers to construct a set of unique candidate versions, preparing for subsequent version selection.

[0039] Step S103: Analyze the query intent of the text content of the query request to determine whether the query request belongs to the cross-version query type.

[0040] In step S103, query intent analysis refers to analyzing the text content of the user's query request using natural language processing technology to understand the user's true purpose in asking the question. Cross-version query type is a specific query intent; it specifically refers to a user's desire to compare the differences between different versions of the same product, or to query information involving multiple versions.

[0041] Specifically, the system will activate a query intent analysis module. This module has a built-in set of rules or a classification model to determine whether a query request belongs to the cross-version query type. One implementation is based on keyword matching. The system maintains a cross-version query keyword dictionary, which contains words or phrases such as "difference," "different," "comparison," "compared to," "which is better," and "upgrade from version A to version B." The system will check whether the user's query request contains these keywords. If a match is found, the system will mark the query request as a cross-version query; otherwise, it will be marked as a non-cross-version query. This determination will directly determine the direction of subsequent processes.

[0042] In one possible implementation, after performing query intent analysis on the text content of the query request to determine whether the query request belongs to the cross-version query type, the method further includes steps S1031-S1035, as follows:

[0043] Step S1031: If it is determined that the query request belongs to the cross-version query type, then based on the preset version query rules, the baseline version and the comparison version are selected from the candidate version set.

[0044] In step S1031, the preset version query rule refers to a predefined set of logic or conditions used to automatically identify multiple product versions to be compared from the user's query text and candidate version set. For example, the rule can be set such that if the user's query explicitly mentions two versions, they are selected as the baseline version and the comparison version, respectively; if only one version is mentioned and phrases such as "compared to the old version" are used, the mentioned version is compared with the version that comes first in time. The baseline version refers to the product version used as the reference standard when performing cross-version comparisons; it is usually the version that the user is more concerned about or that is newer. The comparison version refers to the product version compared with the baseline version when performing cross-version comparisons.

[0045] Specifically, this step is activated after the system determines in step S103 that the user's query request belongs to the cross-version query type. The system will call a version parsing module, which processes the user's query text according to preset version query rules. For example, if the user's query is "What are the differences between the 2024 and 2023 versions of Ping An Fu?", the rules will directly extract "2024 version" and "2023 version" from the text. The system may set the more recent "2024 version" as the base version and "2023 version" as the comparison version. If the user's query is "What improvements does the latest version of Ping An Fu have over the old version?", the rules will first determine from the candidate version set that the "latest version" is "2024 version" and set it as the base version, and then determine that its immediately preceding version, "2023 version", is the comparison version. The final output of this step is two clear version identifiers, namely the base version and the comparison version.

[0046] Step S1032: For the baseline version, based on the query request, perform the first targeted search in the preset knowledge base to obtain the baseline document content related to the query request.

[0047] In step S1032, the first targeted retrieval refers to a highly focused search operation. It limits the scope to a baseline version and uses the user's original query request as its core content to precisely search for information in a preset knowledge base. The baseline document content refers to document information found through the first targeted retrieval that is relevant to the query request and fully falls within the scope of the baseline version product.

[0048] Specifically, the system utilizes the baseline version identifier determined in the previous step, such as "2024 version," and the core keywords in the user's original query request, such as "minor illness compensation," to construct a precise search query. This query is no longer a broad keyword search, but a structured query with strict filtering conditions. It can be described as searching for content related to "minor illness compensation" within the scope of documents identified as "Ping An Fu" with the version identifier "2024 version." The system executes this query in a preset knowledge base and returns the retrieved documents or excerpts describing the minor illness compensation terms of "Ping An Fu 2024 version" as the baseline document content.

[0049] Step S1033: For the comparison version, based on the query request, a second targeted search is performed in the preset knowledge base to obtain the comparison document content related to the query request.

[0050] In step S1033, the second targeted search follows the same principle as the first targeted search, but its target is the comparison version. It is an operation that uses the comparison version as the scope and the user's original query request as the core content to accurately search for information in a preset knowledge base. The comparison document content refers to the document information found through the second targeted search that is relevant to the query request and completely falls within the scope of the comparison version product.

[0051] Specifically, the system will repeat a similar operation to step S1032, but this time using a comparison version identifier, such as "2023 version". The system constructs and executes a new structured query, which can be expressed as searching for content related to "minor illness compensation" within the scope of documents with the product identifier "Ping An Fu" and the version identifier "2023 version". After executing this query, the system returns the retrieved documents or excerpts describing the minor illness compensation terms of "Ping An Fu 2023 version" as comparison document content.

[0052] Step S1034: Construct a structured differential knowledge context, which includes the content of the benchmark document and the content of the comparison document.

[0053] In step S1034, the structured differential knowledge context refers to a specially organized and arranged collection of text. It is not simply a merging of information, but rather a presentation of the benchmark document content and the comparison document content side by side in a clear and organized structure to facilitate subsequent model comparison and analysis. For example, a text block can be constructed containing two clearly defined parts: "benchmark version information" and "comparison version information," with the corresponding version of the document content placed under each part.

[0054] Specifically, after the system obtains the baseline document content generated in step S1032 and the comparison document content generated in step S1033, it activates a context building module. This module uses a preset structured template to organize this information. For example, the template might define the following format: "Information about the baseline version [baseline version identifier here] is as follows: [baseline document content here]. Information about the comparison version [comparison version identifier here] is as follows: [comparison document content here]." The system fills the corresponding content into the template, generating a clearly structured text that explicitly marks the source version of the information. This text is the structured differential knowledge context, which provides the necessary prerequisite for the large language model to accurately perform difference comparisons.

[0055] Step S1035: Combine the query request, differential knowledge context, and preset prompt words to generate a second final prompt word, and input the second final prompt word into the preset large language model to generate a second target answer for the query request.

[0056] In step S1035, the second final prompt word refers to the complete instruction text input to the preset large language model, which is specifically constructed for handling cross-version queries. It integrates the user's comparative query request, structured differential knowledge context, and preset instructions. The second target answer refers to the final response generated by the preset large language model after receiving and processing the second final prompt word, specifically addressing the user's cross-version comparison question.

[0057] Specifically, the system uses a prompt template designed specifically for comparison tasks. This template typically includes a role setting and task instructions, such as "You are a professional insurance product comparison analyst. Based on the information provided below for the two products, clearly compare their specific differences in the questions raised by the user." Then, the system fills the corresponding positions in the template with the structured differential knowledge context generated in step S1034 and the user's original query request, combining them into the second final prompt. Subsequently, the system sends this complete prompt to the preset large language model. Upon receiving the instruction, the preset large language model reads and understands both versions of information and, according to the task requirements of "comparative analysis," generates a well-organized text summarizing the differences between the two. This text is the second target answer, ultimately presented to the user.

[0058] Step S104: If it is determined that the query request does not belong to the cross-version query type, calculate the version consistency score for each version in the candidate version set, and determine the target version with the highest score from the candidate version set based on the version consistency score. The version consistency score is composed of the semantic relevance aggregation score and the time factor weighting.

[0059] In step S104, the version consistency score is a comprehensive score used to measure the degree of match between each version in the candidate version set and the user's query request. The target version refers to the version with the highest version consistency score among all candidate versions, which is considered to be the version the user is most likely to want to query. The semantic relevance aggregation score is the score obtained by summing and calculating the semantic relevance scores of all document fragments corresponding to a version. The time factor is a weighted value assigned according to the release time of the versions; generally, newer versions will have a higher time factor.

[0060] Specifically, this step is triggered when the system determines in step S103 that the query request does not belong to the cross-version query type. The system iterates through each version in the candidate version set. For a specific version, such as "2024 version", the system first filters out a subset of fragments with the version identifier "2024 version" from all document fragments obtained in step S101. Then, the system extracts the semantic relevance scores obtained by these fragments during the initial retrieval and calculates the semantic relevance aggregate score of the version using an aggregation function, such as summation, averaging, or maximization. At the same time, the system determines a time factor for "2024 version" according to preset rules, for example, the latest version factor is 1.0, the second newest version is 0.9, and so on. Finally, the system multiplies the semantic relevance aggregate score of the version by the time factor to obtain the final version consistency score. The system repeats this process for all versions in the candidate version set and selects the version with the highest score as the unique target version.

[0061] In one possible implementation, a version consistency score is calculated for each version in the candidate version set, specifically including steps S1041-S1044, as follows:

[0062] Step S1041: For each version in the candidate version set, traverse the document fragments, identify all target fragments corresponding to the version, and form a subset of target fragments.

[0063] In step S1041, a target fragment refers to those document fragments among all the document fragments initially retrieved whose metadata or content explicitly identifies them as belonging to the specific version currently being processed. A subset of target fragments refers to the collection formed by grouping together all target fragments belonging to the same specific version. For example, if the currently processed version is "2024 version", then all document fragments retrieved from the knowledge base and marked as "2024 version" constitute the subset of target fragments for that version.

[0064] Specifically, the system first retrieves a version from the candidate version set, such as "Ping An Fu 2024 Edition". Then, the system iterates through the set of all document fragments obtained in the initial retrieval step. For each document fragment, the system checks its accompanying metadata, which contains the product version identifier to which the fragment belongs. If the version identifier in the metadata of a document fragment matches the currently processed version "Ping An Fu 2024 Edition", then the fragment is identified as a target fragment. The system collects all such identified target fragments, forming a subset of target fragments specifically for "Ping An Fu 2024 Edition". The system repeats this process for each version in the candidate version set, ultimately generating a corresponding subset of target fragments for each version.

[0065] Step S1042: Extract the semantic relevance score of each target fragment obtained in the preliminary retrieval from the target fragment subset, and perform aggregation operation based on the semantic relevance score to obtain the semantic relevance aggregate score corresponding to each version.

[0066] In step S1042, the semantic relevance score refers to a numerical value obtained in the initial retrieval stage through methods such as vector similarity calculation, which measures the semantic closeness between the content of each document fragment and the user's query request. Aggregation operation refers to a mathematical operation that combines multiple numerical values ​​into a representative value, such as calculating the average, summing, or taking the maximum value. The semantic relevance aggregation score is a single score obtained after aggregating the semantic relevance scores of all fragments in a subset of target fragments for a particular version. This score represents the overall relevance strength between the content of this version and the user's query request.

[0067] Specifically, after completing step S1041, the system processes the target fragment subset for each version. Taking the target fragment subset of "Ping An Fu 2024 Edition" as an example, this subset may contain three target fragments, whose semantic relevance scores obtained in the initial retrieval are 0.9, 0.85, and 0.92, respectively. The system processes these scores according to preset aggregation operation rules, such as averaging. The system adds these three scores and divides them by three, obtaining 0.89. This value of 0.89 is the semantic relevance aggregation score corresponding to the version "Ping An Fu 2024 Edition". The system performs the same calculation for each other version in the candidate version set, thereby obtaining a semantic relevance aggregation score for each version.

[0068] Step S1043: Determine the generation time of each version identifier according to the preset version identifier naming rules and the preset business release time rules, and determine the corresponding time factor based on the generation time.

[0069] In step S1043, the preset version identifier naming rule refers to a set of rules used to parse version names to extract time information. For example, the rule can be defined as the last four digits of the version name representing the year. The preset business release time rule refers to a lookup table or logic that records the precise release date of each product version, used to handle non-standardized version naming. The generation time refers to the specific release date or year of each product version determined by the above rules. The time factor is a weighted value calculated based on the generation time. Its design purpose is to give newer versions higher weight; generally, the later the generation time, the larger the value of the time factor.

[0070] Specifically, the system processes each version identifier in the candidate version set. For example, for the version identifier "Ping An Fu 2024", the system applies a preset version identifier naming rule to extract the year "2024" as its generation time representative. For another version identifier, "Ping An Fu New Year Edition", the system may query a preset business release time rule table to find its corresponding generation time as "December 2023". After determining the generation time of each version, the system uses a preset function to calculate the time factor. For example, a simple linear function can be set such that the time factor equals the generation year minus a base year. If the base year is 2020, then the time factor for version "2024" is 4, and the time factor for version "2023" is 3. The output of this step is to calculate a corresponding time factor for each version.

[0071] Step S1044: For each version in the candidate version set, multiply the semantic relevance aggregate score by the time factor to obtain the version consistency score.

[0072] In step S1044, the version consistency score is a comprehensive score that combines the semantic relevance of the version content to the query and the newness of the version release, and is used to ultimately determine which version is the best choice to answer the user's current query.

[0073] Specifically, for each version in the candidate version set, the system extracts its semantic relevance aggregation score calculated in step S1042 and its time factor calculated in step S1043. Then, the system multiplies these two values. For example, for "Ping An Fu 2024 Edition," its semantic relevance aggregation score is 0.89 and its time factor is 4, so its version consistency score is 0.89 multiplied by 4, resulting in 3.56. For "Ping An Fu 2023 Edition," assuming its semantic relevance aggregation score is 0.91 and its time factor is 3, its version consistency score is 0.91 multiplied by 3, resulting in 2.73. After performing this calculation for all versions in the candidate version set, the system obtains the final version consistency score for each version. These scores will be used in subsequent steps to sort and select versions.

[0074] Step S105: Obtain the target document fragment corresponding to the target version, and perform vectorization processing on the query request to generate a question vector.

[0075] In step S105, the target document fragment refers to those fragments whose version identifiers match the target version determined in the previous step, selected from all the initially retrieved document fragments. Vectorization processing refers to using a deep learning model to convert the text-based query request into a high-dimensional mathematical vector that can represent its semantic information. The question vector is the mathematical vector generated after vectorization processing.

[0076] Specifically, the system first performs a filtering operation. It takes the target version identifier determined in step S104, such as "2024 version," and filters the list of original document fragments produced in step S101, retaining only those document fragments with the version identifier "2024 version." These retained fragments constitute the target document fragments. Simultaneously, the system inputs the user's original query request text into a pre-trained text embedding model, such as BERT, Sentence-BERT, or other similar neural network models. This model performs a series of complex calculations, ultimately outputting a fixed-length floating-point array, i.e., the question vector. The position and orientation of this vector in multi-dimensional space capture the core semantics of the query request.

[0077] Step S106: Based on the question vector, perform vector retrieval in the preset vector knowledge base to obtain the question vector results, and based on the target version, perform a secondary retrieval in the preset knowledge base to obtain the document retrieval results.

[0078] In step S106, the preset vector knowledge base is a database that stores knowledge fragments and their corresponding vectors, supporting efficient similarity search. Vector retrieval refers to the process of using question vectors to find the semantically closest knowledge fragments in this vector knowledge base. The question vector result is the set of most relevant knowledge fragments obtained from the vector retrieval process. Secondary retrieval refers to a second, more targeted search conducted in the preset knowledge base after the target version has been determined. The document retrieval result is the document content related to the key attributes of the insurance product obtained from the secondary retrieval process.

[0079] Specifically, the system uses the question vector generated in step S105 as a query probe to perform an approximate nearest neighbor search in a preset vector knowledge base. This search calculates the cosine similarity or Euclidean distance between the question vector and all knowledge vectors in the database, and returns the knowledge fragments corresponding to the top K knowledge vectors with the highest similarity. These fragments together constitute the question vector result. Simultaneously, the system performs another retrieval, namely a secondary retrieval. Based on the target version, the system constructs a structured query statement designed to accurately find key attribute information of that version of the product, such as coverage conditions, exclusions, cooling-off period, and waiting period. This structured query is executed in the preset knowledge base (usually a text database that supports structured queries), and the returned results are sorted and filtered to form the document retrieval results.

[0080] In one possible implementation, based on the question vector, a vector retrieval is performed in a preset vector knowledge base to obtain the question vector result, specifically including steps S1061-S1065, as follows:

[0081] Step S1061: Calculate the cosine similarity between each knowledge vector and the question vector in the preset vector knowledge base.

[0082] In step S1061, the preset vector knowledge base refers to a pre-constructed dataset that stores a large number of knowledge fragments and their corresponding numerical representations, i.e., knowledge vectors. A knowledge vector is generated by using a deep learning model, such as BERT or a similar text embedding model, to convert textual knowledge fragments into a vector in a high-dimensional space. This vector captures the semantic information of the text. The question vector is generated by converting the user-input query request text into a semantic vector using the same method as generating the knowledge vector. Cosine similarity is a mathematical method that measures the directional similarity between two vectors. Its result ranges from -1 to 1; the closer the value is to 1, the more semantically similar the texts represented by the two vectors are.

[0083] Specifically, the system first obtains the question vector generated in the previous steps. Then, the system iterates through each knowledge vector in the preset vector knowledge base. For each knowledge vector, the system performs a cosine similarity calculation, with the input being the currently traversed knowledge vector and the aforementioned question vector. Through this calculation, the system obtains a cosine similarity score for each knowledge vector in the knowledge base. This score quantitatively describes the semantic relevance of each knowledge fragment to the user's query request.

[0084] Step S1062: Sort the knowledge vectors in the preset vector knowledge base in descending order according to the cosine similarity.

[0085] In step S1062, descending sorting refers to arranging a series of items from largest to smallest according to a certain numerical attribute. In this step, the sorting is based on the cosine similarity score calculated in step S1061.

[0086] Specifically, the system compiles all knowledge vectors obtained in step S1061 and their corresponding cosine similarity scores into a list. Then, the system sorts this list according to the cosine similarity scores, placing the knowledge vector with the highest score at the top, the next highest at the bottom, and so on, until the lowest score is placed at the end. After this step, the system obtains an ordered list of knowledge vectors, where the knowledge fragments corresponding to the earlier vectors are semantically closer to the user's question.

[0087] Step S1063: In the sorting results, select a preset number of target knowledge vectors, and use the knowledge fragments corresponding to the target knowledge vectors as candidate knowledge fragments.

[0088] In step S1063, the preset quantity is a pre-configured integer value, such as 10 or 20, used to select the most relevant portion from the sorted results as an initial candidate set to balance computational efficiency and retrieval comprehensiveness. The target knowledge vector refers to the knowledge vectors at the top of the sorted results, determined by the preset quantity. A knowledge fragment refers to the original text content corresponding one-to-one with a knowledge vector, serving as the actual carrier of knowledge. Candidate knowledge fragments refer to the set of original knowledge fragments corresponding to all target knowledge vectors.

[0089] Specifically, the system reads this preset quantity value, let's say 10. Then, the system selects the top 10 knowledge vectors from the descending-ordered knowledge vector list generated in step S1062; these vectors are then identified as target knowledge vectors. Next, the system searches for and extracts their corresponding original text, or knowledge fragments, from the original knowledge base based on the identifiers of these target knowledge vectors. These 10 extracted knowledge fragments together form a candidate knowledge fragment set for further refined filtering in subsequent steps.

[0090] Step S1064: Calculate the semantic relevance score between each candidate knowledge fragment and the query request. The semantic relevance score is calculated by the following formula: score = α * sim(q, s) + β * cov(q, s); where s represents the candidate knowledge fragment, q represents the query request, score represents the semantic relevance score between the candidate knowledge fragment and the query request, sim(q, s) represents the cosine similarity between the candidate knowledge fragment and the query request, cov(q, s) represents the proportion of keywords in the query request covered by the candidate knowledge fragment, and α and β are preset weight parameters that satisfy α + β = 1.

[0091] In step S1064, the semantic relevance score is a comprehensive indicator used to more accurately evaluate the matching degree between candidate knowledge fragments and user query requests. This score is calculated using the following formula: score equals α multiplied by sim(q, s) plus β multiplied by cov(q, s). In this formula, s represents the candidate knowledge fragment, q represents the query request, score represents the semantic relevance score between the candidate knowledge fragment and the query request, sim(q, s) represents the cosine similarity between the vector of the candidate knowledge fragment and the vector of the query request, representing the macroscopic semantic matching degree, and cov(q, s) represents the proportion of keywords in the query request covered by the candidate knowledge fragment, representing the microscopic, literal matching degree. α and β are preset weight parameters that satisfy the condition that the sum of α and β is one, used to adjust the relative importance of semantic similarity and keyword coverage in the final score calculation.

[0092] Specifically, the system performs the following operations for each candidate knowledge fragment. First, the system extracts keywords from the user's original query request, for example, through word segmentation and stop word removal. For a candidate knowledge fragment s, the system calculates how many of the keywords in the query request q appear in the text of s, and then divides this number of occurrences by the total number of keywords to obtain the keyword coverage ratio cov(q, s). Simultaneously, the system obtains the cosine similarity sim(q, s) of the candidate knowledge fragment s, which was calculated in step S1061. Then, the system substitutes the preset weight parameters α and β and calculates the final semantic relevance score of the candidate knowledge fragment using the aforementioned formula. This process is repeated for all candidate knowledge fragments.

[0093] Step S1065: Sort the candidate knowledge fragments in descending order according to their semantic relevance scores, and select the candidate knowledge fragment with the highest semantic relevance score as the question vector result.

[0094] In step S1065, the question vector result refers to the knowledge fragment that is ultimately determined to be most relevant to the user's query request after the two stages of vector retrieval and re-ranking. This fragment is the final output of the entire retrieval process and will be used to generate the answer for the user.

[0095] Specifically, the system compares the semantic relevance scores calculated for each candidate knowledge fragment in step S1064. Based on these scores, the system reorders the candidate knowledge fragment list in descending order, placing the fragment with the highest semantic relevance score at the top of the list. Finally, the system selects the first candidate knowledge fragment in this sorted list—the one with the highest score—and designates it as the question vector result. This result represents the knowledge base that the system believes best answers the user's question.

[0096] In one possible implementation, a secondary search is performed in a preset knowledge base based on the target version to obtain document search results, specifically including steps S1066-S1068, as follows:

[0097] Step S1066: Obtain the key attribute information corresponding to the target version. The key attribute information includes the underwriting conditions, exclusions, cooling-off period, and waiting period of the insurance product.

[0098] In step S1066, the target version refers to the specific insurance product version identified and determined in the previous steps that is directly related to the user's query request, such as "Ping An Fu 2024 Edition" rather than the general "Ping An Fu" series. Key attribute information refers to the specific set of data fields used to accurately describe and define the core terms of an insurance product. Underwriting conditions refer to a series of requirements that the insurance company bases on when accepting an application, such as the applicant's age range and health status. Exclusions refer to situations explicitly listed in the insurance contract where the insurance company is not liable for compensation or payment of insurance benefits, such as risks arising from the insured's involvement in illegal or criminal activities. The cooling-off period refers to a specific period after the applicant receives and signs the insurance contract, during which they have the right to unilaterally terminate the contract and obtain a full refund. The waiting period refers to a specified time after the insurance contract takes effect, during which certain insurance liabilities do not officially take effect.

[0099] Specifically, the system first receives the target version name determined in the preceding process, such as "Ping An Fu 2024 Edition". Then, the system accesses an internal, structured product information database or configuration table. This database stores detailed attributes of all insurance products. Using the target version name as an index, the system queries and extracts a predefined set of key attribute names: "Underwriting Conditions", "Exclusions", "Cooling-off Period", and "Waiting Period". The purpose of this step is to transform a vague product concept into a set of clear, standardized terms that can be used for precise retrieval.

[0100] Step S1067: Based on key attribute information, construct a structured search statement, and use the structured search statement to search in the preset knowledge base to obtain preliminary document search results.

[0101] In step S1067, a structured search statement is a query instruction that follows specific syntax rules. It allows multiple search conditions to be combined using logical operators such as "AND," "OR," and "NOT" to perform precise searches within a dataset, unlike simple keyword searches. In this context, the pre-defined knowledge base typically refers to a document database or search engine index that supports field retrieval. It stores a large number of raw documents, such as insurance contracts, product manuals, and terms and conditions, and these documents have been processed and indexed, allowing retrieval based on their metadata or content fields. The preliminary document retrieval results refer to the initial set of all documents that meet the query conditions returned by the knowledge base after executing the structured search statement; this set is unsorted and unfiltered.

[0102] Specifically, the system dynamically constructs a structured search statement using the target version name and key attribute information obtained in step S1066. For example, the system generates a query instruction with the intent to "find all documents in the preset knowledge base, requiring that the 'product version' field of these documents exactly matches 'Ping An Fu 2024 Edition,' and that the content or chapter title of the documents must contain at least one of the words 'underwriting conditions,' 'exclusions,' 'cooling-off period,' or 'waiting period.'" The system then submits this constructed structured search statement to the retrieval interface of the preset knowledge base. The knowledge base executes the query and returns a list of all matching documents, such as "Ping An Fu 2024 Edition Product Terms and Conditions" and "Ping An Fu 2024 Edition Insurance Application Instructions," to the system. This list constitutes the initial document search results.

[0103] Step S1068: Sort the preliminary document retrieval results by relevance, and select a preset number of documents as document retrieval results based on the ranking score.

[0104] In step S1068, relevance ranking refers to the process of evaluating the relevance of each document in the preliminary document retrieval results to the original query request using an algorithm, and then reordering them accordingly. The ranking score is a numerical value calculated by the ranking algorithm to quantify the relevance of documents; documents with higher scores are generally considered more relevant to the query intent. The preset quantity is a pre-defined integer used to truncate the top-ranked portion from the sorted document list to control the size and quality of the final results. The document retrieval results refer to the top-level set of documents that, after relevance ranking and quantity truncation, are ultimately selected and considered to provide the most needed information.

[0105] Specifically, the system receives the preliminary document retrieval results returned in step S1067. This result list has typically been pre-calculated and assigned a ranking score to each document by the underlying search engine based on its internal relevance algorithm, such as the BM25 algorithm. The system sorts the preliminary document retrieval result list in descending order based on this ranking score, placing the document with the highest score at the top of the list. Then, the system reads a preset value, such as 3. The system selects the top 3 documents from the sorted list. These 3 most relevant documents constitute the final document retrieval results, which will be used for subsequent analysis or information extraction to generate accurate answers to the user's questions.

[0106] Step S107: Merge the question vector results and document retrieval results to obtain initial candidate documents.

[0107] In step S107, the initial candidate document refers to the unified context information formed by merging the results from different search paths to generate the final answer.

[0108] Specifically, the system performs a merging operation. It combines the question vector results obtained through vector retrieval in step S106—a set of semantically related knowledge fragments—with the document retrieval results obtained through secondary retrieval—a set of document content about the product's key attributes. The merging can be done by simply concatenating the two sets of text content, or by performing deduplication, removing fragments that are identical or highly similar. This merged, richer, and more comprehensive text set constitutes the initial candidate documents. It contains both content highly semantically related to the user's question and structured key information about the target version of the product, providing a solid foundation for the large language model to accurately answer the question.

[0109] Step S108: Combine the query request, initial candidate documents, and preset prompt words to generate the first final prompt word, and input the first final prompt word into the preset large language model to obtain the first target answer for the query request.

[0110] In step S108, the preset prompt word is a pre-designed instruction text used to guide and constrain the behavior of the large language model. The first final prompt word is the complete text that combines the user question, context, and instructions, and is ultimately input into the large language model. The preset large language model refers to an AI model trained on a large-scale corpus with powerful natural language understanding and generation capabilities, such as the GPT series models. The first target answer is the user-facing response generated and output by the preset large language model based on the first final prompt word.

[0111] Specifically, the system constructs the first final prompt word according to a preset prompt word template. This template typically includes several parts: a role setting or instruction section (e.g., "You are a professional insurance consultant, please answer the user's question accurately based on the following background knowledge"), a background knowledge placeholder, and a user question placeholder. The system fills the background knowledge placeholder with the initial candidate document obtained in step S107 and the user's original query request with the user question placeholder. The complete text formed by this combination is the first final prompt word. Subsequently, the system sends the prompt word to the preset large language model via API call. The large language model understands the instruction, reads and digests the information in the initial candidate document, and then generates a fluent and accurate natural language answer based on the user's query request. This answer is the first target answer and is finally presented to the user.

[0112] To facilitate understanding, the following example illustrates steps S101-S108 of this application. Assume a user enters a query into the intelligent question-and-answer system: "I want to know how long the waiting period is for the Ping An Fu 2024 version?". Upon receiving this request, the system first performs a preliminary search in a pre-defined knowledge base containing information on all insurance products. Because the query contains keywords such as "Ping An Fu," "2024 version," and "waiting period," the system recalls multiple related document fragments. Some of these fragments are identified as "Ping An Fu 2024 version," while others, possibly due to content relevance, are recalled as "Ping An Fu 2023 version." Next, the system analyzes these fragments, identifies the product as "Ping An Fu," and queries the product database to find that the "Ping An Fu" series has multiple historical versions, including "2022 version," "2023 version," and "2024 version." Therefore, a candidate version set containing these three versions is constructed. Subsequently, the system performs intent analysis on the text content of the query request. Because it does not find words such as "difference" or "comparison," the system determines that this is not a cross-version query. Therefore, the process enters the version selection stage. The system calculates version consistency scores for "2022 version," "2023 version," and "2024 version" in the candidate version set. Since the user's query explicitly mentioned "2024 version," document fragments related to "2024 version" will have a high semantic relevance score in the initial search, resulting in the highest semantic relevance aggregate score. Simultaneously, "2024 version," as the latest version, also has the highest time factor. Overall, "Ping An Fu 2024 version" has a significantly higher version consistency score and is therefore identified as the sole target version.

[0113] After determining the target version, the system first feeds the query "I want to know how long the waiting period is for Ping An Fu 2024?" into a text embedding model, generating a question vector representing its semantics. Second, the system performs a two-way search: it uses the question vector to search the vector knowledge base, finding several general explanations of "general provisions for insurance waiting periods" and "the meaning of the waiting period for critical illness insurance," which are used as the question vector results. Simultaneously, it constructs a secondary search query specifically for "Ping An Fu 2024," precisely retrieving the original text of the clause regarding the product's waiting period from the knowledge base: "The waiting period is 90 days from the effective date of this contract..." This portion is used as the document search result. Then, the system merges the two retrieved contents to form an initial candidate document, the content of which is roughly: "...the insurance waiting period refers to.... The waiting period is 90 days from the effective date of this contract...".

[0114] Finally, the system constructs a first, final prompt similar to the following: "You are an insurance expert. Please answer the user's question based on the following information. Information: [...the insurance waiting period refers to.... The waiting period is 90 days from the effective date of this contract...]. User question: [I want to know how long the waiting period is for Ping An Fu 2024 version?]". This prompt is sent to a pre-set large language model. After understanding the context and the question, the model generates a clear and accurate first target answer: "Hello, the waiting period for Ping An Fu 2024 version is 90 days." This answer is then displayed to the user.

[0115] like Figure 2 As shown, in one possible implementation, after inputting the second final prompt word into a preset large language model to generate a second target answer for the query request, the method further includes steps S201-S209, as follows:

[0116] Step S201: Extract key entities related to the insurance product from the first or second target answer.

[0117] In step S201, the first target answer refers to the preliminary answer generated in the previous step based on the initial information input into the preset large language model. The second target answer refers to the more accurate answer generated in the previous step based on the information that has undergone secondary retrieval and optimization, i.e., differential knowledge context, and is input into the preset large language model again. Key entities refer to core information units with clear and independent meaning in the field of insurance products, such as "insured age," "coverage period," and "payment method," which are the basic elements constituting the factual description of the product.

[0118] Specifically, the system receives the text answers generated by the large language model, whether it is the first target answer or the second target answer. The system will call a pre-trained named entity recognition model, which is optimized for insurance domain texts and can accurately identify various key entities mentioned in the texts. For example, when the answer text is "The waiting period of this product is 90 days", the model can identify that "waiting period" is a key entity and extract its corresponding entity value "90 days". The system organizes all the key entities extracted from the answer and their corresponding entity values into a list or a set of key-value pairs for use in subsequent verification steps.

[0119] Step S202: Convert the initial candidate document or the differential knowledge context into a structured triple form to construct a knowledge verification database.

[0120] In step S202, the initial candidate document refers to the set of original reference materials used to generate the first target answer. The differential knowledge context refers to the knowledge fragments that are screened out after secondary retrieval to cope with product version updates or information supplements and are different from or newly added to the initial candidate document. A structured triple is a standard data format for representing knowledge, consisting of "subject", "predicate", and "object", which is used to describe the relationship between the subject and the object. For example, the triple "Ping An Fu 2024, has a waiting period, 90 days". The knowledge verification database refers to a temporarily constructed structured database for fact-checking, which stores all the triple information extracted from the source documents.

[0121] Specifically, the system will select the corresponding source materials according to the source of the answer being processed currently. That is, if processing the first target answer, the initial candidate document will be selected; if processing the second target answer, the differential knowledge context will be selected. The system performs information extraction on the selected document content. Through natural language processing techniques, it identifies the sentences describing product attributes in the document and converts these sentences into a series of structured triples. For example, from the sentence "The waiting period of this contract is 90 days" in the product terms, the system can extract the triple "this contract, waiting period, 90 days". The system loads all the triples extracted from the document into a temporary database that supports structured queries, such as a graph database or a set of in-memory hash tables, thus completing the construction of the knowledge verification database.

[0122] Step S203: Construct structured query statements based on each key entity and the entity value corresponding to each key entity.

[0123] In step S203, the key entity and the entity value refer to the information pair extracted from the target answer generated by the large language model in step S201. A structured query statement is an instruction that follows specific syntax rules and is used to precisely find data that meets specific conditions in a structured database. For example, querying a specific attribute value of a specific product in a knowledge verification database.

[0124] Specifically, the system traverses the list of key entities and their values obtained in step S201. For each item in the list, the system dynamically generates a structured query statement. The design goal of this query statement is to find the facts corresponding to the current key entity in the knowledge verification database constructed in step S202. For example, if the key entity "waiting period" is extracted from the answer and the product is known to be "Ping Anfu 2024" in the context, the system will construct a query statement with the intention of "querying the triple with the subject 'Ping Anfu 2024', the predicate 'waiting period', and returning its object value".

[0125] Step S204: Execute the structured query statement in the knowledge verification database to obtain the query result.

[0126] In step S204, the knowledge verification database refers to the database constructed in step S202 that stores the facts of the source document. The structured query statement refers to the query instruction generated for each key entity to be verified in step S203. The query result refers to the data record returned by the knowledge verification database after executing the structured query statement and matching the query conditions.

[0127] Specifically, the system sequentially submits each structured query statement generated in step S203 to the query interface of the knowledge verification database for execution. The database engine will perform a matching search in the set of triples it stores according to the query instruction. For example, when executing the query "find the triple with the subject 'Ping Anfu 2024' and the predicate 'waiting period'", the database will search all relevant records and return one or more complete triples found, such as "Ping Anfu 2024, has a waiting period, 90 days", as the query result to the system.

[0128] Step S205: If the query result is empty, determine that the structured query verification fails.

[0129] In step S205, the query result being empty means that after executing the query in the knowledge verification database, no data records matching the query conditions are found. The structured query verification failing is a judgment conclusion, indicating that for a certain key entity extracted from the large language model answer, no relevant description can be found in the original document serving as the source of facts, so the authenticity of this information cannot be confirmed.

[0130] Specifically, after receiving the query result returned in step S204, the system will first check whether the result is empty. If the returned result set is empty, that is, the list length is zero or the return value is null, the system determines that there is no supporting basis for this query of the key entity in the source document. Therefore, the system marks the key entity as "verification failed" with the reason of "not mentioned in the source document".

[0131] Step S206: If the query result is not empty, determine whether the actual entity value in the query result is consistent with the entity value of the key entity.

[0132] In step S206, a non-empty query result means that at least one data record matching the query condition is found in the knowledge verification database. The actual entity value refers to the real attribute value extracted from the query result returned by the knowledge verification database and originating from the original document. The entity value of the key entity refers to the attribute value extracted from the target answer generated by the large language model in step S201.

[0133] Specifically, when the query result returned in step S204 is not empty, the system will parse the "object" part from the returned triple record, and this object is the actual entity value recorded in the source document. For example, if the query result is the triple "Ping Anfu 2024, has a waiting period, 90 days", the actual entity value is "90 days". Subsequently, the system compares this actual entity value with the entity value of the key entity currently being verified extracted from the large language model answer to determine whether they are consistent.

[0134] Step S207: If it is determined that the actual entity value in the query result is consistent with the entity value of the key entity, determine that the structured query verification passes.

[0135] In step S207, the consistency between the actual entity value and the entity value of the key entity means that through comparison, it is found that the value obtained from the original document is the same as the value obtained from the large language model answer. The structured query verification passing is a judgment conclusion, indicating that a certain key entity and its value extracted from the large language model answer are completely consistent with the description in the original document as the source of facts, proving that the information is accurate.

[0136] Specifically, after performing the comparison operation in step S206, if the system determines that the two values are exactly equal. For example, the entity value in the answer is "90 days" and the actual entity value retrieved from the database is also "90 days", the system determines that the verification of this key entity is successful. The system marks the key entity as "verification passed".

[0137] Step S208: If it is determined that the actual entity value in the query result is inconsistent with the entity value of the key entity, determine that the structured query verification fails.

[0138] In step S208, the inconsistency between the actual entity value and the key entity value means that, through comparison, it is found that the value obtained from the original document is different from the value obtained from the large language model's answer. The structured query validation failure is a conclusion indicating that the value of a certain key entity in the answer generated by the large language model conflicts with the description in the original document, i.e., a factual error has occurred.

[0139] Specifically, after performing the comparison operation in step S206, if the system determines that the two values ​​are not equal—for example, the entity value in the answer is "180 days," while the actual entity value retrieved from the database is "90 days"—the system determines that the verification for that key entity has failed. The system marks the key entity as "verification failed" because it is "inconsistent with the source document."

[0140] Step S209: If it is determined that the structured query verification fails, then perform error value correction on the key entities in the first target answer based on the initial candidate documents, or perform error value correction on the key entities in the second target answer based on the differential knowledge context.

[0141] In step S209, "structured query validation fails" refers to the judgment conclusion reached in step S205 or step S208. Error value correction refers to a correction process, that is, replacing the error values ​​in the answer generated by the large language model with the correct values ​​verified from the original document.

[0142] Specifically, when one or more key entities are marked as "verification failed," the system initiates a correction process. For each key entity that fails verification, if the reason for failure is "inconsistency with the source document," the system retrieves the correct actual entity value found in step S206. Then, the system locates the incorrect entity value in the original target answer text and replaces it with the correct actual entity value. For example, in the text "...waiting period is 180 days..." in the second target answer, the system replaces "180 days" with "90 days." If the reason for failure is "not mentioned in the source document," the system can choose to delete the information from the answer or add a note indicating that it cannot be verified. After the correction operation is completed, the system outputs a more reliable final answer that has been fact-checked and corrected.

[0143] The following describes an intelligent question-answering system based on a large model and retrieval enhancement from the perspective of hardware processing. Please refer to [link to relevant documentation]. Figure 3 This is a schematic diagram of the structure of an intelligent question-answering system based on a large model and retrieval enhancement in an embodiment of this application.

[0144] It should be noted that, Figure 3 The structure of the intelligent question-answering system based on large models and retrieval enhancement shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0145] like Figure 3 As shown, an intelligent question-answering system based on a large model and retrieval enhancement includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes according to a program stored in Read-Only Memory (ROM) 302 or a program loaded from storage portion 308 into Random Access Memory (RAM) 303, such as performing the methods described in the above embodiments. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An Input / Output (I / O) interface 305 is also connected to the bus 304.

[0146] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0147] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.

[0148] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0149] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.

[0150] Specifically, an intelligent question-answering system based on a large model and retrieval enhancement according to this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the intelligent question-answering method based on a large model and retrieval enhancement provided in the above embodiment.

[0151] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the large-model and retrieval-enhanced intelligent question-answering system described in the above embodiments; or it may exist independently and not incorporated into the large-model and retrieval-enhanced intelligent question-answering system. The storage medium carries one or more computer programs, which, when executed by a processor of the large-model and retrieval-enhanced intelligent question-answering system, enable the large-model and retrieval-enhanced intelligent question-answering system to implement the large-model and retrieval-enhanced intelligent question-answering method based on encrypted IoT data transmission provided in the above embodiments.

Claims

1. An intelligent question-answering method based on large models and retrieval enhancement, characterized in that, The method includes: Receive a user's query request, perform a preliminary search on a preset knowledge base based on the query request, and obtain a document fragment related to the query request. The document fragment contains the product identifier and version identifier of the insurance product. For any of the product identifiers, determine at least one corresponding target version identifier and construct a candidate version set; The query intent is analyzed on the text content of the query request to determine whether the query request belongs to the cross-version query type; If it is determined that the query request does not belong to the cross-version query type, then a version consistency score is calculated for each version in the candidate version set, and the target version with the highest score is determined from the candidate version set based on the version consistency score. The version consistency score is composed of a semantic relevance aggregate score and a time factor weighting. Obtain the target document fragment corresponding to the target version, and perform vectorization processing on the query request to generate a question vector; Based on the question vector, a vector retrieval is performed in a preset vector knowledge base to obtain the question vector result. Based on the target version, a secondary retrieval is performed in the preset knowledge base to obtain the document retrieval result. The question vector results and the document retrieval results are merged to obtain initial candidate documents; The query request, the initial candidate documents, and the preset prompt words are combined to generate a first final prompt word, and the first final prompt word is input into a preset large language model to obtain a first target answer for the query request; The calculation of a version consistency score for each version in the candidate version set specifically includes: For each version in the candidate version set, traverse the document fragments, identify all target fragments corresponding to the version, and form a subset of target fragments; Extract the semantic relevance score of each target fragment from the target fragment subset obtained in the preliminary retrieval, and perform an aggregation operation based on the semantic relevance score to obtain the semantic relevance aggregate score corresponding to each version; Based on the preset version identifier naming rules and preset business release time rules, determine the generation time of each version identifier, and determine the corresponding time factor based on the generation time; For each version in the candidate version set, the semantic relevance aggregate score is multiplied by the time factor to obtain the version consistency score.

2. The method according to claim 1, characterized in that, After performing query intent analysis on the text content of the query request to determine whether the query request belongs to the cross-version query type, the method further includes: If it is determined that the query request belongs to the cross-version query type, then based on the preset version query rules, the baseline version and the comparison version are selected from the candidate version set; Based on the query request, a first targeted search is performed in the preset knowledge base for the benchmark version to obtain benchmark document content related to the query request. Based on the query request, a second targeted search is performed in the preset knowledge base to obtain the comparison document content related to the query request. Construct a structured differential knowledge context, which includes the content of the benchmark document and the content of the comparison document; The query request, the differential knowledge context, and the preset prompt words are combined to generate a second final prompt word, which is then input into the preset large language model to generate a second target answer for the query request.

3. The method according to claim 1, characterized in that, The step of performing a vector retrieval in a preset vector knowledge base based on the question vector to obtain the question vector result specifically includes: Calculate the cosine similarity between each knowledge vector in the preset vector knowledge base and the question vector; Sort the knowledge vectors in the preset vector knowledge base in descending order based on the cosine similarity. In the sorting results, a preset number of target knowledge vectors are selected, and the knowledge fragments corresponding to the target knowledge vectors are used as candidate knowledge fragments. Calculate the semantic relevance score between each candidate knowledge fragment and the query request, the semantic relevance score being derived from the following formula: score=α*sim(q,s)+β*cov(q,s) Where s represents the candidate knowledge fragment, q represents the query request, score represents the semantic relevance score between the candidate knowledge fragment and the query request, sim(q, s) represents the cosine similarity between the candidate knowledge fragment and the query request, cov(q, s) represents the proportion of keywords in the query request covered by the candidate knowledge fragment, and α and β are preset weight parameters that satisfy α+β=1. The candidate knowledge fragments are sorted in descending order based on their semantic relevance scores, and the candidate knowledge fragment with the highest semantic relevance score is selected as the question vector result.

4. The method according to claim 1, characterized in that, The step of performing a secondary search in the preset knowledge base based on the target version to obtain document search results specifically includes: Obtain the key attribute information corresponding to the target version, including the underwriting conditions, exclusions, cooling-off period, and waiting period of the insurance product; Based on the key attribute information, a structured search statement is constructed, and the structured search statement is used to search in the preset knowledge base to obtain preliminary document search results; The preliminary document retrieval results are sorted by relevance, and a preset number of documents are selected as the document retrieval results based on the sorting scores.

5. The method according to claim 2, characterized in that, After inputting the second final prompt word into the preset large language model to generate the second target answer for the query request, the method further includes: Extract key entities related to the insurance product from either the first or the second target answer; For each key entity and the entity value corresponding to each key entity, a structured query verification is performed in the initial candidate document on which the first target answer is based or in the differential knowledge context on which the second target answer is based. If the structured query validation fails, then the key entities in the first target answer are corrected for errors based on the initial candidate documents, or the key entities in the second target answer are corrected for errors based on the differential knowledge context.

6. The method according to claim 5, characterized in that, For each key entity and its corresponding entity value, structured query verification is performed in the initial candidate document upon which the first target answer is based or in the differential knowledge context upon which the second target answer is based. Specifically, this includes: The initial candidate documents or the differential knowledge context are converted into structured triples to construct a knowledge verification database; Based on each of the key entities and the entity value corresponding to each key entity, a structured query statement is constructed; The structured query statement is executed in the knowledge verification database to obtain the query results; If the query result is empty, the structured query validation is determined to have failed. If the query result is not empty, then determine whether the actual entity value in the query result is consistent with the entity value of the key entity; If it is determined that the actual entity value in the query result is consistent with the entity value of the key entity, then the structured query verification is deemed successful. If it is determined that the actual entity value in the query result is inconsistent with the entity value of the key entity, then the structured query validation fails.

7. An intelligent question-answering system based on large models and retrieval enhancement, characterized in that, The large model-based and retrieval-enhanced intelligent question answering system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the large model-based and retrieval-enhanced intelligent question answering system to perform the method as described in any one of claims 1-6.

8. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on a large model-based and retrieval-enhanced intelligent question-answering system, the large model-based and retrieval-enhanced intelligent question-answering system performs the method as described in any one of claims 1-6.

9. A computer program product, characterized in that, When the computer program product is run on a large model-based and retrieval-enhanced intelligent question answering system, the large model-based and retrieval-enhanced intelligent question answering system performs the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Intelligent assurance knowledge question and answer method and system based on LLM and RAG technologies

    CN120744072A

  • Automatic database enrichment and curation using large language models

    US20250045256A1