Regulation question and answer generation method, system and readable storage medium

CN122885145APending Publication Date: 2026-10-09CHINA UNICOM (LIAONING) IND INTERNET CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611384008.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

但由于系统无法判断被召回文件是否已废止、被替代或仅在历史时间有效,进而导致用户存在误用过期文件的风险

Benefits of technology

[0018]本发明第三方面提供了一种规章制度的问答生成系统,包括存储器和处理器,存储器存储可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如上述任一技术方案的规章制度的问答生成方法的步骤。因此该规章制度的问答生成系统具备如上述任一技术方案的规章制度的问答生成方法的全部有益效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122885145A_ABST
    Figure CN122885145A_ABST
Patent Text Reader

Abstract

The application provides a rule question and answer generation method, system and readable storage medium, and relates to the technical field of computer systems. The rule question and answer generation method comprises the following steps: obtaining a rule document; generating document metadata based on the rule document; obtaining relationship information based on the rule document; generating a document blood relationship graph based on the relationship information; receiving a question and answer instruction from a user; generating a query state object based on the question and answer instruction; performing multi-path recall based on the query state object to obtain an initial candidate document set; expanding the initial candidate document set based on the document blood relationship graph to obtain an expanded candidate document set; determining the effectiveness of the candidate documents in the expanded candidate document set based on the target time of the query state object, the document metadata and the document blood relationship graph; and outputting a question and answer result. The method reduces the probability of misusing outdated documents or replaced documents in rule question and answer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer system technology, and more specifically, to a question-and-answer generation method, system, and readable storage medium for regulations. Background Technology

[0002] Currently, with the increasing number of documents such as internal management systems, departmental procedures, job specifications, and human resource management methods, users need to accurately query the applicable rules and regulations for a certain matter at the current or historical point in time in scenarios such as talent selection, personnel allocation, job matching, job level recognition, and historical system tracing.

[0003] In related technologies, when querying relevant regulations and systems, text matching models such as inverted indexes and BM25 are used to retrieve documents based on the literal matching relationship between user-input keywords and file names or content. However, because the system cannot determine whether the retrieved file has been abolished, replaced, or was only valid in the past, there is a risk that users may misuse expired files. Summary of the Invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.

[0005] Therefore, the first aspect of the present invention proposes a question-and-answer generation method for rules and regulations.

[0006] The second and third aspects of the present invention each propose a question-and-answer generation system for regulations.

[0007] A fourth aspect of the present invention provides a readable storage medium.

[0008] In view of this, a first aspect of the present invention provides a question-and-answer generation method for rules and regulations, comprising: obtaining a rules and regulations document; generating document metadata based on the rules and regulations document; obtaining relationship information based on the document text, title, appendix, repeal notice, revision notice, and cited clauses of the rules and regulations document, wherein the relationship information includes relationship types including substitution, being substituted, revision, repeal, citation, basis, superior system, subordinate detailed rules, and supporting relationship; generating a document lineage diagram based on the relationship information; receiving a question-and-answer instruction from a user; generating a query status object based on the question-and-answer instruction; performing multi-way recall based on the query status object to obtain an initial candidate document set; expanding the initial candidate document set based on the document lineage diagram to obtain an expanded candidate document set; determining the validity of candidate documents in the expanded candidate document set based on the target time, document metadata, and document lineage diagram of the query status object; and outputting question-and-answer results based on the validity of the candidate documents.

[0009] In this technical solution, the method is executed in a fixed sequence: acquiring regulatory documents, generating file metadata, generating a file lineage graph, receiving question-and-answer instructions, generating query status objects, obtaining an initial candidate file set through multi-path recall, expanding the candidate file set based on the file lineage graph, jointly determining validity from multiple data sources, and outputting question-and-answer results based on the validity of the candidate files. It relies on the file lineage graph to supplement and expand the candidate files with related versions, and on the query target time, file metadata, and file lineage relationships. Figure 3 The collaborative use of class data completes the hierarchical verification of the validity of candidate documents, reducing the probability of misusing expired or replaced documents in Q&A on rules and regulations. It solves the technical problem in the background technology that traditional keyword retrieval cannot identify the replacement relationship of document versions and cannot determine the validity of document timeliness, thus leading to the risk of users misusing expired documents.

[0010] In some technical solutions of the present invention, optionally, after determining the validity of candidate files in the extended candidate file set, the question-answer generation method further includes: performing metadata matching verification on the candidate files in the extended candidate file set; and performing intention verification on the candidate files in the extended candidate file set. Figure 1 Consistency verification; evidence availability verification of candidate files in the extended candidate file set; consistency verification of stage results for candidate files in the extended candidate file set; metadata matching verification; and intention verification. Figure 1 The verification results of consistency verification, evidence availability verification, and phase result consistency verification are recorded and / or the status of candidate files in the extended candidate file set is updated.

[0011] Optionally, in some technical solutions of the present invention, the question-and-answer generation method further includes: performing a consistency check on the question-and-answer results.

[0012] In some technical solutions of the present invention, optionally, generating document metadata based on rules and regulations documents includes: obtaining basic information of the rules and regulations documents based on the rules and regulations documents, the basic information of the rules and regulations documents including document name, document font size, issuing entity, publication date, effective start time, effective end time, applicable department, applicable job sequence, applicable job level range, personnel category, business tag, and text content; parsing the basic information to obtain document metadata.

[0013] In some technical solutions of the present invention, optionally, generating a query status object based on a question-and-answer instruction includes: calling a question parsing module to parse the question-and-answer instruction to obtain the question intent, target time, business tags, and metadata constraints of the question-and-answer instruction; and generating a query status object based on the question intent, target time, business tags, and metadata constraints.

[0014] In some technical solutions of the present invention, optionally, multi-path recall is performed based on the query status object to obtain an initial candidate file set, including: performing multi-path recall based on the query status object, where multi-path recall includes full-text recall, semantic recall, tag recall, and specified file recall; merging multiple candidate files from the multi-path recall; removing duplicate candidate files from the merged multiple candidate files; and recording the recall source, recall score, matching field, and initial state of each candidate file in the deduplicated multiple candidate files to obtain an initial candidate file set.

[0015] In some technical solutions of the present invention, optionally, the initial candidate file set is expanded based on the file lineage graph to obtain an expanded candidate file set, including: taking the initial candidate file in the initial candidate file set as the starting point, obtaining the extended file associated with the initial candidate file based on the file lineage graph; and merging the extended file into the initial candidate file set to obtain the expanded candidate file set.

[0016] The second aspect of this invention provides a question-and-answer generation system for rules and regulations, including an acquisition unit, a first generation unit, a second generation unit, a receiving unit, a third generation unit, a recall unit, an extension unit, a judgment unit, and an output unit. The acquisition unit is used to acquire rules and regulations documents. The first generation unit is used to generate document metadata based on the rules and regulations documents. The second generation unit is used to acquire relationship information based on the document text, title, appendices, repeal notices, revision notices, and cited clauses of the rules and regulations documents. The relationship information includes relationship types such as substitution, being substituted, revision, repeal, citation, basis, superior regulations, subordinate detailed rules, and supporting relationships. Based on relational information, a file lineage graph is generated; a receiving unit receives question-and-answer instructions from the user; a third generation unit generates a query status object based on the question-and-answer instructions; a recall unit performs multi-way recall based on the query status object to obtain an initial candidate file set; an expansion unit expands the initial candidate file set based on the file lineage graph to obtain an expanded candidate file set; a judgment unit determines the validity of candidate files in the expanded candidate file set based on the target time, file metadata, and file lineage graph of the query status object; and an output unit outputs the question-and-answer results based on the validity of the candidate files.

[0017] In this technical solution, the system executes in a fixed sequence: acquiring regulations and rules documents, generating file metadata, generating a file lineage diagram, receiving question-and-answer instructions, generating query status objects, obtaining an initial candidate file set through multi-path recall, expanding the candidate file set based on the file lineage diagram, jointly determining validity from multiple data sources, and outputting question-and-answer results based on the validity of the candidate files. It relies on the file lineage diagram to supplement and expand the candidate files with related versions, and on the query target time, file metadata, and file lineage relationships. Figure 3 The collaborative use of class data completes the hierarchical verification of the validity of candidate documents, reducing the probability of misusing expired or replaced documents in Q&A on rules and regulations. It solves the technical problem in the background technology that traditional keyword retrieval cannot identify the replacement relationship of document versions and cannot determine the validity of document timeliness, thus leading to the risk of users misusing expired documents.

[0018] A third aspect of the present invention provides a question-and-answer generation system for regulations, including a memory and a processor. The memory stores a program or instructions executable on the processor. When the program or instructions are executed by the processor, they implement the steps of the question-and-answer generation method for regulations as described in any of the above-described technical solutions. Therefore, this question-and-answer generation system for regulations possesses all the beneficial effects of the question-and-answer generation method for regulations as described in any of the above-described technical solutions.

[0019] A fourth aspect of the present invention provides a readable storage medium storing a program or instructions thereon, which, when executed by a processor, implement the steps of a question-and-answer generation method as described in any of the above-described technical solutions. Therefore, this readable storage medium possesses all the beneficial effects of the question-and-answer generation method as described in any of the above-described technical solutions.

[0020] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0021] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 A flowchart of a question-and-answer generation method for regulations according to an embodiment of the present invention; Figure 2 This is one of the block diagrams of a question-and-answer generation system for regulations according to an embodiment of the present invention; Figure 3 This is a second block diagram of a question-and-answer generation system for regulations according to an embodiment of the present invention. Detailed Implementation

[0022] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0024] The following reference Figures 1 to 3 This invention describes a question-and-answer generation method, a question-and-answer generation system, and a readable storage medium for regulations and rules, according to some embodiments of the present invention.

[0025] In one embodiment of this application, such as Figure 1 As shown, a question-and-answer generation method for rules and regulations is provided, including: Step 102: Obtain the rules and regulations documents; Step 104: Generate document metadata based on the rules and regulations documents; Step 106: Based on the main text, title, appendix, repeal explanation, revision explanation, and cited clauses of the rules and regulations documents, obtain the relationship information. The relationship information includes the following relationship types: replacement, being replaced, revision, repeal, citation, basis, superior system, subordinate detailed rules, and supporting relationships. Step 108: Generate a file lineage diagram based on the relationship information; Step 110: Receive question and answer instructions from the user; Step 112: Generate a query status object based on the question-and-answer instructions; Step 114: Perform multi-way recall based on the query status object to obtain an initial candidate file set; Step 116: Based on the file lineage graph, expand the initial candidate file set to obtain an expanded candidate file set; Step 118: Based on the target time, file metadata, and file lineage graph of the query status object, determine the validity of the candidate files in the extended candidate file set; Step 120: Based on the validity of the candidate documents, output the question-and-answer results.

[0026] In this embodiment, the system first executes the step of acquiring rules and regulations documents. The system's file parsing module establishes a bidirectional data reading link with the enterprise document storage server. The file parsing module is located at the forefront of the entire system's data input. The file parsing module and the document storage server complete data transmission through an intranet interface. The core function of the file parsing module is to batch read all original rules and regulations documents within the enterprise to complete the acquisition operation of the rules and regulations documents. After acquiring the rules and regulations documents, the file parsing module directly enters the step of generating file metadata. The file metadata is the basic structured data carrier for the subsequent validity determination step. The file parsing module has a built-in metadata extraction subunit, which is integrated and deployed with the file parsing module. The metadata extraction subunit directly reads the title, closing, main body, and supplementary provisions fields in the rules and regulations documents, and extracts the unique document identifier, document name, document font size, issuing body, publication date, effective start time, effective end time, repeal mark, applicable department, applicable job level range, applicable job sequence, applicable personnel category, business tag, document summary, and main body segment information clearly recorded in the rules and regulations documents, and fills them into the generated file metadata. All generated file metadata is written to the system's data storage module, which is located in the system's background persistent storage area. The data storage module establishes read channels with the file parsing module, the file lineage graph construction module, and the validity determination module. The core function of the data storage module is to persistently store all file metadata, providing a stable metadata data source for all downstream processing steps.

[0027] Based on this, the system executes the following steps: extracting relationship information from the main text, titles, appendices, repeal notices, revision notices, and cited clauses of the regulations and rules documents; and generating a document lineage diagram based on this relationship information. The system's document lineage diagram construction module is located immediately behind the document parsing module. The document lineage diagram construction module and the document parsing module connect via a memory data channel to receive the processed full-text of the regulations and rules. Simultaneously, the document lineage diagram construction module establishes a read interface with the data storage module to retrieve the generated document metadata. The core function of the document lineage diagram construction module is to extract document relationships and construct a document lineage diagram. The document lineage graph construction module extracts relationships based on the information sources defined by regulations and institutional documents. This information is derived from the document text, title, appendices, repeal notices, revision notices, and cited clauses. The module first identifies relationships such as substitution, being substituted, revision, repeal, citation, basis, superior regulations, subordinate rules, and supporting documents recorded in the text using rules. For implicit relationships that cannot be identified by the rules, a large language model is used to assist in extraction. The extraction results are verified according to preset validation rules, including document name matching, document font size matching, relationship direction consistency, and the reasonableness of relationship effectiveness time. The document lineage graph uses regulations and institutional documents as nodes and the extracted relationships as connecting edges. Each edge synchronously records the relationship type, source document identifier, target document identifier, relationship effectiveness time, and relationship source fragment. The completed document lineage graph is stored in a graph database partition built into the data storage module. This graph database partition establishes a dedicated query interface with the subsequent lineage extension module. The core function of the graph database partition is to support batch and fast querying of all related node files corresponding to a single document. After completing the file lineage diagram construction, the system proceeds to the step of receiving question and answer instructions from the user.

[0028] The system's question parsing module is located at the end of the system's front-end interaction link. The question parsing module is connected to the front-end interface via a transmission link. The front-end interface receives natural language question-and-answer commands input by enterprise employees and transmits the complete command to the question parsing module. The core function of the question parsing module is to receive the original question-and-answer command and perform structured parsing. After receiving the command, the question parsing module generates a query status object based on the command. The query status object is a unified query carrier that connects the entire process of retrieval, lineage expansion, and validity determination. The intent recognition subunit within the question parsing module parses the question intent, target time, metadata constraints, and tag constraints contained in the question-and-answer command to generate the query status object. Key stored fields within the query status object include a unique query identifier, the user's original question, the rewritten retrieval question, intent type, target time, time type, metadata constraint set, and tag constraint set. The target time field is the baseline parameter for subsequent validity determination steps. After the query status object is generated, the data is transmitted to the system's candidate file retrieval module. The system then performs a multi-path retrieval based on the query status object to obtain an initial candidate file set. The candidate file recall module and the question parsing module are directly connected in memory to receive the complete query status object. The candidate file recall module connects to the full-text search engine, the vector semantic search engine, and the tag search index respectively. It executes full-text recall, semantic recall, tag recall, and specified file recall in parallel according to the multi-path recall logic. After the multi-path recall is completed, all search results are merged and duplicate files are removed to obtain the initial candidate file set. The initial candidate file set is generated only based on text literal matching, semantic similarity, and business tag matching. It only includes files that are similar to the content expressed by the question and answer instructions. It cannot actively retrieve documents with legal relevance, such as higher-level regulations, supporting rules, and new and old replacement versions. This set is completely transmitted to the downstream lineage extension module.

[0029] The system's lineage extension module is located between the candidate document recall module and the validity determination module. This module establishes read interfaces with both the candidate document recall module and the graph database partition within the data storage module. Its core function is to retrieve related files from the document lineage graph to supplement the candidate set. The system executes a step to expand the initial candidate document set based on the document lineage graph to obtain an expanded candidate document set. The extension module traverses each candidate document in the initial set, querying the document lineage graph for its corresponding successor, predecessor, revision, cited higher-level regulations, supporting lower-level rules, and related documents with the same business tag. All retrieved related files are then merged into the initial candidate document set, forming the expanded candidate document set. Traditional retrieval processes only retain semantically matched files, potentially missing supporting and higher-level regulations that must be referenced for business judgment. The document lineage graph and the extension module work together to supplement and recall legally binding regulations, fully covering all regulatory bases required for judgment in business scenarios. After the expanded candidate document set is generated, it is pushed in batches to the system's validity determination module.

[0030] The validity determination module is deployed behind the lineage extension module. It establishes read connections with three types of data sources: a memory cache storing query status objects, a data storage module storing file metadata, and a graph database partition storing file lineage diagrams. The core function of the validity determination module is to comprehensively analyze these three types of data to perform hierarchical validity marking of candidate files. The system executes a step-by-step validity determination of candidate files in the extended candidate file set based on the target time of the query status object, file metadata, and file lineage diagram. The validity determination module executes differentiated determination logic for different query intentions, and this logic strictly follows preset validation rules. If the query status object is intended to be a question and answer about current regulations, the module reads the effective start time, effective end time, and repeal mark from the file metadata for the first layer of filtering. Then, it reads the file lineage diagram to check if there are any subsequent replacement documents with an effective time later than the target time. Files that meet the following conditions are marked as currently valid: effective start time not later than the target time, effective end time is empty or later than the target time, repeal mark is not already repealed, and there are no effective replacement documents. The remaining files are marked as expired, repealed, or replaced, and the reason for removal is recorded. If the query status object is intended to be a question and answer about historical regulations, the module uses the historical target time T recorded in the query status object as the benchmark, filters out files whose effective period completely covers T, and which were not replaced or repealed at time T, and marks them as historically valid. If the query status object is intended to be a regulation comparison query, the module retains two sets of files that have a replacement or revision lineage before and after the target time. Traditional retrieval links lack multi-dimensional joint validity verification logic and rely solely on text similarity to output documents. When employees query current policies, they can easily retrieve outdated documents that have been abolished or replaced by new versions. Document metadata provides basic timeliness information for a single document, document lineage diagrams supplement version replacement association constraints, and the target time of the query status object provides a unified judgment benchmark. These three types of data work together to complete the hierarchical marking of candidate document validity and filter out invalid or replaced documents that do not match the query time conditions.

[0031] After completing the validity determination of all candidate documents, the system executes the step of outputting question and answer results based on the validity of the candidate documents. The evidence constraint question and answer module of the system receives the set of candidate documents marked as currently valid or historically valid from the validity determination module. The module constructs the question and answer context according to the preset evidence constraint rules, calls the large language model to generate the question and answer text, and synchronously outputs the name of the cited document, the document font size, the corresponding clause fragment, the applicable time and the explanation of the basis, and finally outputs the complete question and answer results.

[0032] Therefore, this method is executed in a fixed sequence: acquiring regulatory documents, generating file metadata, generating a file lineage graph, receiving question-and-answer instructions, generating query status objects, obtaining an initial candidate file set through multi-path recall, expanding the candidate file set based on the file lineage graph, jointly determining validity from multiple data sources, and outputting question-and-answer results based on the validity of candidate files. It relies on the file lineage graph to supplement and expand the candidate files with related versions, and on the query target time, file metadata, and file lineage. Figure 3 The collaborative use of class data completes the hierarchical verification of the validity of candidate documents, reducing the probability of misusing expired or replaced documents in Q&A on rules and regulations. It solves the technical problem in the background technology that traditional keyword retrieval cannot identify the replacement relationship of document versions and cannot determine the validity of document timeliness, thus leading to the risk of users misusing expired documents.

[0033] Furthermore, the validity verification of candidate files in the expanded candidate file set is specifically performed as follows: The validity of the candidate document is verified based on its time validity, such as whether the candidate document is valid at the target time; if it is valid at the target time, the verification passes, and if it is invalid at the target time, the verification fails.

[0034] The validity of candidate files is verified based on their usage status, such as whether current and historical files are mixed. If current files are required, the verification passes if all candidate files are current files, and fails if historical files are mixed in. Similarly, if historical files are required, the verification passes if all candidate files are historical files, and fails if current files are mixed in.

[0035] Furthermore, before outputting the question-and-answer results, the results can be validated, specifically as follows: The validity of the question-and-answer results is verified based on the original text of the candidate document, such as whether the question-and-answer results are supported by the original text clauses; if they are supported, the verification passes, and if they are not supported, the verification fails.

[0036] Based on the above verification, it is also possible to verify whether the question-and-answer results contain content that the model expands on its own without any basis.

[0037] If the validation passes, the question-and-answer results are output. If the validation fails, the unsubstantiated content is deleted, valid evidence is replaced, or the question-and-answer results are regenerated.

[0038] This embodiment provides a question-and-answer generation method for rules and regulations. In addition to the technical features of the above embodiments, this embodiment further includes the following technical features.

[0039] After determining the validity of candidate files in the extended candidate file set, the question-answering generation method further includes: performing metadata matching and verification on the candidate files in the extended candidate file set; and performing semantic verification on the candidate files in the extended candidate file set. Figure 1 Consistency verification; evidence availability verification of candidate files in the extended candidate file set; consistency verification of stage results for candidate files in the extended candidate file set; metadata matching verification; and intention verification. Figure 1 The verification results of consistency verification, evidence availability verification, and phase result consistency verification are recorded and / or the status of candidate files in the extended candidate file set is updated.

[0040] In this embodiment, the stateful self-verification module is located behind the validity determination module. The stateful self-verification module and the validity determination module are directly connected via a memory data channel. The stateful self-verification module can directly read the entire extended candidate file set that has been hierarchically marked after validity determination. The stateful self-verification module also interfaces with the memory cache storing query state objects, the data storage module storing file metadata, and the graph database partition storing the file lineage diagram. The core function of the stateful self-verification module is to sequentially perform four types of checks and synchronously update the candidate file state objects. After completing the validity determination of the extended candidate file set, the stateful self-verification module first performs a metadata matching and verification process on the candidate files in the extended candidate file set. The metadata matching and verification subunit is integrated within the stateful self-verification module. The metadata matching and verification subunit retrieves the metadata constraints and tag constraints carried by the query state object, as well as the file metadata fields corresponding to each candidate file, comparing line by line whether the applicable department, job sequence, job level range, applicable personnel category, file type, and business tag recorded in the candidate file are consistent with the query constraints. If the metadata scope of candidate files cannot cover the query constraints, the metadata matching and verification subunit generates a metadata mismatch verification result and records the corresponding reason for removal. Traditional processes only determine timeliness validity without verifying the applicable boundaries of the files. When an employee queries rules for middle-level management positions, time-valid management documents for lower-level employees might be retained, causing a deviation in the candidate file matching scope. The metadata matching and verification subunit, through bidirectional comparison of constraint fields, filters out files whose applicable scope does not match the query requirements, narrowing the selection range of valid candidate files.

[0041] Based on this, the stateful self-checking module performs intentional checks on candidate files in the extended candidate file set. Figure 1 The consistency verification process. Figure 1 The consistency verification subunit and the metadata matching verification subunit are connected in series, meaning Figure 1The consistency verification subunit reads the question intent type recorded in the query status object. Intent types include current policy questions and answers, historical policy questions and answers, specified document questions and answers, document list queries, and policy comparison queries. Figure 1 The consistency verification subunit performs matching judgments according to preset differentiated verification rules. If the query intent is a question and answer regarding current regulations, the verification only retains candidate documents marked as currently valid, and removes documents valid only for a historical period. If the query intent is a question and answer regarding historical regulations, only documents valid at the target time point are retained. If the query intent is a comparison query of regulations, the verification checks whether at least one set of documents with a replacement or revision relationship exists among the candidate documents. Traditional processes only complete the timeliness determination and do not combine the query intent. Figure 2 In the secondary filtering of documents, when users query current regulations, historically valid documents, determined by their expiration date, will still participate in answer generation, reducing the matching degree between candidate documents and question-and-answer instructions. Figure 1 The consistency verification subunit performs secondary filtering based on the query intent, further improving the matching degree between the candidate file set and the question and answer instructions. For candidate files that fail the verification, a verification result indicating intent mismatch is generated and a rejection explanation is retained.

[0042] Complete Figure 1 After consistency verification, the stateful self-verification module performs evidence usability verification on the candidate files in the extended candidate file set. The evidence usability verification subunit undertakes the task of... Figure 1 The consistency verification outputs a set of files. The evidence usability verification subunit reads the text slices of candidate documents and determines whether the documents contain explicit clauses, limiting conditions, scope of application, or conclusions that can answer the user's questions. If a candidate document is only semantically similar to the user's question, but the text does not contain specific clauses to support the question-and-answer conclusion, a verification result of insufficient evidence is generated. Traditional processes do not verify the evidentiary support capability of document content. Some documents that match the timeliness and intent are only related in title and cannot output valid business evidence. The evidence usability verification subunit filters out documents without substantial supporting content, ensuring that all retained candidate documents have extractable institutional clauses as evidence.

[0043] After verifying the usability of evidence, the stateful self-verification module performs a process of verifying the consistency of stage results for candidate files in the extended candidate file set. The stage result consistency verification subunit summarizes all the marking information generated in the first three verification stages and the validity determination stage, comparing the output states of multiple stages to see if there are any conflicts. The stage result consistency verification subunit retrieves all related node information of candidate files within the file lineage graph to identify conflicts. For example, if a candidate file is marked as currently valid after validity determination, but its lineage contains a subsequent replacement file whose effective time is later than the query target time, resulting in a contradiction in the multi-stage states, the stage result consistency verification subunit triggers the state correction logic, correcting the validity status of the candidate file to "already replaced" and recording the reason for the conflict. In traditional workflows, each processing stage outputs its state independently, without a unified conflict verification mechanism. Contradictory data from multiple stages flows into the question-and-answer generation stage. The stage result consistency verification subunit uniformly corrects conflicting file states, ensuring that the marking information of all candidate files is consistent and reliable.

[0044] After all four verification procedures are completed, the state-based self-verification module performs metadata-based matching verification and intention verification. Figure 1 The process of recording and / or updating the status of candidate files in the extended candidate file set is as follows: The system pre-generates a candidate file status object for each candidate file, which is stored in the data storage module. The candidate file status object includes fields for candidate record unique identifier, query unique identifier, file unique identifier, validity status, intent matching status, evidence availability status, removal reason, and status update time. The status self-verification module writes all results generated by the four verifications into the corresponding candidate file status object. For candidate files that fail verification, it updates the corresponding abnormal status field and fully records the removal reason. For candidate files that pass all four verifications, it updates their evidence availability status to "verification passed." The extended candidate file set with updated status is then transmitted to the downstream evidence constraint question-and-answer module for subsequent question and answer content generation.

[0045] Therefore, it can be seen that after determining the validity of the extended candidate files, this method sequentially performs metadata matching and verification, and so on. Figure 1 The system involves four sequential verification processes: consistency verification, evidence usability verification, and phase result consistency verification. The candidate document status is updated based on the results of these four verification processes. Figure 1 Consistency verification targets and filters out mismatched files based on query requirements, further improving the matching degree between the candidate file set and the question and answer instructions. At the same time, it works with the other three types of verification to simultaneously correct defects such as the applicable boundaries of files, evidence support, and multi-stage state conflicts, solving the derivative technical problem that relying solely on a single time validity judgment will leave a large number of candidate files that do not match the query requirements.

[0046] This embodiment provides a question-and-answer generation method for rules and regulations. In addition to the technical features of the above embodiments, this embodiment further includes the following technical features.

[0047] The question-and-answer generation method also includes: verifying the consistency of the question-and-answer results.

[0048] In this embodiment, the system's answer consistency verification module is located behind the evidence constraint question and answer module. The answer consistency verification module and the evidence constraint question and answer module are directly connected through a memory data channel. The answer consistency verification module can synchronously read the initial question and answer results output by the evidence constraint question and answer module, all candidate file status objects used to generate the question and answer results, query status objects, corresponding file metadata and file lineage diagram data. The core function of the answer consistency verification module is to conduct full-dimensional consistency verification of the initial question and answer results and identify various deviations between the answers and the institutional basis.

[0049] The answer consistency verification module checks each business conclusion in the initial question-and-answer results item by item, verifying whether each conclusion can find corresponding original text evidence in the document clauses it cites. If a conclusion cannot be supported by matching original text, it is judged as an unfounded conclusion. The module simultaneously verifies all cited documents marked in the question-and-answer results, retrieving the corresponding candidate document status objects one by one, and confirming that all cited documents have passed the validity judgment and the four self-verification processes described in the above embodiments. If any cited document is marked as obsolete, replaced, has mismatched metadata, or lacks sufficient evidence, it is judged as an invalid cited document. The module reads the intent type of the query status object record, distinguishing between current system questions and answers, The system checks whether current and historical valid documents are mixed in the question-and-answer results for historical regulations and for comparing regulations. If historical valid documents are mixed in current regulations question-and-answer scenarios, or current documents not covering the target time are mixed in historical regulations question-and-answer scenarios, it is considered an abnormal mixing of bases. The module identifies text content in the initial question-and-answer results that exceeds the scope of candidate document clauses and is generated autonomously by the large language model; this type of content is uniformly marked as unfounded expansion content. The module compares the business scope, applicable audience, and timeliness conditions of the clauses cited in the question-and-answer results with the query constraints carried by the query status object. If the cited clauses do not match the user's query intent, it is determined that the clauses and intent do not match.

[0050] Traditional processing chains only complete candidate document screening and answer generation, lacking a reverse verification mechanism for the output question-and-answer text. Large language models are prone to generating content independently, deviating from the original policy text, resulting in distorted and inaccurate question-and-answer results. The answer consistency verification module performs full verification across five dimensions: conclusion evidence, document validity, mixed document types, model extension content, and clause intent matching. This comprehensively identifies contradictions between the question-and-answer results and the policy basis, further improving the accuracy of the results.

[0051] After the consistency check is completed, the answer consistency check module performs corresponding correction processing on the initial question and answer results with verification anomalies according to the preset check rules. If an unfounded conclusion is identified, the module directly deletes that part of the text; if an error in the validity of the cited file is identified, the module re-retrieves the file lineage diagram and file metadata to conduct a second lineage check, replacing it with a compliant and valid file as supporting evidence; if multiple types of verification conflicts are identified and the overall question and answer content does not meet the query constraints, the evidence constraint question and answer module is instructed to re-retrieve compliant candidate files to generate a new question and answer result; if no anomalies are identified in all check dimensions, the question and answer result is determined to have passed the verification, and the final compliant question and answer result is output.

[0052] Therefore, this method adds a step to verify the consistency of the question-and-answer results after generating the initial results. It reverse-checks the matching relationship between the question-and-answer results and the institutional basis from multiple dimensions, including the evidence of conclusions, the timeliness of cited documents, the mixed use of document types, the model's autonomous expansion content, and the intent of clause matching queries. This can identify and correct various distorted contents in the question-and-answer results, further improve the accuracy of the results, and solve the derivative technical problems caused by the inability to control the distortion of answers due to the lack of basis for the large language model to generate text and the citation of expired documents when relying solely on the screening of candidate documents.

[0053] This embodiment provides a question-and-answer generation method for rules and regulations. In addition to the technical features of the above embodiments, this embodiment further includes the following technical features.

[0054] Generate document metadata based on rules and regulations documents, including: obtaining basic information about the rules and regulations documents, such as document name, document size, issuing entity, release date, effective start time, effective end time, applicable department, applicable job sequence, applicable job level range, personnel category, business tags, and main text content; and parsing the basic information to obtain document metadata.

[0055] In this embodiment, the file parsing module is located at the front end of the system's data input link. The file parsing module establishes an intranet data reading interface with the enterprise document storage server. The file parsing module can batch retrieve original electronic documents of personnel rules and regulations. The core function of the file parsing module is to complete the reading of rules and regulations documents, the extraction of basic information, and the structured output of file metadata.

[0056] After obtaining a single set of rules and regulations, the document parsing module first performs a process to retrieve the basic information of the rules and regulations. The fields for this basic information include the document name, document size, issuing body, publication date, effective start time, effective end time, applicable department, applicable job sequence, applicable rank range, personnel category, business tags, and main text content, as listed in the above embodiment. All of these fields are basic attribute fields explicitly recorded in the document's metadata object. The document parsing module internally configures text positioning subunits, which respectively lock onto the document header's issuing section, appendix paragraphs, applicable scope chapters, business classification label area, and full text block. It then extracts the corresponding basic information from each area: the document name from the document title line; the document size, issuing body, and publication date from the document's signature position; the effective start time and effective end time from the document's effective / repealed clauses; the applicable department, applicable job sequence, applicable rank range, and personnel category from the applicable scope chapter; and the business tags from the business classification label. Finally, it reads all the text content of the document as the main text content, completing the full collection of basic information. Traditional text reading methods only capture large sections of full text without performing targeted extraction of key information such as timeliness and scope of application. Key constraint information is mixed in with massive amounts of text and is difficult to retrieve individually. Targeted extraction of basic information by partitioning can separate and store timeliness, scope of application, and classification information independently, providing standardized independent fields for multiple downstream verification processes.

[0057] Building upon this, the file parsing module performs the process of parsing basic information to obtain file metadata. The file parsing module has a built-in metadata structuring and encapsulation subunit, which interfaces serially with the text positioning subunit. The metadata structuring and encapsulation subunit receives all the basic information output by the text positioning subunit, maps the scattered basic information line by line into the structured fields of the file metadata object, and simultaneously supplements the file's unique identifier, obsolescence flag, file ownership type, file level, file summary, and corresponding fields for the text slices, completing the assembly and generation of complete file metadata. The metadata structuring and encapsulation subunit performs a unified format conversion on time-related basic information, converting the release date, effective start time, and effective end time into a standard timestamp format; it performs word segmentation and splitting on multi-valued text such as scope of application, personnel category, and business tag, converting it into an array format that can be directly used for tag retrieval and metadata matching verification; and it performs segmentation and slicing on long text content, generating fixed-length text slices that are stored in the file metadata. The assembled file metadata is uniformly pushed to the system's data storage module for persistent storage. The data storage module provides field reading interfaces to the subsequent file lineage diagram construction module, validity determination module, and stateful self-checking module. Each step in the entire processing chain can independently retrieve any basic information field from the file metadata. Traditional solutions lack a standardized metadata encapsulation process, storing various file information in unstructured text format. Downstream modules cannot quickly filter timeliness and applicability constraints. Standardized parsing and encapsulation of basic information generates structured file metadata, enabling rapid reading and batch comparison of key business constraint information.

[0058] Therefore, this method first extracts complete basic information from regulations and institutional documents, including document name, document size, issuing entity, publication date, effective start time, effective end time, applicable department, applicable job sequence, applicable job level range, personnel category, business tags, and main text content, in the step of generating file metadata. Then, it performs structured parsing and encapsulation of the standardized basic information to obtain file metadata. This clarifies the specific implementation method for generating file metadata and provides a standardized structured data source for the entire process of subsequent document lineage construction, timeliness and validity determination, and metadata matching and verification. It solves the technical problem that traditional retrieval only stores unstructured full-text text and cannot independently call timeliness and scope of application information, resulting in a lack of reliable basis for document screening and verification.

[0059] This embodiment provides a question-and-answer generation method for rules and regulations. In addition to the technical features of the above embodiments, this embodiment further includes the following technical features.

[0060] Based on the question-and-answer instruction, a query status object is generated, including: calling the question parsing module to parse the question-and-answer instruction to obtain the question intent, target time, business tags, and metadata constraints of the question-and-answer instruction; and generating a query status object based on the question intent, target time, business tags, and metadata constraints.

[0061] In this embodiment, the system's question parsing module is positioned between the front-end interactive interface and the candidate file retrieval module. The question parsing module and the front-end interactive interface are connected via a transmission link. After receiving natural language question-and-answer commands input by enterprise employees, the front-end interactive interface transmits the complete commands to the question parsing module. The question parsing module also interfaces with a temporary memory cache for temporary storage of intermediate parsing data. The core function of the question parsing module is to parse the original question-and-answer commands, extract structured query elements, and assemble them to generate a query status object. The system executes a process of calling the question parsing module to parse the question-and-answer commands to obtain the question intent, target time, business tags, and metadata constraints. The question parsing module internally includes four sub-units: intent recognition, time extraction, tag extraction, and constraint extraction. These four sub-units process the input question-and-answer commands in parallel. The intent recognition subunit identifies the question intent based on intent classification rules. If the question-and-answer instruction contains the words "current" or "currently," it is identified as a question-and-answer about current regulations; if it contains a specific year or historical period, it is identified as a question-and-answer about historical regulations; if it specifies the document name and font size, it is identified as a question-and-answer about a specific document; if it contains the words "comparison" or "difference between old and new," it is identified as a query about system comparison. The time extraction subunit captures the time descriptions within the question-and-answer instruction and converts them into target time parameters in a standard format, serving as a unified benchmark for subsequent validity determination of candidate documents. The tag extraction subunit matches personnel-related words within the question-and-answer instruction and extracts corresponding business tags, which correspond one-to-one with the preset business tags in the document metadata. The constraint extraction subunit captures limiting conditions such as job sequence, job level range, applicable department, and personnel category from the question-and-answer instruction and summarizes them into a metadata constraint set. Traditional question-and-answer processing methods only split keywords, failing to distinguish query intent or independently extract time and applicable scope constraints. Multi-path recall and validity determination lack targeted filtering conditions. The four types of structured elements obtained through multi-subunit splitting and extraction can provide targeted processing basis for the entire downstream process.

[0062] Based on this, the system executes a process of generating query status objects based on question intent, target time, business tags, and metadata constraints. The question parsing module has a built-in query status assembly subunit, which serially interfaces with the aforementioned four extraction subunits. The query status assembly subunit receives the extracted question intent, target time, business tags, and metadata constraints, fills these four elements into the structured fields of the query status object, and simultaneously supplements the unique query identifier, the user's original question, the rewritten search question, time type, main search query, and the corresponding fields for the split search query list, completing the assembly of the query status object. The assembled query status object is stored in a temporary memory cache, which provides a complete read interface to the downstream candidate file retrieval module. The candidate file retrieval module can directly read all the constraint parameters carried by the query status object to perform multi-path retrieval. Subsequent lineage extension, validity determination, status self-checking, and answer consistency verification modules can all retrieve the query status object to perform lineage-oriented extension, differentiated timeliness determination, intent matching verification, and answer misuse check, respectively. Traditional processes lack a unified structured query carrier, and each step of retrieval and verification independently analyzes user questions, which can easily lead to inconsistencies in understanding between different steps. Standardized assembly to generate query status objects can ensure that the understanding of user question and answer instructions remains consistent throughout the entire processing chain.

[0063] Therefore, it can be seen that in the step of generating the query status object, this method calls the question parsing module to extract four core elements from the question-and-answer instructions: question intent, target time, business tags, and metadata constraints. Then, it uses these four elements to uniformly assemble and generate the query status object. By relying on the identified question intent, it distinguishes different query scenarios and matches corresponding retrieval and verification logic, unifying the understanding standard of user query needs throughout the entire chain. This further improves the accuracy of the output question-and-answer results and solves the technical problem that traditional retrieval only splits keywords without identifying query intent and constraints, resulting in a lack of targeted processing basis in the retrieval and verification process and question-and-answer results deviating from the user's true needs.

[0064] Furthermore, generating a query status object based on question-and-answer instructions also includes: The question-and-answer instructions are rewritten and split to generate the main search query and the list of search queries, and the job sequence, job level range, applicable department, personnel category, file type, and business tag are written into the metadata constraints and tag constraints.

[0065] This embodiment provides a question-and-answer generation method for rules and regulations. In addition to the technical features of the above embodiments, this embodiment further includes the following technical features.

[0066] Perform multi-path recall based on the query state object to obtain an initial candidate file set, including: performing multi-path recall based on the query state object, where multi-path recall includes full-text recall, semantic recall, tag recall, and specified file recall; merging multiple candidate files from the multi-path recall; removing duplicate candidate files from the merged multiple candidate files; and recording the recall source, recall score, matching field, and initial state of each candidate file in the deduplicated multiple candidate files to obtain the initial candidate file set.

[0067] In this embodiment, the candidate file recall module is positioned between the question parsing module and the lineage extension module. The candidate file recall module and the question parsing module establish a reading link through a memory cache. The candidate file recall module can completely read the query status object output by the question parsing module. The candidate file recall module connects to four independent retrieval components: a full-text search engine, a vector semantic search engine, a tag search index, and a specified file search index. The core functions of the candidate file recall module are to execute multiple types of searches in parallel, summarize search results, remove duplicate files, initialize status information for each file, and generate an initial candidate file set. The system executes a multi-path recall process based on the query status object. Multi-path recall includes four types of retrieval logic: full-text recall, semantic recall, tag recall, and specified file recall. These four types of retrieval run synchronously and in parallel. Full-text recall is based on the BM25 inverted index, retrieving the main search query within the query status object and performing literal text matching on file name, file font size, file summary, and file text slices. Semantic recall encodes the rewritten search query within the query status object into a vector and performs similarity matching with the vectors of all policy document summaries and text slices. Tag recall reads the business tags and metadata constraints carried by the query status object and matches the applicable department, job sequence, and business tag fields recorded in the file metadata to complete the recall. Specified file recall directly and accurately locates the corresponding policy document and prioritizes its recall when the query status object identifies a user-specified file name and font size. A single search path can only cover a single matching dimension; the parallel execution of the four types of recall can simultaneously cover literal, semantic, business classification, and precise specification matching scenarios, broadening the recall scope of candidate documents.

[0068] Building upon this, the candidate file recall module performs a process of merging multiple candidate files retrieved from multiple sources. This module receives multiple candidate file lists from full-text recall, semantic recall, tag recall, and specified file recall, respectively, and aggregates all four lists into a unified temporary file list. No filtering is performed, and all file data from the four search types is fully preserved. The temporary file list also includes the recall source, recall score, and original matching field data for each file. Since independent searches often output multiple identical files, directly merging the results would result in a large number of duplicate files. Duplicate files increase the computational overhead of subsequent lineage expansion, validity determination, and multi-round validation. The merging step aggregates all search results, providing a complete dataset for subsequent deduplication.

[0069] The candidate file recall module continues the process of removing duplicate candidate files from the merged candidate files. This module includes a built-in file deduplication subunit. This subunit uses the file's unique identifier as the criterion for deduplication. It iterates through the merged temporary file list, comparing the unique identifier of each candidate file. If multiple records correspond to the same unique identifier, only one record is retained, and all other duplicate records are deleted, completing the deduplication process. The file's unique identifier is a globally unique code for each regulation document. Relying on this field for deduplication can accurately identify duplicate files, avoiding false deduplication caused by similar file names or font sizes, reducing the total number of files to be processed, and decreasing the data processing pressure on downstream processing stages.

[0070] After deduplication, the candidate file recall module records the recall source, recall score, matching fields, and initial state of each candidate file among the deduplicated candidate files to obtain an initial candidate file set. The module creates an independent candidate file state object for each remaining candidate file after deduplication. The recall source corresponding to this retrieval is written into the candidate file state object, with the recall source marker distinguishing between full-text recall, semantic recall, tag recall, and specified file recall. The recall score calculated for this retrieval is also written synchronously; the recall score is a comprehensive score of text matching similarity, vector similarity, and tag matching weights. The matching fields that triggered the file's recall are also recorded synchronously, distinguishing between file name, text slices, business tags, and file font size. The validity status, intent matching status, and evidence availability status of all candidate files are uniformly initialized to "unknown validity," forming a standardized initial state. All files with populated candidate file state objects are aggregated into an initial candidate file set, which is then transmitted completely to the downstream lineage extension module for subsequent related file supplementation operations. Traditional single-search processes lack standardized status recording, making it impossible for the system to trace the source and matching basis of files. This step uniformly records the search-related information for each file, providing complete original search data for subsequent stages of result consistency verification and abnormal file tracing.

[0071] Therefore, this method, in the step of generating the initial candidate document set through multi-path recall, performs four types of retrieval in parallel: full-text recall, semantic recall, tag recall, and specified document recall. It merges and deduplicates the multi-path retrieval results, and records the recall source, recall score, matching fields, and initial state for each deduplicated candidate document. This clarifies the specific implementation of multi-path recall, broadens the coverage of policy document recall, and retains complete retrieval traceability information. It provides complete original retrieval data support for subsequent lineage expansion, validity determination, and multi-round self-testing, solving the technical problems of traditional single-path recall having a narrow recall scope and lacking retrieval traceability information, resulting in incomplete candidate document coverage and inability to trace the basis for document matching.

[0072] This embodiment provides a question-and-answer generation method for rules and regulations. In addition to the technical features of the above embodiments, this embodiment further includes the following technical features.

[0073] Based on the file lineage graph, the initial candidate file set is expanded to obtain an extended candidate file set, including: taking the initial candidate file in the initial candidate file set as the starting point, obtaining the extended files associated with the initial candidate file based on the file lineage graph; and merging the extended files into the initial candidate file set to obtain the extended candidate file set.

[0074] In this embodiment, the lineage extension module is positioned between the candidate file recall module and the validity determination module. The lineage extension module and the candidate file recall module are directly connected via a memory data channel. The lineage extension module can completely read the initial candidate file set output by the candidate file recall module and the candidate file status object corresponding to each file. Simultaneously, the lineage extension module establishes a dedicated query interface with the graph database partition storing the file lineage relationship graph. The lineage extension module can send node query commands to the graph database partition, and the graph database partition returns associated node data to the lineage extension module. The core function of the lineage extension module is to use the initial candidate file as the query node, retrieve all associated files within the file lineage relationship graph, and merge them into the original candidate set to generate an extended candidate file set. The system executes the process of obtaining the extended files associated with the initial candidate file, starting from the initial candidate file in the initial candidate file set, based on the file lineage relationship graph. The lineage extension module traverses each initial candidate file in the initial candidate file set, using the file's unique identifier as the retrieval condition for the graph database partition. The graph database partition, relying on the nodes and associated edges stored in the file lineage graph, retrieves all associated files corresponding to the current initial candidate file. Associated files include subsequent replacement files, previous replaced files, revised versions, cited or relied-upon higher-level regulations, corresponding lower-level rules, supporting documents, and other files with lineage relationships based on the same business tag. Traditional retrieval processes lack a lineage graph association query step, only retaining files matched through multiple recalls, and cannot proactively retrieve supporting, new / old, or hierarchical policy documents with legally binding relationships. By relying on the file lineage graph for targeted retrieval of associated nodes, the necessary supporting policy basis for business judgments can be fully supplemented.

[0075] Based on this, the lineage extension module performs the process of merging the extended files into the initial candidate file set to obtain the extended candidate file set. The lineage extension module receives all extended file data returned by the graph database partition, creates a new independent candidate file status object for each extended file, and marks the file as belonging to a replacement version, the replaced version, a superior system, a subordinate rule, or a supporting document in the lineage role field of the candidate file status object. The lineage extension module does not remove existing files from the initial candidate file set; it directly appends all extended files to the end of the initial candidate file set, merging them into a unified extended candidate file set. The extended candidate file set synchronously and completely retains all retrieval and traceability information from the initial candidate files, including recall source, recall score, matching fields, and initial status, while adding the corresponding lineage role tag for each extended file. The merged extended candidate file set is then pushed to the downstream validity determination module for subsequent multi-dimensional verification of timeliness, scope of application, and intent matching. Traditional retrieval processes do not supplement kinship-related documents, and the candidate document set lacks supporting regulations. By incorporating the extended documents obtained from kinship chart retrieval into the original set, the coverage of candidate documents is improved, ensuring that subsequent verification and question-and-answer generation processes have complete regulatory basis materials.

[0076] Therefore, it can be seen that in the step of expanding the initial candidate file set, this method uses the initial candidate file as the starting point for retrieval, relies on the file lineage diagram to retrieve extended files with various lineage relationships, and then merges all extended files into the initial candidate file set to obtain the extended candidate file set. This clarifies the specific implementation method of the extended candidate set, supplements the missing superior, subordinate, new and old replacement, and supporting related system documents in multi-path recall, improves the coverage of candidate files, and solves the technical problem of traditional retrieval relying solely on matching recall files and omitting legally related systems, resulting in incomplete question and answer basis.

[0077] In one embodiment of this application, such as Figure 2As shown, a question-and-answer generation system 200 for rules and regulations is provided, including an acquisition unit 210, a first generation unit 220, a second generation unit 230, a receiving unit 240, a third generation unit 250, a recall unit 260, an extension unit 270, a judgment unit 280, and an output unit 290. The acquisition unit 210 is used to acquire rules and regulations documents; the first generation unit 220 is used to generate document metadata based on the rules and regulations documents; the second generation unit 230 is used to acquire relationship information based on the document text, title, appendix, repeal notice, revision notice, and cited clauses of the rules and regulations documents. The relationship information includes relationship types including substitution, replaced, revision, repeal, citation, basis, and superior system. The system includes: 1) Subordinate rules and supporting relationships; 2) A file lineage diagram generated based on the relationship information; 3) Receiving unit 240 receiving question-and-answer instructions from the user; 4) A third generation unit 250 generating a query status object based on the question-and-answer instructions; 5) A recall unit 260 performing multi-way recall based on the query status object to obtain an initial candidate file set; 6) An expansion unit 270 expanding the initial candidate file set based on the file lineage diagram to obtain an expanded candidate file set; 7) A judgment unit 280 determining the validity of candidate files in the expanded candidate file set based on the target time, file metadata, and file lineage diagram of the query status object; and 8) An output unit 290 outputting the question-and-answer results based on the validity of the candidate files.

[0078] In this embodiment, the system executes in a fixed sequence: acquiring regulations and rules documents, generating file metadata, generating a file lineage diagram, receiving question-and-answer instructions, generating query status objects, obtaining an initial candidate file set through multi-path recall, expanding the candidate file set based on the file lineage diagram, jointly determining validity from multiple data sources, and outputting question-and-answer results based on the validity of the candidate files. It relies on the file lineage diagram to supplement and expand the candidate files with related versions, and on the query target time, file metadata, and file lineage relationships. Figure 3 The collaborative use of class data completes the hierarchical verification of the validity of candidate documents, reducing the probability of misusing expired or replaced documents in Q&A on rules and regulations. It solves the technical problem in the background technology that traditional keyword retrieval cannot identify the replacement relationship of document versions and cannot determine the validity of document timeliness, thus leading to the risk of users misusing expired documents.

[0079] In one embodiment of this application, such as Figure 3As shown, a question-and-answer generation system 300 for regulations is provided, including a memory 320 and a processor 310. The memory 320 stores programs or instructions that can run on the processor 310. When the program or instructions are executed by the processor 310, they implement the steps of the question-and-answer generation method for regulations as described in any of the above embodiments. Therefore, this question-and-answer generation system for regulations possesses all the beneficial effects of the question-and-answer generation method for regulations as described in any of the above embodiments.

[0080] In one embodiment of this application, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the steps of the question-and-answer generation method as described in any of the above embodiments. Therefore, this readable storage medium possesses all the beneficial effects of the question-and-answer generation method as described in any of the above embodiments.

[0081] In the claims, description, and accompanying drawings of this invention, the term "plural" refers to two or more objects. Unless otherwise explicitly defined, the terms "upper," "lower," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and simplifying the descriptive process, and are not intended to indicate or imply that the device or element referred to must have the described specific orientation, or be constructed and operated in a specific orientation. Therefore, these descriptions should not be construed as limiting the invention. The terms "connection," "installation," "fixing," etc., should be interpreted broadly. For example, "connection" can be a fixed connection between multiple objects, a detachable connection between multiple objects, or an integral connection; it can be a direct connection between multiple objects or an indirect connection between multiple objects through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0082] In the claims, description, and accompanying drawings of this invention, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the invention. In the claims, description, and accompanying drawings of this invention, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0083] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A question-and-answer generation method for rules and regulations, characterized in that, include: Obtain rules and regulations documents; Based on the aforementioned rules and regulations documents, generate document metadata; Based on the main text, title, appendix, repeal explanation, revision explanation, and cited clauses of the aforementioned rules and regulations, relationship information is obtained. The relationship information includes relationship types such as substitution, being substituted, revision, repeal, citation, basis, superior system, subordinate detailed rules, and supporting relationships. Based on the aforementioned relationship information, a file lineage diagram is generated; Receive question and answer instructions from users; Based on the question-and-answer instructions, a query status object is generated; Perform multi-path recall based on the query status object to obtain an initial candidate file set; Based on the file lineage diagram, the initial candidate file set is expanded to obtain an expanded candidate file set; Based on the target time of the query status object, the file metadata, and the file lineage diagram, the validity of candidate files in the extended candidate file set is determined. Based on the validity of the candidate documents, the question-and-answer results are output.

2. The question-and-answer generation method for rules and regulations according to claim 1, characterized in that, After determining the validity of the candidate files in the expanded candidate file set, the question-answer generation method further includes: Metadata matching and verification are performed on the candidate files in the extended candidate file set; Perform intent consistency verification on the candidate files in the extended candidate file set; The evidence availability of the candidate files in the extended candidate file set is verified. Perform a stage result consistency check on the candidate files in the expanded candidate file set; Based on the verification results of the metadata matching verification, the intent consistency verification, the evidence availability verification, and the stage result consistency verification, the status of the candidate files in the extended candidate file set is recorded and / or updated.

3. The question-and-answer generation method for rules and regulations according to claim 1, characterized in that, The question-and-answer generation method also includes: The consistency of the question and answer results is verified.

4. The question-and-answer generation method for rules and regulations according to claim 1, characterized in that, The generation of file metadata based on the aforementioned rules and regulations documents includes: Based on the aforementioned rules and regulations documents, obtain the basic information of the rules and regulations documents, which includes the document name, document font size, issuing entity, release date, effective start time, effective end time, applicable department, applicable job sequence, applicable job level range, personnel category, business tag, and main text content; The basic information is parsed to obtain the file metadata.

5. The question-and-answer generation method for rules and regulations according to claim 1, characterized in that, The step of generating a query status object based on the question-and-answer instruction includes: The question parsing module is invoked to parse the question-and-answer instruction in order to obtain the question intent, target time, business tags, and metadata constraints of the question-and-answer instruction. A query status object is generated based on the question intent, the target time, the business tag, and the metadata constraints.

6. The question-and-answer generation method for rules and regulations according to claim 1, characterized in that, The step of performing multi-way recall based on the query status object to obtain an initial candidate file set includes: Based on the query status object, perform multi-path recall, which includes full-text recall, semantic recall, tag recall, and specified file recall. Merge the multiple candidate files recalled through multiple channels; Remove duplicate candidate files from the merged candidate files; Record the recall source, recall score, matching field, and initial state of each candidate file in the multiple candidate files after deduplication to obtain an initial candidate file set.

7. The question-and-answer generation method for rules and regulations according to any one of claims 1 to 6, characterized in that, The step of expanding the initial candidate file set based on the file lineage diagram to obtain an expanded candidate file set includes: Starting with the initial candidate file in the initial candidate file set, and based on the file lineage graph, obtain the extended files associated with the initial candidate file; The extended files are incorporated into the initial candidate file set to obtain the extended candidate file set.

8. A question-and-answer generation system for rules and regulations, characterized in that, include: The acquisition unit is used to acquire rules and regulations documents; The first generation unit is used to generate file metadata based on the aforementioned rules and regulations document; The second generation unit is used to obtain relationship information based on the document text, title, appendix, repeal explanation, revision explanation, and cited clauses of the regulations and rules document. The relationship information includes relationship types such as replacement, being replaced, revision, repeal, citation, basis, superior system, subordinate detailed rules, and supporting relationship. Based on the relationship information, a document lineage diagram is generated. The receiving unit is used to receive question and answer instructions from the user; The third generation unit is used to generate a query status object based on the question-and-answer instruction; The recall unit is used to perform multi-way recall based on the query status object to obtain an initial candidate file set; An extension unit is used to expand the initial candidate file set based on the file lineage graph to obtain an extended candidate file set; The determination unit is used to determine the validity of candidate files in the extended candidate file set based on the target time of the query status object, the file metadata, and the file lineage diagram. The output unit is used to output the question-and-answer results based on the validity of the candidate documents.

9. A question-and-answer generation system for rules and regulations, characterized in that, It includes a memory and a processor, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the question-and-answer generation method of the regulations as described in any one of claims 1 to 7.

10. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or the instructions are executed by the processor, they implement the steps of the question-and-answer generation method for regulations as described in any one of claims 1 to 7.