System text semantic analysis and rule formalization method, system, device and medium based on large model
Patent Information
- Application Number
- CN202610615854.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-07
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]因此,本发明解决的技术问题是:现有技术中制度文本语义解析深度不足、规则形式化缺失、关键要素提取精度低、处理流程对复杂文本适应性差以及缺乏语义校验机制的问题,实现制度文本从非结构化内容到结构化、形式化、可校验规则体系的智能化处理
[0017] The beneficial effects of this invention are as follows: By configuring knowledge rules in the background and feeding the large model with rules, deep semantic understanding of institutional texts can be achieved. Without the need for domain fine-tuning of the large model, core semantic elements (subject, condition, constraint, etc.) and logical relationships can be accurately extracted. Relying on the domain entity dictionary and classification rules configured in the background, the large model has a significantly improved accuracy in recognizing domain-specific entities, effectively reducing redundancy and omissions.
Smart Images

Figure CN122596053A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and rule engine technology, and in particular to methods, systems, devices and media for semantic parsing and rule formalization of institutional texts based on large models. Background Technology
[0002] In various fields such as enterprise management, industry supervision, and government services, there are numerous institutional documents presented in natural language, such as rules and regulations, management methods, and implementation details. These documents are generally stored and distributed in unstructured or semi-structured document formats (Word, PDF, scanned copies). They are then manually read, understood, and transformed into executable rules required by business processes, enabling their application in actual business operations. With the increasing number of regulations and their rapid updates, manual processing is no longer sufficient to meet the demands for speed and accuracy.
[0003] Currently, the automated processing of policy documents mainly relies on OCR recognition, keyword extraction, and regular expression matching. OCR technology converts scanned documents into editable text, then tools like LangExtract parse the text, and finally, regular expressions are used to find pre-defined keyword patterns to extract key terms from the policy clauses. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention provides a method, system, device and medium for semantic parsing and rule formalization of institutional texts based on large models.
[0005] Therefore, the technical problem solved by this invention is that the existing technology suffers from insufficient semantic parsing depth of institutional texts, lack of formalized rules, low accuracy in extracting key elements, poor adaptability of processing flow to complex texts, and lack of semantic verification mechanism. The invention aims to achieve intelligent processing of institutional texts from unstructured content to a structured, formalized, and verifiable rule system.
[0006] To address the aforementioned technical problems, this invention provides the following technical solution: a method for semantic parsing and rule formalization of institutional texts based on a large model, comprising: preprocessing unstructured institutional texts to output standardized fragmented texts; inputting the knowledge rules configured in the background and the standardized fragmented texts into a general large language model, and outputting structured semantic information through the general large language model; matching the structured semantic information with a preset rule template to transform it into computer-executable formal rules; performing internal consistency verification and external compatibility verification based on the formal rules, and generating a verification report; associating and storing the standardized fragmented texts, the structured semantic information, and the formal rules, and providing a standardized interface for external business systems to call.
[0007] As a preferred embodiment of the large-model-based method for semantic parsing and rule formalization of institutional texts described in this invention, the preprocessing of unstructured institutional texts includes format recognition, adaptive segmentation, and text cleaning. The adaptive segmentation includes identifying the structural features of the institutional text, constructing a feature library by combining a professional dictionary of the institutional field, dynamically determining the segmentation position based on semantic quantization calculation, determining the risk of semantic breakage at the candidate points of text structure segmentation by semantic feature vector similarity, and backtracking to search for the nearest legal structural boundary when a semantic breakage is determined to exist, so as to adjust the segmentation position.
[0008] As a preferred embodiment of the large model-based semantic parsing and rule formalization method for institutional texts described in this invention, the internal consistency verification includes: extracting constraints for the same business matter from different formalized rules corresponding to the same institutional document, and detecting overlapping intervals of execution conditions for multiple rules for the same matter. When the condition intervals overlap and the conclusions are different, it is determined to be a logical conflict; Based on the structured semantic information, a semantic relation graph is constructed, and implicit semantic contradictions between the formal rules are detected through graph reasoning.
[0009] As a preferred embodiment of the large-model-based method for semantic parsing and rule formalization of institutional texts described in this invention, the external compatibility verification includes obtaining the current business rule library of an external business system. The existing business rules are stored in the same formal structure as the formal rules; The formal rules are aligned with the existing business rules by using a triplet of event type, subject, and behavior. Synonym mapping is performed using a semantic relationship graph. Under the same event, conditions and conclusions are compared to detect rule conflicts where the conditions are the same but the conclusions are different, as well as implicit compatibility conflicts where there are no apparent conflicts but there are mutual exclusions in the deep semantics.
[0010] As a preferred embodiment of the large-model-based method for semantic parsing and rule formalization of institutional texts described in this invention, the associated storage includes establishing foreign key associations between the standardized fragmented text, the structured semantic information, and the formalized rules through clause identifiers, forming an associated structure of original text, semantic information, and formalized rules. This supports the integrated display and retrieval of the original text, semantics, and rules of the same institutional clause on the interface, and outputs the associated storage data to the external business system through a standardized interface.
[0011] As a preferred embodiment of the large-model-based method for semantic parsing and rule formalization of institutional texts described in this invention, the knowledge rules configured in the background include predefined semantic element types and definition rules, logical relationship determination rules, and a domain entity dictionary containing classification rules. Obtaining structured semantic information includes performing vectorized fusion calculations on the standardized segmented text and the knowledge rules to generate enhanced text features, which are then input into the general large language model. The model outputs results that conform to a preset structure through a structured prompting engineering constraint model. The results include core semantic elements, logical relationships, and domain entity annotations.
[0012] As a preferred embodiment of the large-model-based method for semantic parsing and rule formalization of institutional texts described in this invention, the preset rule templates include condition constraint templates, authority and responsibility attribution templates, and process specification templates. The transformation into formal rules includes identifying the logical paradigm of the clauses and matching the corresponding rule templates based on the logical relationship graph and semantic role distribution in the structured semantic information; The core semantic fields required by the rule template are extracted from the structured semantic information. The implicit semantic elements of the core semantic fields are completed and standardized through semantic role labeling, cross-sentence reference resolution and fuzzy semantic resolution. Then, the mapping relationship defined by the rule template is transformed into a formal logical structure.
[0013] This invention provides a system for semantic parsing and rule formalization of institutional texts based on a large model.
[0014] As a preferred embodiment of the large-model-based system for semantic parsing and rule formalization of institutional texts described in this invention, the system includes: a data preprocessing module, a large-model semantic parsing module, a rule formalization transformation module, a semantic verification module, and a data entry and interface module. The data preprocessing module identifies, cleans, and adaptively segments unstructured institutional texts, uses semantic quantization calculation to adjust the segment positions, and outputs standardized segments. The large model semantic parsing module integrates background knowledge rules with text vectors, and outputs structured information containing core semantic elements, logical relationships and domain entities through structured prompts for engineering constraints on the general large model. The rule formalization transformation module matches a preset template based on the logical graph in the semantic information, completes the implicit elements through semantic role labeling, referential resolution and fuzzy semantic resolution, and transforms them into formal rules according to the template mapping. The semantic verification module performs internal consistency verification and external compatibility verification. The data entry and interface module associates and stores the original text, semantic information and formal rules based on the clause identifier, and provides a standardized interface for external systems to call.
[0015] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of a method for semantic parsing and rule formalization of institutional texts based on a large model.
[0016] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of a method for semantic parsing and rule formalization of institutional texts based on a large model are implemented.
[0017] The beneficial effects of this invention are as follows: By configuring knowledge rules in the background and feeding the large model with rules, deep semantic understanding of institutional texts can be achieved. Without the need for domain fine-tuning of the large model, core semantic elements (subject, condition, constraint, etc.) and logical relationships can be accurately extracted. Relying on the domain entity dictionary and classification rules configured in the background, the large model has a significantly improved accuracy in recognizing domain-specific entities, effectively reducing redundancy and omissions.
[0018] By converting natural language regulations into formal rules (logical expressions, JSON rule statements, etc.) that computers can recognize, business systems can automatically call these formal rules to perform tasks such as approval, risk control screening, and expense review, thereby significantly improving business processing speed and reducing errors caused by manual interpretation.
[0019] The newly added adaptive segmentation unit accurately segments the document according to its format and semantic logic, which can effectively handle complex document documents with multiple chapters, nested clauses, and tables, greatly improving its adaptability to different types of document documents.
[0020] After internal consistency checks and external compatibility checks, logical contradictions in the policy documents and mismatches between business rules are identified. Verification results are generated and support for manual intervention is provided to ensure that the data entering the database is logically correct and usable. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of a method for semantic parsing and rule formalization of institutional texts based on a large model, provided as an embodiment of the present invention. Detailed Implementation
[0023] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0024] Example 1, referring to Figure 1 This is the first embodiment of the present invention, which provides a method for semantic parsing and rule formalization of institutional texts based on a large model, including: S1: Preprocess unstructured institutional texts and output standardized fragmented texts.
[0025] S2: Input the knowledge rules and standardized fragmented text configured in the background into the general large language model, and output structured semantic information through the general large language model.
[0026] S3: Based on structured semantic information, it matches preset rule templates and transforms them into formal rules that can be executed by computers.
[0027] S4: Perform internal consistency verification and external compatibility verification based on formal rules, and generate a verification report.
[0028] S5: It associates and stores standardized fragmented text, structured semantic information, and formal rules, and provides standardized interfaces for external business systems to call.
[0029] Example 2 is an embodiment of the present invention. Based on the above embodiments, a method for semantic parsing and rule formalization of institutional texts based on large models is provided.
[0030] Furthermore, in this embodiment, step S1 preprocesses the unstructured institutional text and outputs standardized fragmented text, specifically including steps S101-S103: S101: Preprocessing unstructured institutional texts, including format recognition, adaptive fragmentation, and text cleaning; Unstructured data format recognition distinguishes between different formats such as images, scanned documents, PDF scans / original versions, and Word documents. For original PDF versions, it directly extracts text, avoiding OCR parsing errors. S102: Adaptive segmentation includes identifying the structural features of the institutional text, constructing a feature library by combining a professional dictionary in the institutional field, dynamically determining the segmentation position based on semantic quantization calculation, determining the semantic break risk at the candidate points of text structure segmentation by semantic feature vector similarity, and backtracking to search for the nearest legal structural boundary when a semantic break is determined to exist, so as to adjust the segmentation position. By extracting structural features such as chapter titles, clause numbers, and paragraph separators from institutional texts, and integrating professional dictionaries in the field of institutional texts to construct a feature library, the core decision-making logic is implemented based on semantic quantification calculation: a pre-trained language model is used to generate semantic feature vectors of the text before and after the candidate segmentation point. Cosine similarity and semantic relevance scores are calculated as quantification judgment indicators. When the vector similarity is lower than a set threshold, it is determined that the candidate point will cause semantic breakage. The segmentation position is dynamically adjusted using a composite algorithm of sequence labeling model and grammatical dependency tree backtracking search: based on the BERT-BiLSTM-CRF sequence labeling model, the text boundary probability distribution is output to locate the initial candidate segmentation point. At the same time, combined with the grammatical dependency tree rules of institutional texts, forward or backward backtracking search is performed on segmentation points with low semantic relevance to match the nearest legal structural nodes such as clause separators and paragraph boundaries, and finally the optimal segmentation position is determined.
[0031] S103: Text cleaning optimization. In addition to regular noise reduction (removing spaces, line breaks, and special symbols), new functions for merging synonyms and marking ambiguous sentences have been added to provide high-quality text data for subsequent semantic analysis.
[0032] Furthermore, in this embodiment, step S2 inputs the knowledge rules configured in the background and the standardized fragmented text into the general large language model, and outputs structured semantic information through the general large language model. Specific steps include S201-S203: S201: Through structured prompting engineering, the knowledge rules and the standardized fragmented text are concatenated into an enhanced prompt input to the general large language model, and the output of the general large language model is constrained to conform to a preset structure. The result includes core semantic elements, logical relationships and domain entity annotations.
[0033] The back-end management system pre-configures the semantic element types to be extracted from the policy text and their definition rules, including but not limited to subject, behavior, condition, constraint, time / location. The above element definitions are stored in the rule base in a JSON Schema structured form.
[0034] Before calling the large model, the system performs vectorized fusion calculations on the text to be parsed and the background knowledge rules. The system uses a pre-trained language model to generate semantic feature vectors of the segmented text and feature vectors of the rules defining each element. The system calculates the vector cosine similarity to complete the initial association and matching between the element rules and the text fragments. The element rules with high matching degree are embedded into the text feature vectors to form enhanced text feature input, which replaces simple string concatenation and improves the accuracy of the large model in recognizing elements. Simultaneously, an element association graph structure is constructed to transform the potential subject-behavior-condition association relationships in the text into graph nodes (elements) and edges (association types). The graph structure data and enhanced text features are simultaneously input into the large model to provide structured support for element extraction.
[0035] S202: The backend configures logical relationship judgment rules, clarifies the judgment criteria and feature word library for common conditional relationships, causal relationships, parallel relationships, and progressive relationships in institutional texts, stores the rules in a structured form and completes vectorization processing in sync, and integrates them with text feature vectors.
[0036] During the system's call to the large model API, the legality of the output is constrained by both the attention mask mechanism and the Logits processing logic: For the scenario of logical recognition of institutional texts, a dedicated attention mask matrix is constructed to force the large model to focus on logical connectors and element association nodes in the text, while weakening irrelevant and redundant information. Threshold filtering and logical rule verification are performed on the Logits output by the large model. Output results that do not conform to the preset logical relationship rules are suppressed to avoid invalid or erroneous logical annotations, replacing the weak constraint method that relies solely on prompt words.
[0037] S203: To address issues such as formatting errors and inaccurate attribution of authority and responsibility in the output JSON of large models, a dedicated post-processing algorithm based on institutional logic is designed, rather than a general regular expression-based repair method. First, a JSON format verification and repair algorithm is constructed. Combined with an institutional element rule base, it verifies the completeness and type correctness of the output JSON fields. For missing elements and formatting errors, it automatically supplements and corrects them based on the semantic relevance of the text. Second, an attribution of authority and responsibility correction algorithm is designed. By extracting the dependency relationship features between subjects and behaviors in the text, a subject-behavior association matrix is constructed. This matrix determines and corrects issues such as ambiguous subject attribution and incorrect attribution of authority and responsibility in the output of large models, ensuring the accuracy of element associations and providing reliable output for subsequent rule formalization. Specific classification rules include process-based, mechanism-based, and subject-based rules.
[0038] Process categories are entities related to the handling process, such as the steps, procedures, execution links, and time nodes stipulated in the system. Mechanisms refer to entities related to long-term operational models, such as working mechanisms, guarantee mechanisms, management mechanisms, coordination mechanisms, and constraint mechanisms, as clearly defined in the system. The subject category refers to the responsible units, implementing departments, management objects, participating entities, and other organizational or individual entities involved in the system.
[0039] Furthermore, in this embodiment, step S3, based on structured semantic information, matches a preset rule template and transforms it into a computer-executable formal rule. Specific steps include S301-S303: S301: Converting into computer-executable formal rules includes matching corresponding rule templates based on the logical relationships or core semantic elements in the structured semantic information; The system pre-sets rule templates for three types of frequently used clauses in regulatory documents. Each template defines the correspondence between input elements and output formats: The system pre-sets rule templates for three types of frequently used clauses in regulatory texts, serving as a structured framework for formalized output. Each template is stored in JSON Schema format, clearly defining the types of input semantic elements, logical relationship requirements, and output format specifications, adapting to the logical paradigms of different regulatory clauses. Conditional constraint templates: Adapted to clauses containing conditional triggering-post-constraint logic such as "if...then..." and "when...it is required...", explicitly requiring input of core semantic units such as conditional elements, responsible parties, and execution behaviors after completion and resolution, and standardizing the formal expression structure of conditional logic and execution logic; Templates for assigning authority and responsibility: Adaptable to clauses containing logic of responsibility assignment and authority division, such as "X is responsible for Y" and "Z's approval authority belongs to W". It clearly requires the input of a complete three-element semantic structure of responsible subject, responsible matter, and responsible behavior, and solidifies the formal mapping rules of authority and responsibility association; Process specification templates: Adaptable to clauses containing sequential execution logic such as "first A, then B, and finally C", clearly requiring the input of semantic elements such as process nodes, execution entities, and node relationships, and standardizing the formal expression of process sequence.
[0040] S302: Extract the core semantic fields required for the template from the structured semantic information, and transform the core semantic fields into a formal logical structure according to the mapping relationship defined in the template.
[0041] The system completes template adaptation through semantic reasoning. It performs comprehensive feature calculation on the logical relationship graph of relations and the semantic role distribution of slots output by the large model. Combined with the definition of various logical relationships in the knowledge graph of the institutional domain, it automatically determines the logical paradigm of the current clause, such as condition constraints, attribution of rights and responsibilities, and process specifications, and then matches the corresponding rule template. After adaptation, it retrieves the JSON Schema file of the template, verifies the semantic information after implicit logic completion and fuzzy semantic resolution, and confirms that the core semantic elements are not missing and the argument roles are complete before proceeding to the subsequent transformation stage.
[0042] It should be noted that, in one embodiment of the present invention, for the condition constraint class, by parsing the condition relationship structure of the relations field and the semantic role distribution of the slots field, combined with the domain knowledge graph, the logical paradigm of clause condition triggering-post-constraint is identified, and the condition constraint class template is matched. Retrieve the JSON Schema file of the template, verify the semantic parsing result after implicit logic completion, confirm that it contains core elements such as "condition fields, logical operators, condition thresholds, responsible parties, and execution actions", and proceed to the next step after adapting to the template requirements.
[0043] A semantic role labeling model is used to label the clause text and its context, identifying the agent and recipient of the action. Through cross-sentence reference resolution calculation, it is confirmed that there are no implicit subjects (the department manager is the explicit subject). At the same time, core semantic elements are extracted and standardized by combining semantic association reasoning. Based on the input element → output format mapping relationship defined by the condition constraint class template, the semantic elements after completion, resolution, and standardization are transformed into a formal logical structure: First, conditional semantic elements are converted into JSON if nodes, then result-oriented semantic elements are converted into JSON then nodes; finally, the if nodes and then nodes are integrated to form a complete formal rule JSON, realizing the transformation of natural language logic into machine-executable logic.
[0044] The generated formal rules undergo four-fold verification to ensure they can be recognized and executed by computers, while also guaranteeing semantic consistency with the original clauses.
[0045] In one embodiment of the present invention, for the attribution of rights and responsibilities category, the logical paradigm of the clause responsibility subject - responsibility matter - responsibility behavior is identified through the ternary relationship reasoning of entity-behavior-matter, and the attribution of rights and responsibilities category template is matched; the JSON Schema file of the template is retrieved, and the semantic parsing result after implicit logic completion is verified to confirm that it contains core elements such as "responsible subject, responsibility matter, and responsibility behavior". The slots and relations fields of the original JSON have been completed to cover the above elements and adapt to the template requirements.
[0046] The recipient detected in the organization's implementation needs to be confirmed through context semantic association. Extract the context semantic feature vector and calculate the similarity with the candidate recipient vector. Combine the association rules between the organization's implementation actions and assessment items in the institutional domain knowledge graph to confirm that the recipient is the annual assessment. Subsequently, accurately extract the core elements required by the template and complete the standardization through semantic association mapping: Based on the mapping relationship between the input elements and output formats defined in the template of power and responsibility attribution, formalize the standardized semantic elements; verify the effectiveness of the conversion results, with a focus on strengthening the verification at the semantic level. S303: Through the expression standardization step, the system has a built-in mapping table from natural language conditional phrases to logical operators, automatically converting natural language expressions such as "more than", "not less than", "before...", etc. into corresponding logical operators (such as >, ≥, <date), to achieve the standardized conversion of conditional expressions.
[0047] For conditional expressions such as "more than", "not less than", "before..." in institutional texts, as well as fuzzy expressions such as "in principle... except for special cases", construct a double quantification index of principle degree and exception degree, and complete the boundary quantification through the following formula: Principle degree = semantic weight of the principle condition / (semantic weight of the principle condition + semantic weight of the exception condition); Exception degree = semantic weight of the exception condition / (semantic weight of the principle condition + semantic weight of the exception condition); Among them, the semantic weight is calculated by the weight model trained with institutional domain corpus and corrected in combination with the intensity of restrictive words such as "must", "can", "shall not", etc. in the clause.
[0048] Based on the quantification results, through the calculation of semantic vector similarity, complete the adaptive mapping of natural language conditional phrases to standard logical operators, replacing simple table lookup.
[0049] Furthermore, in the implementation manner of this application, step S4 performs internal consistency verification and external compatibility verification based on formal rules and generates a verification report. The specific steps include S401 - S403: S401: Extract the constraint conditions for the same business item from different formal rules corresponding to the same institutional document, and perform condition interval overlap detection on multiple rules for the same item; Based on the semantic elements and logical relationships parsed from the institutional text, construct an exclusive semantic relationship graph. The nodes of the graph are semantic elements, and the edges are the semantic associations between the elements, integrating into the institutional domain knowledge graph.
[0050] The detection scope covers two types of conflicts, with a focus on strengthening the detection of deep semantic contradictions: For multiple rules on the same matter, perform condition interval overlap detection. If two condition intervals have an intersection but different conclusions, they are judged as logical conflicts. By using semantic relation graphs for associative reasoning, non-numerical and implicit contradictions can be identified. For example, clause A explicitly stipulates that "employees must report business trips," while clause B does not directly mention reporting. However, semantic reasoning reveals that clause B describes "employees only need department manager approval for business trips." Combining this with the mutually exclusive relationship between "reporting" and "no reporting required" in the domain knowledge graph, clause B is determined to imply that reporting is not required, thus creating a semantic contradiction with clause A. Furthermore, explicit and implicit mutually exclusive constraints on the same behavior by the same entity, or implicit conflicts in the division of the same rights and responsibilities by different clauses, can all be accurately identified through semantic reasoning.
[0051] S402: Obtain the current business rule base of the external business system, compare the formal rules with the rules of the corresponding items in the current business rule base according to the triplet of item type, subject and behavior, and determine the rule conflict when the conclusions are inconsistent under the same conditions.
[0052] The system retrieves the existing business rule base from external business systems via a standardized interface. This rule base is stored using the same formal JSON schema as this system. The formal rules are compared with the corresponding rules in the existing business rule base according to the triplet of item type, subject, and behavior. If the conclusions are inconsistent under the same conditions, it is considered a rule conflict. If the new rule conditions are a subset of the old rule conditions, it is marked as a case requiring manual confirmation and relaxation. If both conditions and conclusions are the same, it is considered compatible. After verification, a compatibility assessment report is output, including the compatibility status, external rule identifier, new rule identifier, conflict details, and handling suggestions.
[0053] S403: Issues discovered during verification should be labeled in a three-level classification. Serious conflicts arise when there are incompatible logical conclusions regarding the same matter, requiring manual correction and prohibiting automatic entry into the database; Minor ambiguities, which are vague expressions but do not affect execution, can be automatically normalized or marked for review. It is recommended to optimize for non-error-related issues such as rule redundancy or conditions that can be merged, providing optimization prompts without affecting database entry. Hierarchical classification is automatically determined by the rule engine based on preset rules, and the determination threshold can be configured in the management backend.
[0054] The knowledge rules configured in the backend include predefined semantic element types and definition rules, logical relationship determination rules, and a domain entity dictionary containing classification rules; Obtaining structured semantic information includes performing vectorized fusion calculations on the standardized segmented text and the knowledge rules to generate enhanced text features, which are then input into the general large language model. The model outputs results that conform to a preset structure through a structured prompting engineering constraint model. The results include core semantic elements, logical relationships, and domain entity annotations.
[0055] The preset rule templates include condition constraint templates, authority and responsibility attribution templates, and process specification templates; The transformation into formal rules includes identifying the logical paradigm of the clauses and matching the corresponding rule templates based on the logical relationship graph and semantic role distribution in the structured semantic information; The core semantic fields required by the rule template are extracted from the structured semantic information. The implicit semantic elements of the core semantic fields are completed and standardized through semantic role labeling, cross-sentence reference resolution and fuzzy semantic resolution. Then, the mapping relationship defined by the rule template is transformed into a formal logical structure.
[0056] Furthermore, in this embodiment, step S5 associates and stores the standardized fragmented text, structured semantic information, and formal rules, and provides a standardized interface for external business systems to call. Specific steps include: The standardized fragmented text, the structured semantic information, and the formal rules are linked by foreign keys through clause identifiers to form a relational structure of original text, semantic information, and formal rules. This supports the integrated display and retrieval of the original text, semantics, and rules of the same policy clause on the interface, and outputs the associated stored data to the external business system through a standardized interface.
[0057] Example 3 is the third embodiment of the present invention, which differs from the previous two embodiments in that: This embodiment also provides a system for semantic parsing and rule formalization of institutional texts based on a large model, including: a data preprocessing module, a large model semantic parsing module, a rule formalization transformation module, a semantic verification module, and a data entry and interface module; The data preprocessing module identifies, cleans, and adaptively segments unstructured institutional texts, uses semantic quantization to adjust the segment positions, and outputs standardized segments. The large model semantic parsing module integrates backend knowledge rules with text vectors, and outputs structured information containing core semantic elements, logical relationships and domain entities by providing structured prompts for engineering constraints on the general large model. The rule formalization transformation module matches a preset template based on the logical graph in the semantic information, completes the implicit elements through semantic role labeling, referential resolution and fuzzy semantic resolution, and transforms them into formal rules according to the template mapping. The semantic verification module performs internal consistency verification and external compatibility verification. The data entry and interface module associates and stores the original text, semantic information and formal rules based on the clause identifier, and provides a standardized interface for external systems to call.
[0058] This embodiment also provides an electronic device, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the large-model-based method for semantic parsing and rule formalization of institutional texts as proposed in the above embodiment.
[0059] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements the method for semantic parsing and rule formalization of institutional texts based on a large model as proposed in the above embodiments.
[0060] The storage medium proposed in this embodiment and the method for implementing institutional text semantic parsing and rule formalization based on large models proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0061] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0062] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for semantic parsing and rule formalization of institutional texts based on large models, characterized by: include, Unstructured institutional texts are preprocessed to output standardized fragmented texts; The knowledge rules configured in the background and the standardized fragmented text are input into the general large language model, and the general large language model outputs structured semantic information. Based on the structured semantic information, a preset rule template is matched and transformed into a formal rule that can be executed by a computer. Based on the formal rules, internal consistency and external compatibility checks are performed, and a check report is generated. The standardized fragmented text, the structured semantic information, and the formal rules are associated and stored, and a standardized interface is provided for external business systems to call.
2. The method for semantic parsing and rule formalization of institutional texts based on a large model as described in claim 1, characterized in that: The preprocessing of unstructured institutional texts includes format recognition, adaptive segmentation, and text cleaning. The adaptive segmentation includes identifying the structural features of the institutional text, constructing a feature library by combining a professional dictionary of the institutional field, dynamically determining the segmentation position based on semantic quantization calculation, determining the risk of semantic breakage at the candidate points of text structure segmentation by semantic feature vector similarity, and backtracking to search for the nearest legal structural boundary when a semantic breakage is determined to exist, so as to adjust the segmentation position.
3. The method for semantic parsing and rule formalization of institutional texts based on a large model as described in claim 2, characterized in that: The internal consistency verification includes extracting constraints for the same business matter from different formal rules corresponding to the same policy document, and detecting overlapping intervals of execution conditions for multiple rules for the same matter. When the condition intervals overlap and the conclusions are different, it is determined to be a logical conflict; Based on the structured semantic information, a semantic relation graph is constructed, and implicit semantic contradictions between the formal rules are detected through graph reasoning.
4. The method for semantic parsing and rule formalization of institutional texts based on a large model as described in claim 3, characterized in that: The external compatibility verification includes obtaining the current business rule library of external business systems; The existing business rules are stored in the same formal structure as the formal rules; The formal rules are aligned with the existing business rules by using a triplet of event type, subject, and behavior. Synonym mapping is performed using a semantic relationship graph. Under the same event, conditions and conclusions are compared to detect rule conflicts where the conditions are the same but the conclusions are different, as well as implicit compatibility conflicts where there are no apparent conflicts but there are mutual exclusions in the deep semantics.
5. The method for semantic parsing and rule formalization of institutional texts based on a large model as described in claim 4, characterized in that: The associated storage includes establishing foreign key associations between the standardized fragmented text, the structured semantic information, and the formal rules through clause identifiers, forming an associated structure of original text, semantic information, and formal rules. This supports the integrated display and retrieval of the original text, semantics, and rules of the same policy clause on the interface, and outputs the associated storage data to the external business system through a standardized interface.
6. The method for semantic parsing and rule formalization of institutional texts based on a large model as described in claim 5, characterized in that: The knowledge rules configured in the background include predefined semantic element types and definition rules, logical relationship determination rules, and a domain entity dictionary containing classification rules; Obtaining structured semantic information includes performing vectorized fusion calculations on the standardized segmented text and the knowledge rules to generate enhanced text features, which are then input into the general large language model. The model outputs results that conform to a preset structure through a structured prompting engineering constraint model. The results include core semantic elements, logical relationships, and domain entity annotations.
7. The method for semantic parsing and rule formalization of institutional texts based on a large model as described in claim 6, characterized in that: The preset rule templates include condition constraint templates, authority and responsibility attribution templates, and process specification templates; The transformation into formal rules includes identifying the logical paradigm of the clauses and matching the corresponding rule templates based on the logical relationship graph and semantic role distribution in the structured semantic information; The core semantic fields required by the rule template are extracted from the structured semantic information. The implicit semantic elements of the core semantic fields are completed and standardized through semantic role labeling, cross-sentence reference resolution and fuzzy semantic resolution. Then, the mapping relationship defined by the rule template is transformed into a formal logical structure.
8. A system for semantic parsing and rule formalization of institutional texts based on a large model, employing the method for semantic parsing and rule formalization of institutional texts based on a large model as described in any one of claims 1 to 7, characterized in that, include: The module includes a data preprocessing module, a large model semantic parsing module, a rule formalization transformation module, a semantic verification module, and a data import and interface module. The data preprocessing module identifies, cleans, and adaptively segments unstructured institutional texts, uses semantic quantization calculation to adjust the segment positions, and outputs standardized segments. The large model semantic parsing module integrates background knowledge rules with text vectors, and outputs structured information containing core semantic elements, logical relationships and domain entities through structured prompts for engineering constraints on the general large model. The rule formalization transformation module matches a preset template based on the logical graph in the semantic information, completes the implicit elements through semantic role labeling, referential resolution and fuzzy semantic resolution, and transforms them into formal rules according to the template mapping. The semantic verification module performs internal consistency verification and external compatibility verification. The data entry and interface module associates and stores the original text, semantic information and formal rules based on the clause identifier, and provides a standardized interface for external systems to call.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for semantic parsing and rule formalization of institutional texts based on a large model, as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for semantic parsing and rule formalization of institutional texts based on a large model, as described in any one of claims 1 to 7.