A coding and application method and system based on rule files and corpus construction
By encoding the rules file and chapter clauses, parsing morphemes, and constructing traceable encoding combinations, the problems of semantic ambiguity and high maintenance costs in text tag management are solved, achieving accurate semantic tag generation and traceability, and improving the interpretability and consistency of text processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SSE INFORMATION NETWORK LTD
- Filing Date
- 2026-04-02
- Publication Date
- 2026-07-24
AI Technical Summary
Existing text tag management methods suffer from problems such as keywords not containing contextual semantic information, high maintenance costs, and insufficient interpretability of generated results, especially the lack of clear semantic tag evidence chains in the output of deep learning models.
By encoding the rule files, chapters and clauses, and parsing morphemes, corpus units of conditional and conclusion morphemes are constructed. Then, traceable encoding combinations are formed through semantic relation operators. Combined with semantic disambiguation mechanisms and vectorized embedding technology, accurate semantic labels are generated and traceability is achieved.
It achieves a complete chain of evidence from semantic tags directly to the original rule text, ensuring the certainty and consistency of the tag results, improving the interpretability of scenarios such as compliance review and legal reasoning, and achieving precise matching in intelligent question answering and fuzzy search.
Smart Images

Figure CN121960503B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of text tag application management technology, specifically to an encoding and application method and system based on rule files and corpora. Background Technology
[0002] Traditional methods of text tag management mainly fall into three categories: tags learned through keyword libraries, natural language recognition technology, or deep learning models. These methods generally suffer from the following shortcomings: 1. The vocabulary records insufficient textual information; keywords lack contextual semantic information, often resulting in results that contradict the intended purpose. While NLP technology and deep learning model-based tags can imbue keywords with part-of-speech, word segmentation, and rule information, providing a basic level of understanding, their accuracy in use remains unsatisfactory. 2. High maintenance costs; the construction and maintenance of keyword libraries and deep learning case libraries are costly and unstable, requiring continuous high investment. 3. In practical applications, there is insufficient support for tag generation sources, semantic origin tracing, and morpheme logical relationships, resulting in weak interpretability of large model outputs.
[0003] Chinese invention patent CN121072515B discloses a text standardization tagging method based on a rule-based corpus. This method parses conditional and conclusion morphemes in rule-based text using a large language model, constructs structured morpheme pairs, and then trains them using semantic embedding and a deep learning model to achieve automated tagging of target text using a rule-based corpus with standardization. This approach has advantages in automated processing and model generalization ability, but the interpretability of its output depends on the meta-information of morpheme pairs and lacks a complete evidence chain from semantic labels directly to the original rule-based text. Summary of the Invention
[0004] To help solve the above-mentioned technical problems, this application provides a coding and application method and system based on rule files and corpora.
[0005] In a first aspect, this application provides an encoding method based on rule files and a corpus, which includes the following steps: S1: Encode the rule file to generate file codes for indexing the rule file and its publishing entity and category; S2: Encode the chapter and clause information in the rule file to generate chapter and clause codes for forming a hierarchical index within the file. The chapter and clause codes must contain at least chapter, section, clause, and paragraph information. S3: Analyze the morphemes in the specific clauses, decompose the clause text into conditional morphemes and conclusion morphemes, and label the conditional morphemes and conclusion morphemes. Construct a corpus unit consisting of a set of conditional morphemes, a set of conclusion morphemes, and a semantic relation operator connecting the set of conditional morphemes and the set of conclusion morphemes. The set of conditional morphemes is a collection of conditional morphemes, the set of conclusion morphemes is a collection of conclusion morphemes, and the semantic relation operator is used to represent the logical mapping relationship between conditional morphemes and conclusion morphemes. Store the corpus unit in the corpus. S4: Associate and combine the file code, chapter / clause code, and corpus units retrieved from the corpus to form a traceable code combination. Based on the traceable code combination, trace back the source of the original rule file, the location of the clause, and the semantics of the morphemes.
[0006] S1 includes: The file encoding includes two information dimensions: the publishing entity and the category, represented as follows: F=(O,C), where F represents the file encoding and O represents the publishing entity. m represents the number of publishing entities, and C represents the category. Where n is the number of categories, and the file encoding format is: or F code =concat(O code C code ), F code The encoded value representing the file encoding. Indicates the main body code. This represents the category code, where k represents the number of bits in the category code, and O code The coded value representing the publishing entity, C code This represents the encoded value of the category, and concat indicates the encoding concatenation operation.
[0007] S2 includes: Chapter and clause codes form a hierarchical index within the document, represented as follows: S=(F,ch,s,a,p), where S represents the chapter / clause code, F represents the document code, ch represents the chapter, s represents the section, a represents the clause, and p represents the paragraph. The encoding format for the chapter / clause code is as follows: S code The code value representing the chapter / clause code; F code The ch value represents the file encoding. code The coded value representing the chapter; s code The encoded value of the section; a code The code value of the bar; p code The code value indicating the item; This indicates an encoding concatenation operation.
[0008] S3 includes: Morphemes include conditional morphemes and conclusion morphemes, and their encoding is represented as follows: M represents morpheme encoding, M cond M represents the set of conditional morphemes. conc A set of morphemes indicating conclusions; The corpus unit is represented as: U=(M cond_set M conc_set ,R),M cond_set Represents a set of conditional morphemes. M conc_set Represents the set of morphemes indicating the conclusion. R represents a semantic relation operator used to characterize the logical relationship between the conditional morpheme set and the conclusion morpheme set, including implication, equivalence, or exclusion relations. M cond M represents the set of conditional morphemes. conc m represents the set of conclusion morphemes. ci Let m represent the i-th conditional morpheme in the c-th corpus unit. kj This represents the j-th conclusion morpheme in the k-th corpus unit.
[0009] It is important to emphasize that existing NLP techniques or large models typically rely on statistical probability, contextual word vectors, or simple keyword matching for generalization when labeling, which leads to the deficiency that keywords do not contain contextual semantic information. This application, however, fundamentally eliminates semantic ambiguity in Chinese natural language across different scenarios by abstracting legal / rule provisions into a mathematical combination similar to code logic (condition + conclusion + relational operators).
[0010] S3 also includes a corpus management step: comparing the newly constructed corpus unit with the existing corpus units in the corpus. If the semantics of the newly constructed corpus unit do not overlap with the existing corpus units in the corpus, the newly constructed corpus unit and its corresponding encoding information are stored in the corpus to realize the dynamic updating of the corpus. The corpus units constructed by S3 achieve semantic mapping from the condition morpheme set to the conclusion morpheme set through a semantic combination function, which is expressed as: Semantic represents the semantic composition function, f represents the semantic function of the conditional morpheme set, and g represents the semantic function of the conclusion morpheme set. This represents the mapping relationship under the action of the semantic relation operator R; It also includes a semantic disambiguation mechanism to ensure that corpus units with the same text description but different encodings have different semantics: U1 and U2 represent the first and second corpus units, respectively; desc(U1) and desc(U2) represent the text descriptions of the first and second corpus units, respectively; U1.code and U2.code represent the encodings of the first and second corpus units, respectively; Semantic(U1) and Semantic(U2) represent the semantics of the first and second corpus units, respectively. It means any.
[0011] S4 includes: Traceable coded combinations are represented as: E=(F,S,U)=F×S×U, where E represents the encoding combination, F represents the file encoding, S represents the chapter / clause encoding, and × represents the Cartesian product combination of the encodings; It also includes using a source tracing function to trace the origin of the original rule file, the location of the clause, and the semantics of the morphemes based on traceable code combinations: Trace(E) = (F origin ,S location U semantics Trace represents the source function, F origin Indicates the source of the original rule file, S location Indicates the location of the clause; U semantics It represents the semantic information of a morpheme.
[0012] S4 includes: The encoding combination constructed by S4 is used to implement semantic tagging of text, and the target text is mapped to a set of encoding combinations through the text semantic tag mapping function: , Tag represents the text semantic tag mapping function, and Text represents the target text; E i Represents the i-th encoding combination; Semantic(E i ) represents the encoding combination E i The semantics of Meaning(Text) are: Meaning(Text) represents the meaning of the text. Indicates semantic correspondence; The encoding combinations constructed by S4 are also used to compare the similarity between texts. The similarity is calculated based on the set of encoding combinations of the first and second texts using a text similarity calculation function. Sim represents the similarity calculation function, Text1 and Text2 represent the first and second texts to be compared, and Tag(Text1) and Tag(Text2) represent the sets of encoded combinations of the first and second texts, respectively. The cardinality of a set.
[0013] Secondly, this application provides an application method based on the encoding method described in any one of the first aspects, comprising the following steps: Identify and mark business morphemes from business texts. Business morphemes are keywords or phrases in business texts that are related to the rule file. The business morphemes and their codes are combined and vectorized for embedding to generate basic semantic vectors; The basic semantic vector and the extended vector are fused to generate the extended semantic vector; Set a similarity threshold, and based on the extended semantic vector, retrieve the encoding combination that is semantically similar to the business morpheme in the vector space to generate an extended association tag set; The extended semantic vector is generated as follows: V represents the extended semantic vector, E represents the encoding combination, and Embedding(E) represents the vectorized representation of the basic encoding. The extended associative tag set represents the synonym or near-synonymous extended vector. Expand(E) represents the set of extended associated tags of the coding combination E, E′ represents the coding combination that is semantically similar to E, and Sim vec Let V(E) represent the vector space similarity function, V(E) represent the extended semantic vector of the encoding combination E, and V(E′) represent the extended semantic vector of the encoding combination E′. Indicates the similarity threshold; The vector space similarity function is cosine similarity: Sim vec Let V1 and V2 represent the vector space similarity function, where V1 and V2 represent the first semantic vector and the second semantic vector, respectively. The dot product of semantic vectors This represents the magnitude of vector V1. This represents the magnitude of vector V2; The generated extended associated tag set is used to implement extended applications of precise tag analysis. An extended tracing function merges the target text's encoded combination set with its extended associated tag set. ExtendedTrace represents the extended trace function, Text represents the target text, and Tag(Text) represents the set of encoded combinations of the text. It also includes the knowledge base construction step, which involves storing the training results in the database: K old K represents the original knowledge base. new This represents the updated knowledge base, and Trace(E) represents the source information of the code combination; The overall system architecture is represented as follows: System represents the overall system architecture, K represents the knowledge base, Query represents the query retrieval function, F represents the file encoding, S represents the chapter / clause encoding, and U represents the corpus unit.
[0014] Thirdly, this application provides an encoding and application system based on rule files and corpora, wherein the system executes the application method described in the second aspect, and includes: The system includes: a rule file encoding layer, which executes S1 to encode rule files and generate file encodings containing publishing subject and category information; The chapter and clause coding layer is used to execute S2, encode the chapter and clauses in the rule file, and generate chapter and clause codes that include chapter, section, article, and clause information and support precise positioning of clause text; The standard morpheme encoding layer is used to execute S3, parse the conditional and conclusion morphemes in the rule file clauses, and construct corpus units composed of standard morphemes; the standard morphemes are derived from the rule file. The combination layer is used to execute S4, which associates and combines file encoding, chapter clause encoding and corpus units to construct traceable encoding combinations, and supports the reverse tracing of the clause position and morpheme semantics of the original rule text through encoding combinations. The business morpheme extension layer is used to identify and mark business morphemes from business texts, embed the business morphemes and their encodings into vectors, generate extended semantic vectors by combining synonym or near-synonymous extended vectors, and generate an extended associated tag set based on a similarity threshold. The knowledge base module stores code combinations, extended semantic vectors, source information, and extended association tag sets, and supports query retrieval.
[0015] In summary, compared with the prior art, this application has the following beneficial effects: 1. This application constructs a complete evidence chain from semantic tags directly to the original rule text through a three-level association combination of document encoding, chapter / clause encoding, and corpus units. When the application layer outputs any combination of encodings, the tracing function can immediately reconstruct its issuing entity, specific clause location, and morpheme composition, completely solving the interpretability problem of the black-box output of deep learning models and providing a reliable decision-making basis for scenarios such as compliance review and legal reasoning.
[0016] 2. To address the issue that the same text description may imply different meanings in different contexts, this application introduces semantic disambiguation constraints at the corpus unit level. If two corpus units have the same text description but different encodings, their semantics will necessarily be different. This mechanism maps ambiguous natural language into uniquely identifiable encodings, giving the labeling results absolute certainty and consistency, significantly outperforming traditional NLP methods that rely on statistical probability.
[0017] 3. While maintaining the accurate source tracing capability of the basic encoding combination, synonym / near-synonymous extended vectors are introduced. The precise semantics are vectorized and fused with the extended vectors, and then an extended association tag set is generated through a similarity threshold. This design retains the rigorous semantics of the rule text while recognizing and associating synonymous expressions input by the user, achieving accurate matching in scenarios such as intelligent question answering and fuzzy search, thus improving the user experience. Attached Figure Description
[0018] Figure 1 This is a hierarchical structure diagram of the rule document coding system of this application; Figure 2 This is a structural diagram of the morpheme association elements in this application. Detailed Implementation
[0019] The present application will be further described below with reference to the accompanying drawings. The structure and principle of the present application are very clear to those skilled in the art. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
[0020] Figure 1 This is a hierarchical structure diagram of the rule document encoding system of this application. Figure 1 The document demonstrates a rule document encoding system consisting of five progressive layers. The first layer is the Document Layer, which provides global identification for rule documents. The second layer is the Clause Layer, which spatially locates clauses. The third layer is the Morpheme Layer, which structurally encodes standard rule morphemes. The fourth layer is the Business Text Markup Layer, which accurately maps business text to the rule system. The fifth layer is the Business Morpheme Mapping Layer, which performs bidirectional mapping and re-encoding between non-standard business morphemes and standard rule morphemes.
[0021] The above processes can run as independent modules, and can utilize AI for automatic learning, training and updating, which can significantly improve the quality of text learning and the efficiency of tag retrieval. Furthermore, the coding can make the traceability and thinking process of AI processing output tagging, judgment and analysis transparent and explainable, which can facilitate human participation in quality control review and intervention optimization, and ensure the operational quality of the system.
[0022] Figure 2 This is a structural diagram of morpheme-related elements in this application. Figure 2 The diagram illustrates three core elements: Standard Morpheme, Business Morpheme, and Mapping Record, along with their relationships to lower-level elements and the logical correspondence between these elements. The upper layer consists of three horizontally arranged rectangles, from left to right: Standard Morpheme, Business Morpheme, and Mapping Record. Standard Morphemes and Business Morphemes are connected by arrows and labeled 1:N, indicating that one Standard Morpheme can correspond to multiple Business Morphemes. Business Morphemes and Mapping Records are connected by arrows and labeled N:M, indicating that multiple Business Morphemes can correspond to multiple Mapping Records. The lower layer consists of three vertically arranged rectangles, from left to right: Clause, Corpus Instance, and Training History. Standard Morphemes are connected to Clauses by downward arrows, demonstrating the relationship between Standard Morphemes and Clauses. Business Morphemes are connected to Corpus Instances by downward arrows, demonstrating the relationship between Business Morphemes and Corpus Instances. Mapping Records are connected to Training History by downward arrows, demonstrating the relationship between Mapping Records and Training History.
[0023] The above describes the data processing flow: identifying tagged morphemes from the located clauses, constructing a morpheme corpus, training the tags through corpus instances to obtain business morphemes, building mapping relationships, applying algorithm models, and accumulating training history and mapping records throughout the process to form an interpretable and traceable quality control system with broad social and business application scenarios. This system enables intelligent annotation of morpheme corpora, improves traceability accuracy, supports dynamic automatic updates, forms a closed loop of knowledge update and optimization through high-quality interaction between business and rules, and achieves full lifecycle management of the morpheme corpus.
[0024] Combination Figure 1 and Figure 2 The encoding method based on rule files and corpora in this application may include the following: 1. Rule file encoding: The file encoding includes two information dimensions: the publishing entity and the category. It can use letters and numbers, or all numbers. Sufficient space is reserved for each dimension to cover the relevant information marking requirements. Through encoding, the rule file and the publishing entity can be accurately indexed.
[0025] The file encoding includes two information dimensions: the publishing entity and the category, represented as follows: F=(O,C), where F represents the file encoding and O represents the publishing entity. m represents the number of publishing entities, and C represents the category. Where n is the number of categories, and the file encoding format is: or F code =concat(O code C code ), F code The encoded value representing the file encoding. The main code is represented by , the category code is represented by , k represents the number of bits in the category code, and O code The coded value representing the publishing entity, C code This represents the encoded value of the category, and concat indicates the encoding concatenation operation.
[0026] The above coding model is constructed using only two dimensions: subject and category, to demonstrate the feasibility of the coding concept. In practice, the number of parameters can be set according to business needs, and the model and expression are similar. Furthermore, the subject of this application can be further subdivided into country and region, and the category can include industry, application field, version, etc. Therefore, this application merely illustrates a feasible approach and should not be construed as limiting the scope of protection of this application.
[0027] 2. Rule Chapter and Clause Coding: The rules are written in accordance with the chapter and clause format. Therefore, the chapter and clause coding in a specific document can form an index relationship and achieve precise positioning.
[0028] Chapter and clause codes form a hierarchical index within the document, represented as follows: S=(F,ch,s,a,p), where S represents the chapter / clause code, F represents the document code, ch represents the chapter, s represents the section, a represents the clause, and p represents the paragraph. The encoding format for the chapter / clause code is as follows: S code The code value representing the chapter / clause code; F code The ch value represents the file encoding. code The coded value of the chapter; s code The encoded value of the section; a code The code value of the bar; p code The code value indicating the item; This indicates an encoding concatenation operation.
[0029] Similar to the file encoding design philosophy in the previous section, this section designs a four-layer positioning model for commonly used rule files. In practice, you may encounter scenarios with varying degrees of complexity and simplicity. The model can be adjusted according to practical needs, and the model construction method is similar. (The same applies below, and will not be repeated hereafter).
[0030] 3. Encoding of Clause Morphemes: At the level of specific clauses in the rules, there are a large number of conditional and concluding morphemes, whose combinations form corpora with specific semantics. These morphemes are further coded and combined to encode the morpheme corpus, thus enabling precise semantic understanding and even quantitative analysis. Furthermore, in practical applications, this eliminates the problem of the same Chinese description having different semantics in different scenarios.
[0031] Morphemes include conditional morphemes and conclusion morphemes, and their encoding is represented as follows: M represents morpheme encoding, M cond M represents the set of conditional morphemes. conc A set of morphemes indicating conclusions; The corpus unit is represented as: U=(M cond_set M conc_set ,R),M cond_set Represents a set of conditional morphemes. M conc_set Represents the set of morphemes indicating the conclusion. R represents a semantic relation operator used to characterize the logical relationship between the conditional morpheme set and the conclusion morpheme set, including implication, equivalence, or exclusion relations. M cond M represents the set of conditional morphemes. conc m represents the set of conclusion morphemes. ci Let m represent the i-th conditional morpheme in the c-th corpus unit. kj This represents the j-th conclusion morpheme in the k-th corpus unit.
[0032] It is important to emphasize that existing NLP techniques or large models typically rely on statistical probability, contextual word vectors, or simple keyword matching for generalization when labeling, which leads to the deficiency that keywords do not contain contextual semantic information. This application, however, fundamentally eliminates semantic ambiguity in Chinese natural language across different scenarios by abstracting legal / rule provisions into a mathematical combination similar to code logic (condition + conclusion + relational operators).
[0033] This application also includes a corpus management step: comparing the newly constructed corpus unit with the existing corpus units in the corpus; if the semantics of the newly constructed corpus unit does not overlap with the existing corpus units in the corpus, then storing the newly constructed corpus unit and its corresponding encoding information into the corpus to achieve dynamic updating of the corpus. The constructed corpus units achieve semantic mapping from the condition morpheme set to the conclusion morpheme set through a semantic combination function, which is expressed as follows: Semantic represents the semantic composition function, f represents the semantic function of the conditional morpheme set, and g represents the semantic function of the conclusion morpheme set. This represents the mapping relationship under the action of the semantic relation operator R; It also includes a semantic disambiguation mechanism to ensure that corpus units with the same text description but different encodings have different semantics: U1 and U2 represent the first and second corpus units, respectively; desc(U1) and desc(U2) represent the text descriptions of the first and second corpus units, respectively; U1.code and U2.code represent the encodings of the first and second corpus units, respectively; Semantic(U1) and Semantic(U2) represent the semantics of the first and second corpus units, respectively. It means any.
[0034] 4. Source Tracing Modeling through Encoding Combinations: By combining the encodings of documents, chapter clauses, and morpheme corpora, source tracing analysis models are constructed for semantic tags of object texts and related rule clauses.
[0035] Traceable coded combinations are represented as: E=(F,S,U)=F×S×U, where E represents the encoding combination, F represents the file encoding, S represents the chapter / clause encoding, and × represents the Cartesian product combination of the encodings; It also includes using a source tracing function to trace the origin of the original rule file, the location of the clause, and the semantics of the morphemes based on traceable code combinations: Trace(E) = (F origin ,S location U semantics Trace represents the source function, F origin Indicates the source of the original rule file, S location Indicates the location of the clause; U semantics It represents the semantic information of a morpheme.
[0036] The constructed encoding combinations are used to implement semantic tagging of text, and the target text is mapped to a set of encoding combinations through a text semantic tag mapping function: , Tag represents the text semantic tag mapping function, and Text represents the target text; E i Represents the i-th encoding combination; Semantic(E i ) represents the encoding combination Ei The semantics of Meaning(Text) are: Meaning(Text) represents the meaning of the text. Indicates semantic correspondence; The constructed encoding combinations are also used to compare the similarity between texts. The similarity is calculated based on the set of encoding combinations of the first and second texts using a text similarity calculation function. Sim represents the similarity calculation function, Text1 and Text2 represent the first and second texts to be compared, and Tag(Text1) and Tag(Text2) represent the sets of encoded combinations of the first and second texts, respectively. The cardinality of a set.
[0037] In addition, this application also proposes an application method based on the above-mentioned encoding method.
[0038] 5. Vector encoding in application training: Given the characteristics of current AI technology, Chinese tags contain a large number of synonyms and near-synonyms, resulting in various vectorized fuzzy associations. Encoding can be used to expand the association tags, thereby further expanding the application scope of precise analysis tags and related rule tracing mechanisms.
[0039] It should be noted that the encoding combination method of this application can be technically integrated with the deep learning classification model disclosed in Chinese Invention Patent CN121072515B. Specifically, the traceable encoding combination E generated in this application can be used as a supplementary input to the standard label library L in Chinese Invention Patent CN121072515B, enabling the deep learning model to not only learn the mapping relationship between semantic vectors and labels during training, but also obtain a complete rule text evidence chain through the traceability function Trace(E) of this application, further improving the interpretability of the model output. Conversely, the method of automatically identifying marked morpheme pairs through a large language model in Chinese Invention Patent CN121072515B can also be used to assist in the construction of corpus units in step S3 of this application, reducing the cost of manual annotation.
[0040] Identify and mark business morphemes from business texts. Business morphemes are keywords or phrases in business texts that are related to the rule file. The business morphemes and their codes are combined and vectorized for embedding to generate basic semantic vectors; The basic semantic vector and the extended vector are fused to generate the extended semantic vector; Set a similarity threshold, and based on the extended semantic vector, retrieve the encoding combination that is semantically similar to the business morpheme in the vector space to generate an extended association tag set; The extended semantic vector is generated as follows: V represents the extended semantic vector, E represents the encoding combination, and Embedding(E) represents the vectorized representation of the basic encoding. The extended associative tag set represents the synonym or near-synonymous extended vector. Expand(E) represents the set of extended associated tags of the coding combination E, E′ represents the coding combination that is semantically similar to E, and Sim vec Let V(E) represent the vector space similarity function, V(E′) represent the extended semantic vector of the encoding combination E, V(E′) represent the extended semantic vector of the encoding combination E′, and V(E′) represent the similarity threshold. The vector space similarity function is cosine similarity: Sim vec Let V1 and V2 represent the vector space similarity function, where V1 and V2 represent the first semantic vector and the second semantic vector, respectively. The dot product of semantic vectors This represents the magnitude of vector V1. This represents the magnitude of vector V2; The generated extended associated tag set is used to implement extended applications of precise tag analysis. An extended tracing function merges the target text's encoded combination set with its extended associated tag set. ExtendedTrace represents the extended trace function, Text represents the target text, and Tag(Text) represents the set of encoded combinations of the text.
[0041] 6. Store the training results in the database for later use.
[0042] It also includes the knowledge base construction step, which involves storing the training results in the database: K old K represents the original knowledge base. new This represents the updated knowledge base, and Trace(E) represents the source information of the code combination; The overall system architecture is represented as follows: System represents the overall system architecture, K represents the knowledge base, and Query represents the query retrieval function.
[0043] Query and retrieval functions: , Input-output relationship: .
[0044] Specifically, this application designs an architecture for file hierarchical tagging and encoding and then integration application, which realizes cross-verification and matching of rule files and business files, reverse tracing and forward retrieval, and can achieve automated maintenance and updates with the help of intelligent technology.
[0045] The following example illustrates the feasibility and advancement of the scheme by providing a design example for the first layer—the rule file encoding layer. The encoding and system construction logic of other layers are similar to the first layer, but since the system design is not part of the patent's objectives, it will not be elaborated upon further.
[0046] Example of a rule file encoding layer design scheme.
[0047] I. Overview of the coding structure.
[0048] A layered fixed-length encoding structure is adopted, consisting of 16 bits, with the following format: [Publisher: 6 digits] + [Category: 4 digits] + [Serial Number: 4 digits] + [Version: 2 digits], see Table 1 below for details.
[0049] .
[0050] II. Publisher coding system (6 digits).
[0051] 2.1 Hierarchical structure.
[0052] A three-level hierarchy is adopted: [Level: 1 digit] + [Domain: 1 digit] + [Entity: 4 digits], as detailed in Table 2 below.
[0053] .
[0054] 2.2 The classification criteria are detailed in Table 3 below.
[0055] .
[0056] 2.3 Domain Classification (Second Position) See Table 4 below for details.
[0057] .
[0058] III. Category Coding System (4 digits) 3.1 Hierarchical structure.
[0059] [Major category: 2 characters] + [Minor category: 2 characters].
[0060] 3.2 Major Categories (2 positions) See Table 5 below for details.
[0061] .
[0062] 3.3 Subcategories (2 positions).
[0063] Taking 01-laws and regulations as an example, see Table 6 below for details.
[0064] .
[0065] Taking the 03-technical standard as an example, see Table 7 below for details.
[0066] .
[0067] IV. Serial Number and Version (6 digits).
[0068] 4.1 Serial number (4 digits).
[0069] 0001-9999: Sequential numbers within the year.
[0070] It is reset to 0001 on January 1st every year.
[0071] Version 4.2 (2-bit).
[0072] V1.00-V9.99: Version control.
[0073] Initial version: 01 (indicating V1.0).
[0074] Major revision: Add 1 to the tens digit (02=V2.0).
[0075] minor revision: single digit increments (01, 02, 03... represent V1.1, V1.2).
[0076] V. Encoding Example.
[0077] Example 1: Banking regulatory measures issued by the national financial regulatory authorities Code: 1300010302001501 Disassembly: See Table 8 below for details.
[0078] .
[0079] Full meaning: Industry standard document No. 15 of 2025 issued by the State Financial Supervision and Administration Bureau (V1.0).
[0080] Example 2: Emergency Management Plan issued by the Beijing Municipal Government Code: 31D0010708002302 Disassembly: See Table 9 below for details.
[0081] .
[0082] Example 3: Group standards issued by the China Banking Association Code: 2300010304008901 Disassembly: See Table 10 below for details.
[0083] .
[0084] VI. Extensibility Design.
[0085] 6.1 Bit extension scheme.
[0086] The current 16-bit version supports over 10 billion combinations (before considering the check digit), and can be expanded in the future: see Table 11 below for details.
[0087] .
[0088] 6.2 Expansion of the classification system.
[0089] Publishing Entity Expansion: The first position is reserved as 9 as a custom level. New areas can be expanded using the letters AZ, and case sensitivity can also be considered.
[0090] The second position uses the letters GZ to expand into new areas.
[0091] Entity code 0000 is reserved as "General / Cross-agency".
[0092] Category expansion: Category 90-99 is reserved for user customization.
[0093] Subcategory XX00 is retained as "Other / Comprehensive".
[0094] Supports 4-digit alphanumeric extensions (such as 0A01).
[0095] 6.3 Mapping Relationship Table (Example) { "encoding_schema": "RF-2024-V1", "total_length": 16, "segments": { "publisher": { "length": 6, "structure": "level(1) + domain(1) + entity(4)", "level_map": { "1": "Country / International", "2": "Industry", "3": "Province", "4": "Prefecture-level city", "5": "County-level city", "6": "Enterprise group" }, "domain_map": { "0": "General", "1": "Law", "2": "Public Finance", "3": "Finance", "4": "Education", "5": "Healthcare", "6": "Environmental Protection", "7": "IT" } }, "category": { "length": 4, "structure": "major(2) + minor(2)", "major_map": { "01": "Laws and regulations", "02": "Normative documents", "03": "Technical Standards", "04": "Management System" } }, "sequence": { "length": 4, "range": "0001-9999", "reset_cycle": "annual }, "version": { "length": 2, "format": "V{major}.{minor}", "mapping": "01=V1.0, 02=V1.1...10=V2.0" } } } This application also proposes an encoding and application system based on rule files and corpora to execute the above application method. The system includes: a rule file encoding layer, used to execute S1 to encode the rule file and generate a file encoding containing the publishing subject and category; The chapter and clause coding layer is used to execute S2, encode the chapter and clauses in the rule file, and generate chapter and clause codes that include chapter, section, article, and clause information and support precise positioning of clause text; The standard morpheme encoding layer is used to execute S3, parse the conditional and conclusion morphemes in the rule file clauses, and construct corpus units composed of standard morphemes; the standard morphemes are derived from the rule file. The combination layer is used to execute S4, which associates and combines file encoding, chapter clause encoding and corpus units to construct traceable encoding combinations, and supports the reverse tracing of the clause position and morpheme semantics of the original rule text through encoding combinations. The business morpheme extension layer is used to identify and mark business morphemes from business texts, embed the business morphemes and their encodings into vectors, generate extended semantic vectors by combining synonym or near-synonymous extended vectors, and generate an extended associated tag set based on a similarity threshold. The knowledge base module stores code combinations, extended semantic vectors, source information, and extended association tag sets, and supports query retrieval.
[0096] In summary, this application proposes an encoding method for constructing morpheme corpus tags based on rule-based text, and also proposes scenarios and application methods at the practical level. The encoding and application methods proposed in this application can effectively avoid ambiguity issues in the practical application of Chinese tags, significantly reduce the computational cost of AI technology application analysis, and achieve accurate labeling and source indexing of tagged morpheme corpora. This application also proposes a compatible coverage method to address the generalized fuzzy understanding encountered in AI technology applications, expanding the application scenario space of the solution.
Claims
1. An encoding method based on rule files and corpora, characterized in that, Includes the following steps: S1: Encode the rule file to generate file encoding for indexing the rule file and its publishing entity; S1 includes: The file encoding includes two information dimensions: the publishing entity and the category, represented as follows: F=(O,C), where F represents the file encoding and O represents the publishing entity. m represents the number of publishing entities, and C represents the category. Where n is the number of categories, and the file encoding format is: or F code =concat(O code C code ), F code The encoded value representing the file encoding. Indicates the main body code. This represents the category code, where k represents the number of bits in the category code, and O code The coded value representing the publishing entity, C code This represents the encoded value of the category; concat indicates the encoding concatenation operation. S2: Encode the chapter and clause information in the rule file to generate chapter and clause codes for forming a hierarchical index within the file. The chapter and clause codes must contain at least chapter, section, clause, and paragraph information. S3: Analyze the morphemes in the specific clauses, decompose the clause text into conditional morphemes and conclusion morphemes, and label the conditional morphemes and conclusion morphemes. Construct a corpus unit consisting of a set of conditional morphemes, a set of conclusion morphemes, and a semantic relation operator connecting the set of conditional morphemes and the set of conclusion morphemes. The set of conditional morphemes is a collection of conditional morphemes, the set of conclusion morphemes is a collection of conclusion morphemes, and the semantic relation operator is used to represent the logical mapping relationship between conditional morphemes and conclusion morphemes. Store the corpus unit in the corpus. S4: Associate and combine the file code, chapter and clause code, and corpus units retrieved from the corpus to form a traceable code combination. Based on the traceable code combination, trace back the source of the original rule file, the location of the clause, and the semantics of the morphemes. S4 includes: Traceable coded combinations are represented as: E=(F,S,U)=F×S×U, where E represents the encoding combination, F represents the file encoding, S represents the chapter / clause encoding, and × represents the Cartesian product combination of the encodings; It also includes using a source tracing function to trace the origin of the original rule file, the location of the clause, and the semantics of the morphemes based on traceable code combinations: Trace(E) = (F origin ,S location U semantics Trace represents the source function, F origin Indicates the source of the original rule file, S location Indicates the location of the clause; U semantics It represents the semantic information of a morpheme.
2. The encoding method according to claim 1, characterized in that, S2 include: Chapter and clause codes form a hierarchical index within the document, represented as follows: S=(F,ch,s,a,p), where S represents the chapter / clause code, F represents the document code, ch represents the chapter, s represents the section, a represents the clause, and p represents the paragraph. The encoding format for the chapter / clause code is as follows: S code The code value representing the chapter / clause code; F code The ch value represents the file encoding. code The coded value representing the chapter; s code The encoded value of the section; a code The code value of the bar; p code The code value indicating the item; This indicates an encoding concatenation operation.
3. The encoding method according to claim 1, characterized in that, S3 include: Morphemes include conditional morphemes and conclusion morphemes, and their encoding is represented as follows: M represents morpheme encoding, M cond M represents the set of conditional morphemes. conc A set of morphemes indicating conclusions; Corpus units are represented as: U=(M cond_set M conc_set ,R),M cond_set Represents a set of conditional morphemes. M conc_set Represents the set of morphemes indicating the conclusion. R represents a semantic relation operator used to characterize the logical relationship between the conditional morpheme set and the conclusion morpheme set, including implication, equivalence, or exclusion relations. M cond M represents the set of conditional morphemes. conc m represents the set of conclusion morphemes. ci Let m represent the i-th conditional morpheme in the c-th corpus unit. kj This represents the j-th conclusion morpheme in the k-th corpus unit.
4. The encoding method according to claim 3, characterized in that, S3 also includes a corpus management step: comparing the newly constructed corpus unit with the existing corpus units in the corpus. If the semantics of the newly constructed corpus unit do not overlap with the existing corpus units in the corpus, the newly constructed corpus unit and its corresponding encoding information are stored in the corpus to realize the dynamic updating of the corpus. The corpus units constructed by S3 achieve semantic mapping from the condition morpheme set to the conclusion morpheme set through a semantic combination function, which is expressed as: Semantic represents the semantic composition function, f represents the semantic function of the conditional morpheme set, and g represents the semantic function of the conclusion morpheme set. This represents the mapping relationship under the action of the semantic relation operator R; It also includes a semantic disambiguation mechanism to ensure that corpus units with the same text description but different encodings have different semantics: U1 and U2 represent the first corpus unit and the second corpus unit, respectively; desc(U1) and desc(U2) represent the text description of the first corpus unit and the text description of the second corpus unit, respectively. U1.code and U2.code represent the encoding of the first corpus unit and the encoding of the second corpus unit, respectively; Semantic(U1) and Semantic(U2) represent the semantics of the first corpus unit and the semantics of the second corpus unit, respectively. It means any.
5. The encoding method according to claim 1, characterized in that, S4 include: The encoding combination constructed by S4 is used to implement semantic tagging of text, and the target text is mapped to a set of encoding combinations through the text semantic tag mapping function: , Tag represents the text semantic tag mapping function, and Text represents the target text; E i Represents the i-th encoding combination; Semantic(E i ) represents the encoding combination E i The semantics of Meaning(Text) are: Meaning(Text) represents the meaning of the text. Indicates semantic correspondence; The encoding combinations constructed by S4 are also used to compare the similarity between texts. The similarity is calculated based on the set of encoding combinations of the first and second texts using a text similarity calculation function. Sim represents the similarity calculation function, Text1 and Text2 represent the first and second texts to be compared, and Tag(Text1) and Tag(Text2) represent the sets of encoded combinations of the first and second texts, respectively. The cardinality of a set.
6. An application method based on the encoding method according to any one of claims 1 to 5, characterized in that, Includes the following steps: Identify and mark business morphemes from business texts. Business morphemes are keywords or phrases in business texts that are related to the rule file. The business morphemes and their codes are combined and vectorized for embedding to generate basic semantic vectors; The basic semantic vector and the extended vector are fused to generate the extended semantic vector; Set a similarity threshold, and based on the extended semantic vector, retrieve the encoding combination that is semantically similar to the business morpheme in the vector space to generate an extended association tag set; The extended semantic vector is generated as follows: V represents the extended semantic vector, E represents the encoding combination, and Embedding(E) represents the vectorized representation of the basic encoding. The extended associative tag set represents the synonym or near-synonymous extended vector. Expand(E) represents the set of extended associated tags of the coding combination E, E′ represents the coding combination that is semantically similar to E, and Sim vec Let V(E) represent the vector space similarity function, V(E) represent the extended semantic vector of the encoding combination E, and V(E′) represent the extended semantic vector of the encoding combination E′. Indicates the similarity threshold; The vector space similarity function is cosine similarity: Sim vec Let V1 and V2 represent the vector space similarity function, where V1 and V2 represent the first semantic vector and the second semantic vector, respectively. The dot product of semantic vectors This represents the magnitude of vector V1. This represents the magnitude of vector V2; The generated extended associated tag set is used to implement extended applications of precise tag analysis. An extended tracing function merges the target text's encoded combination set with its extended associated tag set. ExtendedTrace represents the extended trace function, Text represents the target text, and Tag(Text) represents the set of encoded combinations of the text. It also includes the knowledge base construction step, which involves storing the training results in the database: K old K represents the original knowledge base. new This represents the updated knowledge base, and Trace(E) represents the source information of the code combination; The overall system architecture is represented as follows: System represents the overall system architecture, K represents the knowledge base, Query represents the query retrieval function, F represents the file encoding, S represents the chapter / clause encoding, and U represents the corpus unit.
7. A coding and application system based on rule files and corpora, characterized in that, To implement the application method as described in claim 6, the system includes: a rule file encoding layer, used to perform S1, encode the rule file, and generate a file encoding containing the publishing subject and category; The chapter and clause coding layer is used to execute S2, encode the chapter and clauses in the rule file, and generate chapter and clause codes that include chapter, section, article, and clause information and support precise positioning of clause text; The standard morpheme encoding layer is used to execute S3, parse the conditional and conclusion morphemes in the rule file clauses, and construct corpus units composed of standard morphemes; the standard morphemes are derived from the rule file. The combination layer is used to execute S4, which associates and combines file encoding, chapter clause encoding and corpus units to construct traceable encoding combinations, and supports the reverse tracing of the clause position and morpheme semantics of the original rule text through encoding combinations. The business morpheme extension layer is used to identify and mark business morphemes from business texts, embed the business morphemes and their encodings into vectors, generate extended semantic vectors by combining synonym or near-synonymous extended vectors, and generate an extended associated tag set based on a similarity threshold. The knowledge base module stores code combinations, extended semantic vectors, source information, and extended association tag sets, and supports query retrieval.