Large model-based rule and regulation question and answer assistant construction method

By building a knowledge base and question-answer chain, using Prompt to guide the big model to build Q-A pairs, and using technologies such as decomposition enhancement, multiple query and inverted processing, the problem of poor results in dealing with rules and regulations knowledge is solved, and the answer accuracy and reliability are achieved.

CN119621898APending Publication Date: 2025-03-14CHINA CHANGFENG SCI TECH IND GROUPCORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411691003.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The big model-based knowledge Q&A assistant is not effective in dealing with rules and regulations, making it difficult to provide accurate and reliable answers.

Method used

A method of building a rules and regulations question-and-answer based on large models is adopted. By building a knowledge base and question-and-answer chain, Prompt is used to guide the big model to build Q-A pairs, extract the characteristics of the Query vector, conduct similarity query, and adopt decomposition enhancement, multiple query and inverted processing to improve the quality of the recalled content.

Benefits of technology

It significantly improves the accuracy and reliability of large models when dealing with complex and fuzzy questions, reduces the occurrence of wrong answers, and improves the quality and efficiency of Q&A assistants' answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621898A_ABST
    Figure CN119621898A_ABST
Patent Text Reader

Abstract

The invention relates to a rule and regulation question and answer assistant construction method based on a large model. The method comprises knowledge base construction and question and answer chain construction. According to knowledge base construction, item names and related titles form Query, specific item descriptions form Answer, the Query and the Answer form Q-A to be stored in a relational database, and Query vector features are extracted and stored in a vector library at the same time; the question and answer chain construction comprises the steps of firstly recalling related questions from a knowledge base, judging whether the related questions are consistent with user intentions or not by a large model, directly returning answers when the related questions are consistent with the user intentions, generating a plurality of sub-questions by adopting a decomposition enhancement mode when the intentions are inconsistent, and then performing multiple queries on each sub-question to generate a plurality of synonymous rewriting forms; relevant knowledge is recalled from the vector library, the large model is guided to iteratively generate the answer of each sub-question, and the large model integrates the answers of the original question and the sub-questions to generate a final answer. The accuracy of model answering can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of artificial intelligence big models, relates to the application of artificial intelligence big models in natural language processing technology, and specifically to a method for constructing a rules and regulations question and answer assistant based on a big model. Background Art

[0002] Traditional question-answering assistants are mainly based on rules and knowledge bases, and their structure generally includes a knowledge base module, a question parsing module, and an answer generation module. The knowledge base stores pre-set question-answer pairs or domain knowledge. The question parsing module uses natural language processing techniques, such as lexical analysis and syntactic analysis, to understand the questions input by the user, and then searches for matching answers in the knowledge base. Therefore, the advantage of traditional question-answering assistants is that their answers are highly accurate, but they lack generalization capabilities and can only answer fixed question forms that already exist in the knowledge base. They may not be able to accurately answer questions with similar semantics but different expressions. In addition, this type of question-answering assistant has poor flexibility and cannot reason and expand answers based on knowledge like humans. It is not effective in answering complex questions that require comprehensive knowledge.

[0003] With the widespread application of large artificial intelligence models in the field of natural language processing, question-answering assistants based on large models can improve the generalization ability of questions and provide corresponding answers to a variety of questions. Among them, Prompt technology is a method of guiding the output of large models by designing specific input prompts. In question-answering assistants, through carefully designed prompts, large models can be guided to better understand questions and generate more satisfactory answers. However, due to the possible deficiencies in the accuracy, timeliness and completeness of training data, it is difficult to fully cover user needs. In addition, large language models cannot give correct answers to certain questions, and even generate answers that seem reasonable but are actually logically confusing or contrary to the facts.

[0004] In order to solve these problems and further improve the generation quality of the large language model, the relevant information can be stored in an external database for retrieval and call by the large language model. This system that retrieves relevant information from an external database to assist in improving the generation quality of the large language model is called Retrieval-Augmented Generation (RAG). Retrieval-Augmented Generation (RAG) aims to enhance the accuracy and richness of the text generated by the large language model by retrieving and integrating external knowledge. It is a system that integrates multiple functional modules such as external knowledge base, information retriever, and large language model. RAG uses information retrieval, deep learning and other technologies to introduce the latest, specific domain knowledge into the generation process of the large language model, thereby overcoming the limitations of traditional large language models and providing more accurate and reliable generated content. However, in practical applications, the large model cannot learn relevant knowledge in the private domain, and RAG must be used to improve the model's question-answering ability in vertical fields. For example, for rules and regulations such as business processes, the requirements of different business processes have high semantic similarity, which is easy to recall inappropriate content, causing the large model to generate incorrect answers. In addition, the questions users ask of large language models may be complex or ambiguous. Complex questions often involve multiple knowledge points and require multi-hop understanding, while ambiguous questions often have unclear scopes and are difficult to understand at once. Therefore, for complex and ambiguous questions, it is difficult to enhance the recall of all required knowledge through a single retrieval. Summary of the invention

[0005] The purpose of the present invention is to solve the problem that the knowledge question-and-answer assistant based on a large model is not effective in processing knowledge related to rules and regulations, and to propose a method specifically suitable for constructing a knowledge question-and-answer assistant related to rules and regulations.

[0006] The technical solution of the present invention is as follows:

[0007] A method for constructing a rules and regulations question-answering assistant based on a large model, characterized by comprising the following steps:

[0008] (1) Constructing a knowledge base: The name of the item and related titles form a query, and the specific item description forms an answer. The two form a QA and are stored in a relational database. At the same time, the query vector features are extracted and stored in the vector library for similarity query;

[0009] (2) Constructing a question-answer chain: First, relevant questions are retrieved from the knowledge base, and the big model determines whether the relevant questions are relevant to the user. Figure 1 to Figure 1When the intentions are consistent, the answers to related questions are directly returned. When the intentions are inconsistent, a decomposition-enhanced solution is adopted to generate multiple sub-questions. Then, multiple queries are used for each sub-question to generate multiple synonymous rewrites, and relevant knowledge is recalled from the vector library respectively. At the same time, the recalled knowledge is inverted to select appropriate knowledge to guide the large model to iteratively generate the answer to each sub-question. Finally, the large model integrates the answers to the original question and the sub-questions to generate the final answer.

[0010] In the above-mentioned method for constructing a rules and regulations question-and-answer assistant based on a big model, in step (1), the big model is guided by Prompt to automatically complete the construction of QA. The specific process is as follows:

[0011] First, the text is divided into blocks according to paragraphs, and the current segment and the cache segment are iteratively input. The large model is used to judge multiple times whether the current segment and the cache segment should be divided into one piece. When they can be divided into one piece, the current segment is added to the cache segment, otherwise it directly constitutes QA. In order to improve the accuracy, the large model is used to make multiple judgments and vote to confirm whether different segments should be divided into one piece. The successfully constructed QA is saved locally in a fixed format for subsequent sampling inspection. After the inspection is passed, it is stored in the relational database and vector database in batches.

[0012] The present invention uses the idea of ​​model routing, which can not only return the answers to common questions carefully written by humans to ensure the reliability of the answers, but also use the large model to understand the user's intention for other complex questions, and use decomposition enhancement, multiple queries, inverted sorting and other methods to improve the quality of recalled content, obtain reliable knowledge, and improve the accuracy of model answers. In addition, in order to improve the efficiency of knowledge base construction, the present invention guides the large model to divide the article into blocks by designing prompt iteration to reduce labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0014] The present invention mainly includes two key parts: knowledge base construction and question-answer chain construction. The two work together to improve the accuracy and reliability of the large model as a question-answering assistant when dealing with complex problems, especially rules and regulations, and business process issues.

[0015] The core purpose of knowledge base construction is to integrate relevant knowledge in various vertical fields to enhance the reliability of answers generated by the big model. Unlike ordinary news texts, texts of rules and regulations have relatively uniform structures, large dependencies between texts, and extremely high similarities between different texts. For example, there are a lot of repetitions in the "materials to be provided" for the two matters of "motor vehicle engine change" and "motor vehicle use nature change", but they are dependent on specific matters. At this time, if the blocks are divided according to the conventional scheme of word count, these similar contents cannot be effectively distinguished, resulting in the recall of relevant instructions for irrelevant service processes when providing information to the big model. These irrelevant information will interfere with the answers of the big model, resulting in a large amount of error information.

[0016] The present invention designs a knowledge base construction method based on the characteristics of rules and regulations and work process content. Specifically, the name of the matter and the related title constitute the Query, and the specific matter description constitutes the Answer, and the two constitute the QA and are stored in the relational database. At the same time, the query extracts vector features and stores them in the vector library for similarity query.

[0017] When building QA, the document is first segmented into paragraphs, and the Prompt example is used to guide the large model to iteratively analyze the relationship between adjacent paragraphs, so as to accurately determine whether adjacent paragraphs belong to the same content, thereby completing the construction of QA. This construction method can effectively avoid recalling irrelevant information and provide accurate and targeted knowledge for the large model. This allows the large model to have a reliable knowledge basis when answering questions related to rules and regulations and business processes, reducing incorrect answers caused by confusion in the knowledge base information, and significantly improving the quality and accuracy of the answers.

[0018] The core purpose of building a question-answer chain is to adaptively select different processing methods according to different questions and provide a user experience for the question-answer assistant. The process is as follows: Figure 1 shown.

[0019] In the past, Q&A assistants have accumulated a large number of common questions, and these questions have more accurate answers edited by humans. In order to make full use of existing common questions and specific rules and regulations, the present invention uses prompts to guide the big model to judge the similarity between the user's question and the recalled common questions, and then determines whether the answer is the answer to the common question or automatically generated by the big model. In this way, the answer efficiency can be improved while ensuring the accuracy of the answer, giving full play to the advantages of existing knowledge resources, and providing users with a better quality Q&A service experience.

[0020] For other complex questions beyond the scope of common questions, the present invention uses a large model to generate relevant answers. In actual application scenarios, there are often a large number of complex questions, and this complexity may make it difficult to recall appropriate knowledge through only one search. To meet this challenge, the present invention adopts a decomposition enhancement solution. First, a large number of problem decomposition examples are constructed, which are used to guide the large model to decompose user questions. Subsequently, these problem decomposition examples are stored in a vector library so that the retriever can select the most suitable decomposition method from them to guide the operation of the large model. For example, for the question "What to do after changing the color of the car", it can be decomposed into multiple sub-questions such as "Materials required for the procedure of changing the color of the car" and "Procedures for changing the color of the car". For the multiple sub-questions after decomposition, the present invention uses a multi-query mechanism, uses a large model to generate multiple similar sub-questions, recalls relevant knowledge from the knowledge base respectively, and uses an inverted algorithm to sort the recalled knowledge, so as to more accurately select appropriate knowledge for recall, and then the large model answers based on these knowledge. Finally, the large model integrates the answers to the original question and multiple sub-questions and returns the final answer result. In addition, considering the differences in the amount of recalled knowledge content, the large model may have a context overflow problem. In this regard, the present invention solves this problem by segmenting the recalled content and allowing the large model to answer multiple times.

[0021] The specific implementation of the present invention is as follows:

[0022] (1) Constructing a knowledge base: The name of the item and related titles form a query, and the specific item description forms an answer. The two form a QA and are stored in a relational database. At the same time, the query vector features are extracted and stored in the vector library for similarity query;

[0023] Use Prompt to guide the large model to automatically complete the QA construction. The specific process is as follows:

[0024] First, the text is divided into blocks according to paragraphs, and the current segment and the cache segment are iteratively input. The large model is used to judge multiple times whether the current segment and the cache segment should be divided into one piece. When they can be divided into one piece, the current segment is added to the cache segment, otherwise it directly constitutes QA. In order to improve the accuracy, the large model is used to make multiple judgments and vote to confirm whether different segments should be divided into one piece. The successfully constructed QA is saved locally in a fixed format for subsequent sampling inspection. After the inspection is passed, it is stored in the relational database and vector database in batches.

[0025] (2) Constructing a question-answer chain: First, relevant questions are retrieved from the knowledge base, and the big model determines whether the relevant questions are relevant to the user. Figure 1 to Figure 1When the intentions are consistent, the answers to related questions are directly returned. When the intentions are inconsistent, a decomposition-enhanced solution is adopted to generate multiple sub-questions. Then, multiple queries are used for each sub-question to generate multiple synonymous rewrites, and relevant knowledge is recalled from the vector library respectively. At the same time, the recalled knowledge is inverted to select appropriate knowledge to guide the large model to iteratively generate the answer to each sub-question. Finally, the large model integrates the answers to the original question and the sub-questions to generate the final answer.

Claims

1. A method for constructing a rules and regulations question-answering assistant based on a large model, characterized in that: The following steps are involved: (1) Constructing a knowledge base: The name of the item and related titles form a query, and the specific item description forms an answer. The two form a QA and are stored in a relational database. At the same time, the query vector features are extracted and stored in the vector library for similarity query; (2) Constructing a question-answer chain: First, relevant questions are recalled from the knowledge base, and the large model determines whether the relevant questions are consistent with the user's intention. When the intention is consistent, the answer to the relevant question is directly returned. When the intention is inconsistent, a decomposition enhancement solution is adopted to generate multiple sub-questions. Then, multiple queries are used for each sub-question to generate multiple synonymous rewrites. Relevant knowledge is recalled from the vector library respectively, and the recalled knowledge is reversed to select appropriate knowledge to guide the large model to iteratively generate the answer to each sub-question. Finally, the large model integrates the answers to the original question and the sub-questions to generate the final answer.

2. The method for constructing a rules and regulations question-and-answer assistant based on a large model according to claim 1 is characterized in that: In step (1), the large model is guided by Prompt to automatically complete the construction of QA. The specific process is as follows: First, the text is divided into blocks according to paragraphs, and the current segment and the cache segment are iteratively input. The large model is used to judge multiple times whether the current segment and the cache segment should be divided into one piece. When they can be divided into one piece, the current segment is added to the cache segment, otherwise it directly constitutes QA. In order to improve the accuracy, the large model is used to make multiple judgments and vote to confirm whether different segments should be divided into one piece. The successfully constructed QA is saved locally in a fixed format for subsequent sampling inspection. After the inspection is passed, it is stored in the relational database and vector database in batches.