Intelligent question-answering model training method for government affair industry and government affair question-answering method and system

By building the SPARQL training set and multi-stage processing architecture, the intelligent question-and-answer model of the government affairs industry is optimized, and the understanding deviation and inaccurate answers of the knowledge graph question-and-answer system are solved, and efficient, accurate and safe answer generation of government affairs question-and-answer questions are achieved.

CN120409689APending Publication Date: 2025-08-01SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510527663.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

When dealing with complex problems, existing knowledge graph question-and-answer systems often face problems such as deviations in understanding and inaccurate answers.

Method used

By constructing the SPARQL training set, the service guides of the government affairs industry are split and marked, and problems are processed using the RDF triple method, forming the SPARQL training set and data enhancement are carried out to train the intelligent question-and-answer model of the government affairs industry, including problem understanding, knowledge base matching, entity recognition, semantic analysis and answer generation modules, and combining the security rejection and answer rejection modules, targeted training tasks and loss functions are designed.

Benefits of technology

It improves the accuracy and efficiency of government affairs questions and answers, ensures the objectivity and accuracy of answers, avoids interference from subjective factors, and provides explainable and scalable solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120409689A_ABST
    Figure CN120409689A_ABST
Patent Text Reader

Abstract

The invention provides a training method of an intelligent question-answering model in the government affair industry, a government affair question-answering method and a government affair question-answering system. The training method comprises the following steps: splitting a service guide of the government affair industry according to entries; sPARQL query statements and questions and answers corresponding to the SPARQL query statements are constructed for each entry obtained after splitting, the questions are split in an RDF triple mode, and therefore entities and relations in the questions are labeled; an SPARQL training set is formed, the SPARQL training set comprises all sets of training samples corresponding to all the entries, and each set of training samples comprises an SPARQL query statement corresponding to the same entry, a split and labeled question and an answer with a label; and training an intelligent question and answer model of the government affair industry by using the SPARQL training set until the model converges. According to the invention, government affair answers can be provided for users more efficiently and accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present invention relate to network communication technologies, and in particular, to a method and system for training an intelligent question - answering model in the government affairs industry, and a government affairs question - answering method and system. Background Art

[0002] With the development of big data and artificial intelligence technologies, the government affairs industry has gradually built a huge knowledge graph to support more intelligent decision - making and services. However, existing knowledge graph question - answering systems often face problems such as understanding deviation and inaccurate answers when dealing with complex questions.

[0003] Therefore, a more efficient and accurate implementation method for government affairs question - answering is needed. Summary of the Invention

[0004] One or more embodiments of the present invention describe a method and system for training an intelligent question - answering model in the government affairs industry, and a government affairs question - answering method and system, which can provide government affairs answers to users more efficiently and accurately.

[0005] According to a first aspect, a method for training an intelligent question - answering model in the government affairs industry is provided. The method includes:

[0006] Obtain the service guides in the government affairs industry;

[0007] Split the service guides according to the entries;

[0008] For each split entry, construct a SPARQL query statement and its corresponding question and answer;

[0009] For each constructed question, disassemble the question in the form of RDF (subject - predicate - object) triples, so as to label the entities and relationships in the question;

[0010] For each constructed answer, set a corresponding label for the answer;

[0011] Form a SPARQL training set. The SPARQL training set includes groups of training samples corresponding to each entry. Each group of training samples includes: a SPARQL query statement corresponding to the same entry, the disassembled and labeled question, and the answer with a set label;

[0012] Use the SPARQL training set to train the intelligent question - answering model in the government affairs industry until the model converges.

[0013] After splitting the service guide by item and before constructing the SPARQL query statement and its corresponding questions and answers, it further includes: performing at least one of removing duplicates, correcting format errors, and handling missing values on each of the split items.

[0014] After forming the SPARQL training set, it further includes:

[0015] Performing data augmentation on the SPARQL training set using at least one of synonym replacement, sentence restructuring, and question transformation.

[0016] The intelligent question - answering model for the government affairs industry includes:

[0017] A question understanding module, which is used to receive a question, extract and output the RDF information in the question;

[0018] A knowledge base matching module, which is used to pass the original service guide after splitting into the knowledge base, then match the RDF information output by the question understanding module, generate an embedding representation, and retrieve based on this embedding representation to select the top N documents in the retrieval results; N is a natural number greater than 0;

[0019] An entity recognition and relationship extraction module, which is used to further analyze the question and the knowledge base matching result on the basis of knowledge base matching, identify the RDF relationship, and perform entity annotation on the question and the answer according to the user's question and the information matched by the question in the knowledge base.

[0020] A semantic parsing module, which is used to convert the question into a logical expression or query statement that can be understood by a machine;

[0021] An answer generation and verification module, which is used to extract and summarize the answer according to the output of the semantic parsing module and the result of knowledge base matching; organize the entity names, relationship labels, and attribute values included in the answer into sentences or lists according to the predetermined grammar rules, and add punctuation marks and format tags.

[0022] The intelligent question - answering model for the government affairs industry further includes: an answer template library, which is used to provide a unified standard and framework for the formatted output of answers;

[0023] When generating an answer, the answer generation and verification module automatically selects a template from the answer template library according to the query type and query result to fill and render the answer output to the user.

[0024] The intelligent question - answering model for the government affairs industry further includes: a security rejection recognition and rejection answering module;

[0025] When the confidence of the model's answer to a question is lower than a preset threshold, the security rejection recognition and rejection module is triggered to perform security detection on the received question and the answer to be output. By establishing a risk question library and a keyword filtering mechanism, questions that conform to predetermined rules are identified and refused to be answered.

[0026] The method further includes:

[0027] According to different categories of questions and query patterns in the SPARQL training set, different training tasks and loss functions for the model are designed. Among them, for questions that conform to preset complex queries, the training weights of the relation extraction and semantic parsing modules are increased in the model; for questions that conform to preset simple fact-based questions, the training weights of question understanding and knowledge base matching are increased in the model.

[0028] According to a second aspect, a government affairs question answering method is provided.

[0029] Receive a question about a government affair input by a user;

[0030] Input the question into the intelligent question answering model of the government affairs industry trained by the method of the embodiments of the present invention;

[0031] The intelligent question answering model of the government affairs industry performs question understanding and knowledge base matching;

[0032] The intelligent question answering model of the government affairs industry performs entity recognition and relation extraction;

[0033] The intelligent question answering model of the government affairs industry performs semantic parsing and answer generation and verification;

[0034] The intelligent question answering model of the government affairs industry performs security detection and answer output.

[0035] According to a third aspect, a training system for an intelligent question answering model of the government affairs industry is provided. The system includes:

[0036] An SPARQL training set generation module, which is used to obtain the service guides of the government affairs industry; split the service guides according to items; for each split item, construct an SPARQL query statement and its corresponding question and answer; for each constructed question, disassemble the question in the form of RDF (subject-predicate-object) triples, so as to label the entities and relations in the question; for each constructed answer, set a corresponding label for the answer; form an SPARQL training set, and the SPARQL training set includes groups of training samples corresponding to each item. Each group of training samples includes: an SPARQL query statement corresponding to the same item, the disassembled and labeled question, and the answer with a label set.

[0037] A training execution module, which is used to train an intelligent question-answering model for the government affairs industry using a SPARQL training set until the model converges.

[0038] According to a fourth aspect, a government affairs question-answering system is provided. The system includes:

[0039] A user interface module, which is used to receive a question about a government affair input by a user; input the question into an intelligent question-answering model for the government affairs industry trained by the system according to an embodiment of the present invention.

[0040] An intelligent question-answering model for the government affairs industry, which is used to perform question understanding and knowledge base matching, entity recognition and relationship extraction, semantic parsing and answer generation and verification, and security detection and answer output.

[0041] It can be seen that in various embodiments of the present invention, SPARQL statements are used to split the natural language questions of users, and each part is corresponded to the document content provided by the users, and the required module is returned. Using this method, problems such as deviation in understanding problems existing in the model, inaccurate returned answers, and inconsistent returned answers multiple times can be optimized. After training an intelligent question-answering model for the government affairs industry in an embodiment of the present invention, using the model for subsequent government affairs question-answering can improve the accuracy of question-answering: through special training with a SPARQL training set, the model can more accurately understand questions in the government affairs field and accurately extract relevant information in the knowledge base as answers. Moreover, it is further ensured that the answers all directly come from the given knowledge base, effectively avoiding the interference of subjective factors and ensuring the objectivity and accuracy of the answers. By combining symbolic reasoning with AI, SPARQL provides an interpretable and extensible solution for complex question understanding and splitting. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0043] Figure 1 It is a flowchart of a training method for an intelligent question-answering model for the government affairs industry in an embodiment of the present invention.

[0044] Figure 2 It is a flowchart of a government affairs question-answering method in an embodiment of the present invention.

[0045] Figure 3 It is a schematic structural diagram of a training system for an intelligent question-answering model for the government affairs industry in an embodiment of the present invention.

[0046] Figure 4 It is a schematic structural diagram of a government affairs Q&A system in an embodiment of the present invention. Detailed implementation manners

[0047] The following describes the solution provided by the present invention with reference to the accompanying drawings.

[0048] First of all, it should be noted that the terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms of "a", "the" and "said" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0049] It should be understood that the term " / and" used herein is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.

[0050] The present invention starts from the training set and relates to a government affairs industry knowledge graph Q&A system based on the SPARQL training set, aiming to optimize the model's ability to understand and split questions through the SPARQL training set, solidify the problem splitting strategy of the model, and improve the accuracy and efficiency of the government affairs field knowledge graph Q&A system. In the embodiments of the present invention, the SPARQL statement training set is used to enhance the model's ability to deconstruct questions and reorganize answers, without directly generating SPARQL query statements, ensuring that the answers are strictly based on the objective facts in the given knowledge base, and the generated answers are stable, without the situation of inconsistent answers to multiple questions, effectively supporting the efficient response of government affairs decision-making and services.

[0051] Figure 1 It is a flowchart of a training method for an intelligent Q&A model in the government affairs industry in an embodiment of the present invention. Refer to Figure 1 The training method for the intelligent Q&A model in the government affairs industry includes:

[0052] Step 101: Obtain the service guides in the government affairs industry;

[0053] Step 103: Split the service guides according to the entries;

[0054] Step 105: For each of the split entries, construct a SPARQL query statement and its corresponding question and answer;

[0055] Step 107: For each of the constructed questions, disassemble the question in the form of RDF (subject-predicate-object) triples, so as to label the entities and relationships in the question;

[0056] Step 109: Set corresponding tags for each constructed answer.

[0057] Step 111: Form a SPARQL training set, which includes groups of training samples corresponding to each entry. Each group of training samples includes: the SPARQL query statement corresponding to the same entry, the disassembled and annotated question, and the answer with tags set.

[0058] Step 113: Use the SPARQL training set to train the intelligent question-answering model for the government affairs industry until the model converges.

[0059] The SPARQL statement is a standard query language for querying and obtaining RDF (subject-predicate-object) data. In Figure 1 the embodiment of the present invention shown, the SPARQL statement is used to split the natural language question of the user, correspond each part to the document content provided by the user, and return the required module. Using this method can optimize the understanding problem deviation existing in the model, the problem that the returned answer is inaccurate, and the problem that the returned answers are inconsistent multiple times.

[0060] In the embodiment of the present invention, after Figure 1 training the intelligent question-answering model for the government affairs industry by the method shown, using this model for subsequent government affairs question-answering can improve the accuracy of question-answering: through the special training of the SPARQL training set, the model can more accurately understand the questions in the government affairs field and accurately extract relevant information in the knowledge base as the answer. Moreover, it further ensures that the answers all directly come from the given knowledge base, effectively avoiding the interference of subjective factors and ensuring the objectivity and accuracy of the answers. SPARQL provides an interpretable and extensible solution for complex problem understanding and splitting by combining symbolic reasoning with AI.

[0061] After splitting the service guide by entry in step 103 and before step 105, it further includes data cleaning processing, such as performing step 104: performing at least one of removing duplicate items, correcting format errors, and processing missing values on each split entry.

[0062] After step 111 and before step 113, it further includes step 112: performing data augmentation processing on the SPARQL training set using at least one of synonym replacement, sentence restructuring, and question transformation.

[0063] In an embodiment of the present invention, the intelligent question-answering model for the government affairs industry may include:

[0064] A question understanding module, configured to receive a question, extract and output the RDF information in the question.

[0065] The knowledge base matching module is used to transmit the original service guide after splitting into the knowledge base, and then match the RDF information output by the problem understanding module to generate an embedding representation, and retrieve according to this embedding representation, and select the top N documents in the retrieval results; N is a natural number greater than 0;

[0066] The entity recognition and relationship extraction module is used to further analyze the problem and the knowledge base matching result on the basis of knowledge base matching, identify the RDF relationship, and perform entity annotation on the problem and the answer according to the user's problem and the information matched in the knowledge base.

[0067] The semantic parsing module is used to convert the problem into a logical expression or query statement that can be understood by a machine.

[0068] The answer generation and verification module is used to extract and summarize the answer according to the output of the semantic parsing module and the result of knowledge base matching; organize the entity names, relationship labels, and attribute values included in the answer into sentences or lists according to predetermined syntax rules, and add punctuation marks and format tags.

[0069] In an embodiment of the present invention, the intelligent question answering model in the government affairs industry further includes: an answer template library, which is used to provide a unified standard and framework for the formatted output of the answer;

[0070] When generating an answer, the answer generation and verification module automatically selects a template in the answer template library to fill and render the answer output to the user according to the query type and query result.

[0071] In an embodiment of the present invention, the intelligent question answering model in the government affairs industry further includes: a security rejection recognition and rejection answering module;

[0072] When the confidence level of the model's answer to a question is lower than a preset threshold, the security rejection recognition and rejection answering module is triggered, which is used to perform security detection on the received question and the answer to be output, and identify and reject answering questions that meet the predetermined rules by establishing a risk question library and a keyword filtering mechanism.

[0073] In an embodiment of the present invention, Figure 1 The shown training method further includes:

[0074] According to different types of questions and query patterns in the SPARQL training set, different training tasks and loss functions for the model are designed. Among them, for questions that meet the preset complex queries, the training weights of the relationship extraction and semantic parsing modules are increased in the model; for questions that meet the preset simple fact types, the training weights of the problem understanding and knowledge base matching are increased in the model.

[0075] Based on the above description, the training method flow of the intelligent question - answering model for the government affairs industry in the following manner can be further obtained:

[0076] I. Construction, optimization, and model fine - tuning of the SPARQL training set.

[0077] First, data collection and cleaning are carried out:

[0078] First, obtain the service guide from the customer, split the service guide by item, and manually construct SPARQL query statements and their corresponding questions and answers for the split items. The collected data often contains noise and redundant information, so data cleaning is required, including removing duplicates, correcting format errors, handling missing values, etc., to ensure the quality of the training set. The constructed questions should be as comprehensive as possible to cover the real question - answering situations in normal usage scenarios.

[0079] Secondly, annotation and classification are carried out:

[0080] To improve the training effect of the model, fine - grained annotation and classification are performed on the collected data. The annotation work mainly includes annotating entities and relationships in the questions, and assigning appropriate labels or types to the answers. Classification divides the training set into different subsets according to the complexity of the questions and query patterns, so as to improve the model's ability in stages and targeted manner during the training process.

[0081] Then, training set enhancement is carried out:

[0082] To enhance the generalization ability of the model, data augmentation techniques are used to expand the training set. This includes but is not limited to strategies such as synonym replacement, sentence restructuring, question transformation, etc., to simulate diverse query scenarios in the real world.

[0083] Finally, the model training step is carried out:

[0084] The transform architecture model is trained and fine - tuned using the full - parameter training and fine - tuning method to obtain better results.

[0085] II. Model architecture design

[0086] First, a multi - stage processing model is formed:

[0087] The model of the present invention adopts a multi - stage processing architecture, where each stage is responsible for different tasks and collaborates to complete the question - answering process. Specifically, the model includes the following key modules:

[0088] Question understanding module: Responsible for receiving the Chinese question input by the user, performing preliminary natural language processing, including word segmentation, part - of - speech tagging, syntactic analysis, etc., to extract key information in the question.

[0089] Knowledge Base Matching Module (BGE-reranker): The original service guide after splitting is passed into the knowledge base, and then the content output by the question understanding module is matched. BGE-reranker first uses Bi-Encoder to quickly generate the embedding representations of the query and the documents, and conducts a preliminary retrieval based on these representations. Next, it will select the top N documents from the preliminary retrieval results, where N is a natural number greater than 0; and use Cross-Encoder for more refined ranking. This can not only ensure the retrieval speed but also improve the relevance and quality of the final results, and screen out the potentially relevant entities and relationships.

[0090] Entity Recognition and Relationship Extraction Module: Based on the knowledge base matching, it further deeply analyzes the question and the knowledge base matching results to identify specific entities and the relationships between them. Using the trained transform large model, the user's question and the information matched by the question in the knowledge base are passed in, and entity annotation is performed on the question and the answer.

[0091] Semantic Parsing Module: Transforms the question into a logical expression or query statement that can be understood by the machine. Although the model in the embodiments of the present invention may not directly generate SPARQL statements, the semantic parsing module will simulate the construction process of SPARQL queries, and transform the entities, relationships, and constraint conditions in the question into an internal representation for subsequent modules to extract answers.

[0092] Answer Generation and Verification Module: According to the output of the semantic parsing module and the results of the knowledge base matching, use the large model to extract and summarize the answers. During the answer generation process, the model will consider the integrity, accuracy, and relevance of the answers. At the same time, the answer verification module will verify the generated answers to ensure that the answers meet the requirements of the question and are directly derived from the given knowledge base.

[0093] After extracting the relevant information, the answer generation module also needs to format this information into a form that is easy for users to understand for output. This includes organizing the entity names, relationship labels, and attribute values into sentences or lists according to certain grammar rules, as well as adding necessary punctuation marks and format tags.

[0094] To ensure the accuracy and standardization of the output answers, a set of answer template libraries are established. These templates cover common questions and query types in the government affairs field, providing a unified standard and framework for the formatted output of answers. When generating answers, the system will automatically select the appropriate template for filling and rendering according to the query type and query results.

[0095] Security Rejection Recognition and Rejection Module: Before the large model accepts a question and outputs an answer, security detection is carried out. By establishing a risk question library and a keyword filtering mechanism, it can identify and reject questions that may cause social unrest, mislead the public, or violate laws and regulations. For example, questions involving false information or inflammatory remarks will be regarded as risk questions. This helps to protect the safety of users and society. When the confidence level of the model's answer to a certain question is lower than the preset threshold, the security rejection recognition and rejection module will be triggered.

[0096] Among them, the inter-module cooperation mechanism includes:

[0097] Each module realizes collaborative work through data transfer and status sharing. For example, the output of the question understanding module is used as the input of the knowledge base matching module; the result of the knowledge base matching will in turn affect the processing of the entity recognition and relationship extraction module; and the semantic parsing module constructs the query logic based on the outputs of the previous two modules; finally, the answer generation and verification module synthesizes all the information to generate the final answer.

[0098] III. Training Strategy Optimization

[0099] First, targeted training

[0100] In view of the particularity and complexity of the government affairs field, a targeted training strategy is adopted to improve the performance of the model. Specifically, according to different types of questions and query patterns in the training set, different training tasks and loss functions are designed. For example, for complex query questions, the training weights of the relationship extraction and semantic parsing modules are increased; for simple factual questions, more emphasis is placed on the training of question understanding and knowledge base matching.

[0101] Second, reinforcement learning and transfer learning

[0102] In order to further improve the generalization ability and robustness of the model, reinforcement learning and transfer learning technologies are introduced. Reinforcement learning allows the model to optimize its own behavior through trial and error during the training process, so as to find more effective query strategies and answer generation methods. Transfer learning uses the model parameters that have been trained in other fields or tasks as a starting point to accelerate the convergence process of the model in the government affairs field and reduce the dependence on new data.

[0103] Finally, establish an iterative optimization and feedback mechanism

[0104] An iterative optimization and feedback mechanism is established to continuously optimize the model by continuously collecting user feedback and new query data. Whenever new data is added, a part or all of the model will be retrained to adapt to new query patterns and question types. At the same time, user feedback is also used to evaluate the performance of the model, and the training strategy is adjusted to further improve the accuracy of the question-and-answer system and the user experience.

[0105] An embodiment of the present invention provides a government affairs question-answering method. Refer to Figure 2 , the method includes:

[0106] Step 201: Receive a question about a government affair input by a user;

[0107] Step 203: Input the question into the intelligent question-answering model of the government affairs industry trained by the method of the embodiment of the present invention shown in Figure 1 ;

[0108] Step 205: Have the intelligent question-answering model of the government affairs industry perform question understanding and knowledge base matching;

[0109] Step 207: Have the intelligent question-answering model of the government affairs industry perform entity recognition and relationship extraction;

[0110] Step 209: Have the intelligent question-answering model of the government affairs industry perform semantic parsing and answer generation and verification;

[0111] Step 211: Have the intelligent question-answering model of the government affairs industry perform security detection and answer output.

[0112] The following is an example.

[0113] For example, the government affairs system of a certain city provides a "Guide for Enterprise Incorporation", which includes the following content (simplified version):

[0114] 1. Pre-approval of enterprise name

[0115] - Prerequisite: None

[0116] - Required materials: ID card, enterprise name application form

[0117] - Handling department: Market Supervision Bureau

[0118] 2. Submission of industrial and commercial registration materials

[0119] - Prerequisite: Name has been approved

[0120] - Required materials: Articles of association, shareholder identification, business premise certificate

[0121] - Handling department: Market Supervision Bureau

[0122] 3. Obtain business license

[0123] - Prerequisite: Materials have passed the review

[0124] - Required materials: Acceptance receipt

[0125] - Handling department: Government Affairs Hall

[0126] 4. Seal engraving and filing

[0127] - Prerequisite: Business license has been obtained.

[0128] - Required materials: Copy of business license, legal person's ID card

[0129] - Handling department: Public Security Bureau

[0130] In the embodiment of the present invention, the following steps are executed:

[0131] Step 1: Convert the above "Enterprise startup" guide to RDF triples and construct a structured knowledge graph.

[0132] Step 2: Use SPARQL to achieve problem splitting and dynamic reconstruction.

[0133] Suppose the user asks: "I have approved the enterprise name, but I don't have a business premise certificate for the time being. How should I handle it?"

[0134] 2.1 Understand the user's needs, split the problem, and through SPARQL query, disassemble the user's problem into:

[0135] Current status: Completed;

[0136] Missing materials: Business premise certificate;

[0137] Goal: Complete the subsequent process.

[0138] 2.2 Dynamically generate solutions and use SPARQL query for process reconstruction.

[0139] Step 3: Generate a user-friendly answer.

[0140] Combined with the SPARQL query results, the following dynamic guide can be generated and provided to the user:

[0141] Hello! According to your situation:

[0142] 1. Current progress: You have completed "Pre-approval of enterprise name".

[0143] 2. Impact of missing materials: Without the "Business premise certificate", you cannot directly "Submit industrial and commercial registration materials".

[0144] 3. Steps that can be continued:

[0145] - Obtain a business license (after the materials are reviewed and approved, bring the acceptance receipt to the government affairs hall).

[0146] - Seal engraving and record-filing (to be handled after obtaining the business license).

[0147] 4. Suggested solutions:

[0148] - Option 1: Continue to complete the industrial and commercial registration after submitting the "Business Premises Certificate".

[0149] - Option 2: Consult the Market Supervision Bureau to see if it can be replaced with a "Temporary Business Premises Commitment Letter" (SPARQL extended query of the policy library is required).

[0150] It can be seen that by converting the service guide into a knowledge graph and utilizing the semantic query ability of SPARQL, the government affairs system can significantly improve the accuracy and flexibility of government affairs Q&A, while reducing the maintenance cost (modifying the guide only requires updating the RDF data without reconstructing the code).

[0151] An embodiment of the present invention proposes a training system for an intelligent Q&A model in the government affairs industry. Refer to Figure 3 and this system includes:

[0152] The SPARQL training set generation module 301 is used to obtain the service guide of the government affairs industry; split the service guide by item; for each split item, construct a SPARQL query statement and its corresponding question and answer; for each constructed question, disassemble the question in the form of RDF (subject-predicate-object) triples, so as to label the entities and relationships in the question; for each constructed answer, set a corresponding label for the answer; form a SPARQL training set, and the SPARQL training set includes groups of training samples corresponding to each item. Each group of training samples includes: the SPARQL query statement corresponding to the same item, the disassembled and labeled question, and the answer with a label set.

[0153] The training execution module 302 is used to train the intelligent Q&A model of the government affairs industry using the SPARQL training set until the model converges.

[0154] Refer to Figure 4 An embodiment of the present invention proposes a government affairs Q&A system. Refer to Figure 4 and this system includes:

[0155] The user interface module 401 is used to receive the question input by the user for a government affair; input the question into the intelligent Q&A model of the government affairs industry trained by the system of the embodiment of the present invention.

[0156] The intelligent Q&A model 402 of the government affairs industry is used to perform question understanding and knowledge base matching, entity recognition and relationship extraction, semantic parsing and answer generation and verification, and security detection and answer output.

[0157] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer is caused to execute the method in any one of the embodiments in the specification.

[0158] An embodiment of the present invention provides a computing device, including a memory and a processor. An executable code is stored in the memory. When the processor executes the executable code, the method in any one of the embodiments in the specification is implemented.

[0159] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the device of the embodiments of the present invention. In other embodiments of the specification, the above device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure can be implemented by hardware, software, or a combination of software and hardware.

[0160] The various embodiments in the present invention are described in a progressive manner. The same or similar parts among the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.

[0161] Those skilled in the art should be able to realize that in the above one or more examples, the functions described in the present invention can be implemented by hardware, software, add-ons, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0162] The specific embodiments described above further elaborate on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above is only the specific embodiments of the present invention and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the protection scope of the present invention.

Claims

1. A training method for an intelligent question answering model in the government affairs industry, characterized in that, The method includes: Obtaining the service guides of the government affairs industry; Splitting the service guides into items; For each of the split items, constructing a SPARQL query statement and its corresponding question and answer; For each constructed question, disassembling the question in the form of RDF triples to label the entities and relationships in the question; For each constructed answer, setting a corresponding label for the answer; Forming a SPARQL training set, which includes groups of training samples corresponding to each item. Each group of training samples includes: the SPARQL query statement corresponding to the same item, the disassembled and labeled question, and the answer with a label set; Training the intelligent question-answering model of the government affairs industry using the SPARQL training set until the model converges.

2. The method according to claim 1, wherein After splitting the service guides into items and before constructing the SPARQL query statement and its corresponding question and answer, it further includes: performing at least one of removing duplicate items, correcting format errors, and handling missing values on the split items.

3. The method according to claim 1, characterized in that, After forming the SPARQL training set, it further includes: Performing data augmentation processing on the SPARQL training set using at least one of synonym replacement, sentence restructuring, and question transformation.

4. The method according to claim 1, wherein The intelligent question-answering model of the government affairs industry includes: A question understanding module for receiving a question, extracting and outputting the RDF information in the question; A knowledge base matching module for passing the original service guide after splitting into the knowledge base, then matching the RDF information output by the question understanding module, generating an embedding representation, and retrieving based on the embedding representation to select the top N documents in the retrieval results; N is a natural number greater than 0; An entity recognition and relationship extraction module for further parsing the question and the knowledge base matching result on the basis of knowledge base matching, identifying the RDF relationship, and performing entity annotation on the question and answer according to the user's question and the information matched by the question in the knowledge base; A semantic parsing module for converting the question into a machine-understandable logical expression or query statement; An answer generation and verification module for extracting and summarizing the answer according to the output of the semantic parsing module and the result of knowledge base matching; organizing the entity names, relationship labels, and attribute values included in the answer into sentences or lists according to the predetermined grammar rules, and adding punctuation marks and format tags.

5. The method according to claim 4, characterized in that, The intelligent question-answering model of the government affairs industry further includes: an answer template library for providing a unified standard and framework for the formatted output of the answer; When generating an answer, the answer generation and verification module automatically selects a template in the answer template library to fill and render the answer output to the user according to the query type and query result.

6. The method according to claim 4, characterized in that The intelligent question-answering model of the government affairs industry further includes: a security rejection recognition and rejection answer module; When the confidence level of the answer to a question is lower than a preset threshold, the security rejection recognition and rejection module is triggered to perform security detection on the received question and the answer to be output. By establishing a risk question library and a keyword filtering mechanism, questions that conform to the predetermined rules are identified and answered rejected.

7. The method according to claim 1, characterized in that, The method further includes: According to different categories of questions and query patterns in the SPARQL training set, different training tasks and loss functions for the model are designed. Among them, for questions that conform to the preset complex queries, the training weights of the relation extraction and semantic parsing modules are increased in the model; for questions that conform to the preset simple fact type, the training weights of question understanding and knowledge base matching are increased in the model.

8. A government affairs question answering method, characterized in that Receiving a question about a government affair input by a user; Inputting the question into an intelligent question answering model for the government affairs industry trained by the method described in any one of claims 1 to 7; Performing question understanding and knowledge base matching by the intelligent question answering model for the government affairs industry; Performing entity recognition and relation extraction by the intelligent question answering model for the government affairs industry; Performing semantic parsing and answer generation and verification by the intelligent question answering model for the government affairs industry; Performing security detection and answer output by the intelligent question answering model for the government affairs industry.

9. A training system for an intelligent question-answering model in the government affairs industry, characterized in that, The system includes: An SPARQL training set generation module, which is used to obtain the service guides for the government affairs industry; split the service guides according to the entries; for each of the split entries, construct an SPARQL query statement and its corresponding question and answer; for each of the constructed questions, disassemble the question in the form of RDF triples, so as to label the entities and relationships in the question; for each of the constructed answers, set a corresponding label for the answer; form an SPARQL training set, and the SPARQL training set includes groups of training samples corresponding to each entry, and each group of training samples includes: the SPARQL query statement corresponding to the same entry, the disassembled and labeled question, and the answer with the label set; A training execution module, which is used to train an intelligent question answering model for the government affairs industry by using the SPARQL training set until the model converges.

10. Government Affairs Q&A System, characterized in that, The system includes: A user interface module, which is used to receive a question about a government affair input by a user; input the question into an intelligent question answering model for the government affairs industry trained by the system described in claim 9; An intelligent question answering model for the government affairs industry, which is used to perform question understanding and knowledge base matching, perform entity recognition and relation extraction, perform semantic parsing and answer generation and verification, and perform security detection and answer output.