Government affair field question answering system based on retrieval type enhanced large model and use method thereof

By designing a question-and-answer system based on search-based enhancement large-scale models in the government affairs question-and-answer system, combining semantic cache library and relationship mapping database, the problem of differences in policy documents and low efficiency in handling hot issues in different regions is solved, and efficient and accurate government affairs question-and-answer services are achieved.

CN119513252APending Publication Date: 2025-02-25JILIN PROVINCE JILIN XIANGYUN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411574507.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing government Q&A system may give incorrect answers when dealing with policy documents in different regions or administrative divisions, and the processing of hot issues is inefficient, resulting in waste of computing resources.

Method used

A government affairs field question and answer system based on search-enhanced large-scale models is designed, including database module, history matching module, first large-scale model module, policy query module and second large-scale model module. The system uses the semantic cache library to cache historical Q&A records, uses the relationship mapping database to achieve real-time update of policy files and synchronization of historical records, and combines the first and second models to determine whether regional or administrative division information and policy documents are needed to generate targeted answers.

Benefits of technology

It effectively improves the response speed and answer efficiency of the government Q&A system, reduces dependence on large models, saves computing resources, and ensures accurate answers to different regions and latest policies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513252A_ABST
    Figure CN119513252A_ABST
Patent Text Reader

Abstract

The invention discloses a government affair field question-answering system based on a retrieval type enhanced large model and a use method thereof, and belongs to the technical field of artificial intelligence. The problems that wrong answers can be given due to the difference of related policy documents of different regions or administrative divisions, and hot questions with many questions are answered in a historical generation mode are solved. The government affair field question-answering system based on the retrieval type enhanced large model comprises a database module, a historical record matching module, a first large model module, a policy query module and a second large model module. Different region or administrative division information and policy documents are combined, a government affair field question and answer system based on a retrieval type enhanced large model is perfected, and when the question and answer system is used for questioning, accurate reply based on the different region or administrative division information and the related policy documents can be given more conveniently and quickly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention discloses a government affairs question-answering system based on a retrieval-enhanced large model and a method of using the system, which belongs to the field of artificial intelligence technology. Background Art

[0002] Large models have a large number of parameters and are trained using massive amounts of data. They have extensive general domain knowledge, demonstrate strong contextual content understanding and text generation capabilities, and perform well in application areas such as long text summarization and intelligent dialogue. The disadvantage is that large models have the "hallucination" problem. Although large language models can answer almost any question, they are not guaranteed to be completely accurate and sometimes give wrong answers. In addition, the huge number of model parameters also means that it is expensive to fine-tune using professional field data, which makes it difficult to update knowledge in real time. The above problems lead to poor performance of large models in knowledge-intensive scenarios, especially government Q&A scenarios. Unlike daily chats, government Q&A scenarios involve consultation on policies and procedures, which requires large models to be able to give accurate answers to relevant policies. At the same time, because policy documents are frequently updated, the requirements for real-time update capabilities of model knowledge are higher.

[0003] For government affairs question-and-answer scenarios, the widely used method is retrieval-based enhancement technology, that is, first use the retriever to retrieve relevant policy documents based on the user's question content, and then provide the user's question and the relevant policy documents to the generator, and use the contextual understanding ability of the big model to combine the relevant document content to give accurate answers, which makes up for the lack of knowledge in the professional field of the big model, and effectively avoids the "hallucination" problem and the problem of real-time knowledge update. The existing patent application CN118093844A (publication date: May 28, 2024) discloses a method for implementing government affairs intelligent customer service based on an artificial intelligence big model. First, the government affairs text data is marked, and then the government affairs data is vectorized and stored to complete the government affairs data preparation. In the question-and-answer stage, the received user request is first converted into a query vector, and then the relevant government affairs data is selected by calculating the similarity with the government affairs data vector, and combined with the user request as a prompt word, and finally provided to the big model for answering. The existing patent application CN117171314A (publication date: December 5, 2023) discloses a multimodal government affairs question-and-answer method based on a large model, which selects relevant government affairs data by calculating the cosine distance between the question vector and the government affairs data vector, and combines multiple modal data forms of audio, image, and document. In addition, the existing patent application CN118035419A (publication date: May 14, 2024) discloses a government affairs intelligent response device and method based on intent recognition and a large language model. The scheme first identifies the user's intent, and further combines vector retrieval and keyword retrieval to retrieve related government affairs data from the two aspects of semantic relevance and character relevance, and then combines historical questions, current questions and government affairs data to construct prompt words to guide the large model to generate reply content.

[0004] Although the above scheme has expanded the application of large models in the government affairs field through retrieval enhancement technology, avoided the use of government affairs data for fine-tuning, and achieved the purpose of saving computing resources. However, it does not take into account the regional or administrative division information related to the question, ignores the differences in policy documents between different provinces, cities, and administrative divisions, and may give wrong answers based on similar policies in different regions or administrative divisions. In addition, in policy consultation scenarios, it is easy for some hot issues to be asked by multiple users. If the historically generated answers can be effectively used, effective answers can be given directly without calling the large model for processing, thereby further saving computing resources. Further research is urgently needed on this issue. Summary of the invention

[0005] In view of the shortcomings of the existing technology, in order to avoid giving wrong answers due to differences in relevant policy documents between different regions or administrative divisions, and to avoid the problems of using historically generated models to answer hot questions with frequent questions, a government affairs question-answering system based on a retrieval-enhanced big model and its usage method are proposed.

[0006] A government affairs question-answering system based on a retrieval-enhanced large model, including a database module, a history record matching module, a first large model module, a policy query module, and a second large model module;

[0007] The database module includes a semantic cache library, a policy database and a relationship mapping database;

[0008] The database module is used to store policy document data, cache historical question and answer records, and associate historical question and answer records with relevant policy documents;

[0009] The history matching module is used to convert the user's question into text form;

[0010] The first large model module has a pre-trained large model with fewer parameters, which is used to construct prompt words about whether the question requires regional or administrative division information and policy documents, and provide the prompt words to the first large model to generate results based on the prompt words, and construct prompt words for searching for policy databases in combination with the question and regional or administrative division information, so as to guide the large model to generate policy database query statements;

[0011] The policy query module is used to search for policy documents from the policy database using the policy database query statement generated by the first large model module according to the problem information;

[0012] The second large model module is a pre-trained large model with more parameters, which is used to construct prompt words according to user questions, the results of the first large model module on whether regional or administrative division information is involved, and the results of the policy query module on whether policy documents are found, so that the second large model module combines the regional or administrative division information and relevant policy documents to guide the large model to generate answers to user questions.

[0013] The semantic cache library is used to cache the historical response records of the language model, which includes vector data and metadata of historical question and answer records of all users; each row in the semantic cache library represents a historical response record, wherein each row of historical responses includes: the semantic cache library row identifier, the vector representation of the historical question, the original text content of the question, the vector representation of the answer to the question, the original text content of the answer, and the question and answer related policy database row identifier.

[0014] The policy database is used to store vector data and metadata of policy documents, and includes one or more types of policy databases, all of which are implemented using vector data; each row in the policy database represents a policy document data information, wherein each row of policy document data information includes: policy database row identifier, vector representation of policy document, and original text content of policy document.

[0015] The policy documents stored in the policy database can be updated in real time. After the policy documents are updated, the historical question and answer records related to the original policy documents will be deleted.

[0016] The types of policy databases described include: dynamic information, government disclosure, administrative penalties, government contracts, information disclosure, office interpretation documents, department information, policy interpretation, transaction announcements, government bids, government procurement, state-owned listings, bid results, contract disclosures, and procurement announcements.

[0017] The relationship mapping database is used to represent the relationship between the semantic cache library and the policy database, and to achieve information synchronization between the semantic cache library and the policy database; each row in the relationship mapping database represents the correspondence between a policy file and the semantic cache library, and the correspondence of each row includes: policy database number, policy database row identifier, and semantic cache library row identifier.

[0018] The method for using the government affairs question answering system based on the retrieval-enhanced big model specifically includes the following steps:

[0019] S1. Create a policy database, vectorize the policy document text, add the vector data to the policy database, and add the original policy document text content as metadata, and create a new semantic cache library and relationship mapping database.

[0020] S2. After receiving the user's question, the user's question content is vectorized. The historical record matching module searches the semantic cache library based on the vectorized question. If the relevant historical question and answer records are retrieved, the answer in the record is returned directly to the user as the result, ending the processing flow for this question; if the relevant historical records are not retrieved, the question is sent to the first large model module.

[0021] S3, the first large model module first constructs prompt words about whether the question requires regional or administrative division information and policy documents, and guides the large model to determine whether regional or administrative division information and policy documents are needed;

[0022] If it is necessary to provide regional or administrative division information, the user is asked for the regional or administrative division information for the question. After obtaining the regional or administrative division information, the matching historical question record process of step S2 is executed. If no relevant historical records are retrieved, a prompt word for searching for policy databases is constructed in combination with the question and the obtained regional or administrative division information, and the large model is guided to generate a policy database query statement. According to the query statement, the policy query module queries the corresponding policy file from the policy database, and sends the question, regional or administrative division information and policy database query results to the second large model module;

[0023] If no region or administrative division information is needed, and no policy document is needed, the question is sent to the second largest model module;

[0024] If regional or administrative division information is not needed, but policy documents are needed, a prompt word for searching the policy database is constructed based on the question information to guide the large model to generate a policy database query statement. Based on the query statement, the policy query module queries the corresponding policy document from the policy database and sends the question and policy database query results to the second largest model module.

[0025] If a policy document is found in the query, the policy database where the policy document is located and the policy database row identifier are added as new records in the relational mapping database.

[0026] S4. The second model module constructs prompt words based on the processing results of the problem, region or administrative division information and policy database query:

[0027] For questions that do not involve regional or administrative division information, do not require policy documents, or require policy documents but no policy documents are found, construct prompt words for directly answering the questions;

[0028] For questions that do not involve regional or administrative division information, require policy documents, and have been found, construct prompts for answering questions based on the content of the provided policy documents;

[0029] For questions involving regional or administrative division information, which do not require policy documents or for which policy documents have not been found, construct prompt words for answering questions based on regional or administrative division information;

[0030] For questions involving regional or administrative division information, requiring policy documents and having found policy documents, construct prompt words for answering questions based on the content of the policy documents and regional or administrative division information provided;

[0031] Finally, the above prompt words are used as the input of the large model to guide the large model to generate answers to the questions based on the content of the prompt words.

[0032] S5. Vectorize the question and answer content. If it does not involve policy documents, add the question and answer vector data and the original text content as new records to the semantic cache library. If it involves policy documents, add the question and answer vector data, the original text content, the policy database where the relevant policy documents are located, and the policy database row identifier as new records to the semantic cache library, and add the semantic cache library row identifier to the relationship mapping database record created in step S3.

[0033] Beneficial effects of the present invention:

[0034] 1. In the government Q&A scenario, hot issues are asked multiple times by a large number of users. The semantic cache library is used to cache the historical response records of the language model. For user questions, we first try to match them in the historical Q&A records. If the match is successful, the large model is not called. This can effectively improve the system's response speed, save computing resources, and also improve the efficiency of answering.

[0035] 2. In order to solve the problem of knowledge update after the issuance of new policy documents, the content of the semantic cache library and the policy database is synchronized through a relational mapping database. After the policy document is updated, the historical question and answer records about this policy are deleted in a timely manner, taking into account the needs of resource conservation and real-time performance, and ensuring accurate answers to the latest policies.

[0036] 3. When different regions or administrative divisions have different policy documents or different implementation processes for the same policy or service, the first or second largest model is used to determine whether the question involves regional or administrative division information. Targeted answers can be generated for policy questions in different regions or administrative divisions, thereby improving the accuracy of the answers, expanding the system's cross-regional application scenarios, and making the government question-and-answer system based on the retrieval-enhanced large model more widely used.

[0037] 4. The present invention combines information on different regions or administrative divisions with policy documents, further improving the question-and-answer system in the government affairs field based on the retrieval-enhanced big model. When asking questions using the question-and-answer system, accurate answers based on information on different regions or administrative divisions and relevant policy documents can be given more conveniently and quickly. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a flow chart of the question-answering system in the government affairs field based on the retrieval-enhanced big model of the present invention, and this figure also serves as an abstract illustration.

[0039] Figure 2 It is a flowchart diagram of the database module in the present invention.

[0040] Figure 3 The present invention is a flowchart of a method for using the government affairs question-answering system based on a retrieval-enhanced large model. DETAILED DESCRIPTION

[0041] The present invention will be further described below in conjunction with the accompanying drawings.

[0042] A question-answering system in the government affairs field based on a retrieval-enhanced large model, such as Figure 1-2 As shown, it includes a database module, a history matching module, a first large model module, a policy query module, and a second large model module.

[0043] The database module includes a semantic cache library, a policy database and a relationship mapping database; the database module is used to store policy document data, cache historical question and answer records, associate historical question and answer records and related policy documents.

[0044] The history matching module is used to convert user questions into text form.

[0045] Specifically, the history record matching module is used to convert user questions into text form, and then convert the text into question vectors through sentence embedding or deep model, and then use the question vectors to search in the semantic cache library. The retrieval basis is distance or similarity. Records with a distance less than the set distance threshold or a similarity higher than the set similarity threshold are matched historical question and answer records.

[0046] The first large model module is a pre-trained large model with fewer parameters, which is used to construct prompt words about whether the problem requires regional or administrative division information and policy documents, and provide them to the first large model to generate results based on the prompt words. It combines the problem and the regional or administrative division information to construct prompt words about searching for policy databases, and guides the large model to generate policy database query statements.

[0047] The policy query module is used to use the policy database query statement generated by the first large model module according to the problem information to search for policy documents from the policy database.

[0048] The second largest model module is a pre-trained large model with more parameters. It is used to construct prompt words based on user questions, the results of the first large model module on whether regional or administrative division information is involved, and the results of the policy query module on whether policy documents are found. The second largest model module combines the regional or administrative division information and relevant policy documents to guide the large model to generate answers to user questions.

[0049] Through the first and second model modules, it is possible to determine whether a question involves regional information, and to generate targeted answers to policy questions in different regions, thus expanding the system's cross-regional application scenarios.

[0050] The semantic cache is used to cache the historical response records of the language model, which includes the vector data and metadata of the historical question and answer records of all users; each row in the semantic cache represents a historical response record, where each row of historical responses includes: semantic cache row identifier, vector representation of historical questions, original text content of questions, vector representation of answers to these questions, original text content of answers, and row identifier of the policy database related to questions and answers. For user questions, we first try to match them in the historical question and answer records. If the match is successful, we do not call the large model, which can effectively improve the system's response speed and save computing resources.

[0051] The policy database is used to store vector data and metadata of policy documents. It includes one or more types of policy databases, all of which are implemented using vector data. Each row in the policy database represents a policy document data information, and each row of policy document data information includes: policy database row identifier, vector representation of the policy document, and original text content of the policy document.

[0052] Specifically, the policy database includes dynamic information, government disclosure, administrative penalties, government contracts, information disclosure, office interpretation documents, department information, policy interpretation, transaction announcements, government bids, government procurement, state-owned listings, bid results, contract publicity, procurement announcements, but not limited to the above. According to different user questions, the corresponding accurate policy documents are given.

[0053] The policy documents stored in the policy database can be updated in real time. At the same time, after the policy documents are updated, the historical question and answer records related to the original policy documents will be deleted. After the policy documents are updated, the historical question and answer records about this policy will be deleted in a timely manner, taking into account the needs of saving resources and real-time performance, and ensuring accurate answers to the latest policies.

[0054] Specifically, for the knowledge update after the new policy document is issued in the policy database, the content synchronization of the new policy document in the semantic cache library and the policy database is achieved through the relational mapping database; at the same time, according to the corresponding policy database and the policy database row identifier, the relevant semantic cache library row identifier is retrieved in the relational mapping database, and the record corresponding to the row identifier is cleared, thereby completing the deletion of the historical question and answer records related to the original policy document.

[0055] The relational mapping database is used to represent the relationship between the semantic cache and the policy database, and to achieve information synchronization between the semantic cache and the policy database. Each row in the relational mapping database represents the correspondence between a policy document and the semantic cache, and the correspondence of each row includes: policy database number, policy database row ID, and semantic cache row ID. Through the relational mapping database, both resource conservation and real-time information synchronization requirements are taken into account.

[0056] The use of the question-answering system in the government affairs field based on the retrieval-enhanced large model, such as Figure 3 As shown, the specific steps include:

[0057] S1. Create a policy database, vectorize the policy document text, add the vector data to the policy database, and add the original policy document text content as metadata; create a new semantic cache library and relationship mapping database.

[0058] S2. After receiving the user's question, the user's question content is vectorized. The historical record matching module searches the semantic cache library based on the vectorized question. If the relevant historical question and answer records are retrieved, the answer in the record is returned directly to the user as the result, ending the processing flow for this question; if the relevant historical records are not retrieved, the question is sent to the first large model module.

[0059] S3, the first large model module first constructs prompt words about whether the question requires regional or administrative division information and policy documents, and guides the large model to determine whether regional or administrative division information and policy documents are needed;

[0060] Specifically, the prompt word template is: "Please analyze the following question raised by the user and make a judgment from two aspects: 1. Does the question need to be answered in combination with relevant regional information? If so, please ask the user for regional information; 2. Does the question need to refer to the content of relevant policy documents; Question: #question".

[0061] If it is necessary to provide regional or administrative division information, the user is asked for the regional or administrative division information for the question. After obtaining the regional or administrative division information, the matching historical question record process of step S2 is executed. If no relevant historical records are retrieved, a prompt word for searching for policy databases is constructed in combination with the question and the obtained regional or administrative division information, guiding the large model to generate a policy database query statement;

[0062] Specifically, the prompt word template is: "Please determine the relevant policy database based on the following user's question and regional information, and construct a corresponding policy database query statement. Question: #question, regional information: #region. In determining the relevant policy database, please consider the entire policy database range and ensure that the query statement can accurately locate the row identifier where the policy file is located. Please provide the following information: 1. Search results: If no relevant policy file is retrieved, please clearly indicate that no relevant policy file is retrieved. 2. Query statement: SQL query statement used to retrieve relevant information in the selected policy database."

[0063] According to the query statement, the policy query module queries the corresponding policy document from the policy database, and sends the question, region or administrative division information and policy database query results to the second largest model module;

[0064] If no region or administrative division information is needed, and no policy document is needed, the question is sent to the second largest model module;

[0065] If regional or administrative division information is not needed, but policy documents are needed, a prompt word for searching the policy database is constructed based on the question information to guide the large model to generate a policy database query statement. Based on the query statement, the policy query module queries the corresponding policy document from the policy database and sends the question and policy database query results to the second largest model module.

[0066] If a policy document is found in the query, the policy database where the policy document is located and the policy database row identifier are added as new records in the relational mapping database.

[0067] S4. The second model module constructs prompt words based on the processing results of the problem, region or administrative division information and policy database query:

[0068] For questions that do not involve regional or administrative division information, do not require policy documents, or require policy documents but no policy documents are found, construct prompt words for directly answering the questions;

[0069] Specifically, the prompt word template is: "Please give a direct answer based on the question raised by the following user, without considering regional information or policy document content, question#question".

[0070] For questions that do not involve regional or administrative division information, require policy documents, and have been found, construct prompts for answering questions based on the content of the provided policy documents;

[0071] Specifically, the prompt word template is: "Please answer the user's question based on the content of the policy document related to the question retrieved from the policy database. Question: #question, retrieved policy document content: #policy document. When answering, please carefully read and understand the content of the policy document to ensure that the answer is consistent with the provisions, requirements or explanations in the policy document. If the policy document clearly explains the user's question, please quote it directly. Please provide the following information: 1. Answers to questions, including relevant clauses or explanations in the policy document. 2. If the answer involves multiple aspects of the policy document or requires multiple clauses to explain, please provide a clear and logical explanation. 3. If the content of the policy document is not sufficient to fully answer the user's question, please point it out clearly and provide possible explanations."

[0072] For questions involving regional or administrative division information, which do not require policy documents or for which policy documents have not been found, construct prompt words for answering questions based on regional or administrative division information;

[0073] Specifically, the prompt word template is: "Please give answers based on the questions raised by the user and the regional information provided. Questions: #questions, regional information: #regions. When answering, please fully consider the importance of regional information to answering the questions. Please provide the following information: 1. Answers to user questions, 2. If further supplementary policy documents are required, please indicate as well."

[0074] For questions involving regional or administrative division information, requiring policy documents and having found policy documents, construct prompt words for answering questions based on the content of the policy documents and regional or administrative division information provided;

[0075] Specifically, the prompt word template is: "Please answer the questions raised by users based on the regional information provided and the relevant policy document content retrieved from the policy database. Question: #question, regional information: #region, retrieved policy document content: #policy document. When answering, please fully consider the impact of regional information on policy implementation and interpretation. Please make answers that conform to regional characteristics based on the actual regional situation and the specific terms and conditions in the policy documents. If the policy documents clearly explain the user's questions, please quote them directly. Please provide the following information: 1. Explain the answers to the questions in combination with the regional information and policy document content. 2. If the answer involves multiple aspects of the policy document or requires multiple clauses to explain, please make a clear and logical explanation. 3. If the content of the policy document is not sufficient to fully answer the user's question, please point it out clearly and provide possible explanations."

[0076] Finally, the above prompt words are used as the input of the large model to guide the large model to generate answers to the questions based on the content of the prompt words.

[0077] S5. Vectorize the question and answer content. If it does not involve policy documents, add the question and answer vector data and the original text content as new records to the semantic cache library. If it involves policy documents, add the question and answer vector data, the original text content, the policy database where the relevant policy documents are located, and the policy database row identifier as new records to the semantic cache library, and add the semantic cache library row identifier to the relationship mapping database record created in step S3.

Claims

1. A government affairs question-answering system based on a retrieval-enhanced large model, characterized by: It includes a database module, a historical record matching module, a first-largest model module, a policy query module, and a second-largest model module; The database module includes a semantic cache library, a policy database and a relationship mapping database; The database module is used to store policy document data, cache historical question and answer records, and associate historical question and answer records with relevant policy documents; The history matching module is used to convert the user's question into text form; The first large model module has a pre-trained large model with fewer parameters, which is used to construct prompt words about whether the question requires regional or administrative division information and policy documents, and provide the prompt words to the first large model to generate results based on the prompt words, and construct prompt words for searching for policy databases in combination with the question and regional or administrative division information, so as to guide the large model to generate policy database query statements; The policy query module is used to search for policy documents from the policy database using the policy database query statement generated by the first large model module according to the problem information; The second large model module is a pre-trained large model with more parameters, which is used to construct prompt words according to user questions, the results of the first large model module on whether regional or administrative division information is involved, and the results of the policy query module on whether policy documents are found, so that the second large model module combines the regional or administrative division information and relevant policy documents to guide the large model to generate answers to user questions.

2. The government affairs question-answering system based on the retrieval-enhanced big model according to claim 1 is characterized in that: The semantic cache library is used to cache the historical response records of the language model, which includes vector data and metadata of historical question and answer records of all users; each row in the semantic cache library represents a historical response record, wherein each row of historical responses includes: the semantic cache library row identifier, the vector representation of the historical question, the original text content of the question, the vector representation of the answer to the question, the original text content of the answer, and the question and answer related policy database row identifier.

3. The government affairs question-answering system based on the retrieval-enhanced large model according to claim 1 is characterized in that: The policy database is used to store vector data and metadata of policy documents, and includes one or more types of policy databases, all of which are implemented using vector data; Each row in the policy database represents a policy document data information, wherein each row of the policy document data information includes: a policy database row identifier, a vector representation of the policy document, and the original text content of the policy document.

4. The government affairs question-answering system based on the retrieval-enhanced large model according to claim 3 is characterized in that: The policy documents stored in the policy database can be updated in real time. After the policy documents are updated, the historical question and answer records related to the original policy documents will be deleted.

5. The government affairs question-answering system based on the retrieval-enhanced large model according to claim 3 is characterized in that: The types of policy databases described include: dynamic information, government disclosure, administrative penalties, government contracts, information disclosure, office interpretation documents, department information, policy interpretation, transaction announcements, government bids, government procurement, state-owned listings, bid results, contract disclosures, and procurement announcements.

6. The government affairs question-answering system based on the retrieval-enhanced big model according to claim 1 is characterized in that: The relationship mapping database is used to represent the relationship between the semantic cache library and the policy database, and to achieve information synchronization between the semantic cache library and the policy database; each row in the relationship mapping database represents the correspondence between a policy file and the semantic cache library, and the correspondence of each row includes: policy database number, policy database row identifier, and semantic cache library row identifier.

7. A method for using a government affairs question-answering system based on a retrieval-enhanced large model, characterized in that: The specific steps include: S1. Create a policy database, vectorize the policy document text, add the vector data to the policy database, and add the original policy document text content as metadata; create a new semantic cache library and relationship mapping database. S2. After receiving the user's question, the user's question content is vectorized. The historical record matching module searches the semantic cache library according to the vectorized question. If the relevant historical question and answer record is retrieved, the answer in the record is directly returned to the user as the result, and the processing flow for this question ends; If no relevant history is retrieved, the question is sent to the first large model module. S3, the first large model module first constructs prompt words about whether the question requires regional or administrative division information and policy documents, and guides the large model to determine whether regional or administrative division information and policy documents are needed; If it is necessary to provide regional or administrative division information, the user is asked for the regional or administrative division information for the question. After obtaining the regional or administrative division information, the matching historical question record process of step S2 is executed. If no relevant historical records are retrieved, a prompt word for searching for policy databases is constructed in combination with the question and the obtained regional or administrative division information, and the large model is guided to generate a policy database query statement. According to the query statement, the policy query module queries the corresponding policy file from the policy database, and sends the question, regional or administrative division information and policy database query results to the second large model module; If no region or administrative division information is needed, and no policy document is needed, the question is sent to the second largest model module; If regional or administrative division information is not needed, but policy documents are needed, a prompt word for searching the policy database is constructed based on the question information to guide the large model to generate a policy database query statement. Based on the query statement, the policy query module queries the corresponding policy document from the policy database and sends the question and policy database query results to the second largest model module. If a policy document is found in the query, the policy database where the policy document is located and the policy database row identifier are added as new records in the relational mapping database. S4. The second model module constructs prompt words based on the processing results of the problem, region or administrative division information and policy database query: For questions that do not involve regional or administrative division information, do not require policy documents, or require policy documents but no policy documents are found, construct prompt words for directly answering the questions; For questions that do not involve regional or administrative division information, require policy documents, and have been found, construct prompts for answering questions based on the content of the provided policy documents; For questions involving regional or administrative division information, which do not require policy documents or for which policy documents have not been found, construct prompt words for answering questions based on regional or administrative division information; For questions involving regional or administrative division information, requiring policy documents and having found policy documents, construct prompt words for answering questions based on the content of the policy documents and regional or administrative division information provided; Finally, the above prompt words are used as the input of the large model to guide the large model to generate answers to the questions based on the content of the prompt words. S5. Vectorize the question and answer content. If it does not involve policy documents, add the question and answer vector data and the original text content as new records to the semantic cache library. If it involves policy documents, add the question and answer vector data, the original text content, the policy database where the relevant policy documents are located, and the policy database row identifier as new records to the semantic cache library, and add the semantic cache library row identifier to the relationship mapping database record created in step S3.

Citation Information

Patent Citations

  • Multi-modal government affair question and answer method based on large model

    CN117171314A

Cited By

  • Data processing method, electronic equipment and computer storage medium

    CN119807507A

  • Government affair question and answer method and product based on knowledge enhancement large model

    CN120256598A

  • Utilizing artificial intelligence for data management and data visualization

    US12681929B1

  • Utilizing artificial intelligence for data management and data visualization

    US20260203435A1