File analysis methods, equipment, media and products

By converting policy documents into clause trees and performing semantic vectorization processing, and using cosine similarity and point mutual information to calculate the correlation between clauses, the problem of inefficient policy document interpretation in government systems is solved, and efficient and accurate policy conflict detection and consistency analysis are achieved.

CN120295978BActive Publication Date: 2025-10-14ROPEOK TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510778448.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-10-14
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

The interpretation of policy documents in existing government systems relies on manual analysis and judgment, which is highly subjective, inefficient, and has a high rate of missed detections. In addition, the heterogeneity of government data makes it difficult to quantify policy implementation indicators, and it is impossible to accurately identify the implicit meanings and contextual relationships in the clauses.

Method used

The policy document is converted into a clause tree. Through semantic vectorization and structured analysis, the correlation between clauses is calculated using cosine similarity and point mutual information, and an adaptive update model is constructed for policy conflict detection.

Benefits of technology

It achieves comprehensive and detailed analysis of policy documents, improves the consistency and transparency of policy implementation, significantly enhances the accuracy and efficiency of conflict detection, and supports policy optimization and dynamic adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295978B_ABST
    Figure CN120295978B_ABST
Patent Text Reader

Abstract

The present disclosure provides a file analysis method, device, medium and product. The file analysis method of the present disclosure comprises: obtaining policy files belonging to different levels of effectiveness or different administrative departments; wherein the policy files comprise a first file and a second file; parsing the policy files to obtain a clause tree; wherein the nodes in the clause tree contain clause sentences in the policy files; the clause tree comprises a first tree corresponding to the first file and a second tree corresponding to the second file; performing vectorization processing on the clause sentences in the clause tree to obtain a first semantic vector corresponding to the first file and a second semantic vector corresponding to the second file; and using the first tree and the first semantic vector, the second tree and the second semantic vector to calculate a policy file analysis result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more particularly to file analysis methods, devices, media, and products. Background Art

[0002] With the development of digital technology, more and more work scenarios are being digitalized, and the digital application of government systems is one of them.

[0003] With existing technologies, the digital transformation of government systems has provided significant benefits for staff, reducing workloads such as printing and signing paper documents and significantly improving work efficiency. However, this has also created numerous challenges. For example, with improved office efficiency, the frequency and number of policy document updates have increased significantly. However, policy interpretation relies on manual analysis and judgment, which is subject to high subjectivity, low efficiency, and high rates of missed detection. The heterogeneous nature of government data also makes it difficult to quantify policy implementation indicators. Summary of the Invention

[0004] The present disclosure provides file analysis methods, devices, media, and products.

[0005] According to a first aspect of the present disclosure, a document analysis method is provided. The method specifically comprises: obtaining policy documents belonging to different effectiveness levels or different administrative departments; wherein the policy documents include a first document and a second document; parsing the policy documents to obtain a clause tree; wherein the nodes in the clause tree include clause statements in the policy documents; the clause tree includes a first tree corresponding to the first document and a second tree corresponding to the second document; vectorizing the clause statements in the clause tree to obtain a first semantic vector corresponding to the first document and a second semantic vector corresponding to the second document; and calculating the policy document analysis results using the first tree and the first semantic vector, the second tree and the second semantic vector.

[0006] Based on the above content, it can be seen that when conducting document analysis, due to the different levels of issuance of policy documents, different administrative departments, and different levels of effectiveness. Therefore, when formulating policy documents, it is necessary to fully consider whether the policy document conflicts or contradicts with other policies. Since policy documents often have a lot of content and the clause levels are cumbersome, in order to facilitate the analysis of policy documents, the policy documents can be converted into a clause tree, and then the clause tree can be converted into a semantic vector. Then, the clause tree and semantic vector are used to analyze the first file to obtain the analysis result. This analysis result is used to indicate the degree of conflict between the first file and the second file. Through the above method, it is possible to more comprehensively and detailedly analyze whether the first file has obvious conflicts with the other second files. Moreover, the analysis process is a comprehensive analysis based on the clause statements and the contextual relationship of the clause statements, rather than only analyzing by the similarity of words and phrases. Therefore, the analysis results are more comprehensive and accurate.

[0007] According to at least one embodiment of the present disclosure, the method further includes: marking result identifiers indicating the degree of conflict in the nodes of the first tree with different colors according to the analysis results.

[0008] Based on the above, we can see that this visual identification method based on the clause tree not only clearly reflects the logical relationships within the policy, but also helps decision makers efficiently identify and resolve cross-level and cross-departmental policy conflicts, improving the consistency and transparency of policy implementation. At the same time, users can intuitively understand which clauses in the current clause are in conflict through the clause tree, effectively improving the efficiency of policy document review.

[0009] According to at least one embodiment of the present disclosure, the policy document is parsed to determine the format structure and / or semantic structure contained in the policy document; based on the format structure and / or semantic structure, the clause statements used as nodes in the clause tree are obtained; if the format structure or semantic structure is not found, the policy document is segmented to obtain clause statements used as nodes in the clause tree; and the clause tree is constructed using the contextual relationship of the clause statements.

[0010] Based on the above, we can see that each node in the constructed clause tree has clear and accurate contextual relationships, as well as the logical relationships implicit in the context. This provides a data foundation for subsequent clause analysis, thereby improving the accuracy of clause conflict analysis.

[0011] According to at least one embodiment of the present disclosure, a clause sentence in a node of a clause tree is obtained; and the clause sentence is vectorized to obtain a sentence vector with a specified dimension.

[0012] Based on the above, we can see that the resulting sentence vectors will serve as the core input for subsequent modules such as relevance calculation and conflict assessment, supporting the system's intelligent policy consistency analysis. They will also provide the data foundation for subsequent similarity calculation and conflict analysis.

[0013] According to at least one embodiment of the present disclosure, the effective time and effectiveness level corresponding to each clause statement are determined based on the release information of the policy document; and the clause statements carrying the effective time and effectiveness level are used as nodes to construct a clause tree.

[0014] As can be seen above, this structured clause tree not only intuitively presents the logical framework of the policy document but also provides a precise data foundation for subsequent semantic comparison, conflict identification, and dynamic monitoring, effectively supporting the intelligent analysis capabilities of the policy consistency early warning system. Unlike existing techniques that analyze only based on segmented characters and words, the clause tree provides a wider range of logical relationships between clauses and their underlying meanings.

[0015] According to at least one embodiment of the present disclosure, the cosine similarity and point mutual information between the first semantic vector and the second semantic vector are calculated; the correlation between the first semantic vector and the second semantic vector is calculated using the cosine similarity and point mutual information; when the correlation is greater than the correlation threshold, the clause analysis result is calculated.

[0016] Based on the above content, it can be seen that this process can not only effectively identify the explicit and implicit connections between policy clauses, but also significantly improve the accuracy and efficiency of conflict detection through a structured and semantic dual comparison mechanism, providing a basis for policy optimization.

[0017] According to at least one embodiment of the present disclosure, the structural path similarity between the first node corresponding to the first semantic vector in the first tree and the second node corresponding to the second semantic vector in the second tree is analyzed; when the structural path similarity is greater than a first threshold, the cosine similarity and point mutual information of the first clause statement in the first node and the second clause statement in the second node are calculated; and the association between the first semantic vector and the second semantic vector is calculated using the cosine similarity and point mutual information.

[0018] Based on the above content, it can be seen that it can not only effectively identify the explicit and implicit connections between policy clauses, but also significantly improve the accuracy and efficiency of conflict detection through a structured and semantic dual comparison mechanism, providing a basis for policy optimization.

[0019] According to at least one embodiment of the present disclosure, a keyword set of the first clause statement and the second clause statement is extracted; point mutual information is calculated using the keyword set; and the cosine similarity between the first semantic vector corresponding to the first clause statement and the second semantic vector corresponding to the second clause statement is calculated.

[0020] Based on the above, we can see that this method not only effectively identifies explicit and implicit connections between policy clauses, but also significantly improves the accuracy and efficiency of conflict detection through multi-level semantic parsing and quantitative analysis, providing a basis for policy optimization. Furthermore, before calculating conflicts between clauses, it first evaluates their relevance using cosine similarity and point mutual information, screening out clauses with high relevance for conflict analysis, effectively reducing the workload of conflict analysis.

[0021] According to at least one embodiment of the present disclosure, a first structural path for a first node in a first tree to represent a contextual relationship and a second structural path for a second node in a second tree to represent a contextual relationship are obtained; and a structural path similarity between the first structural path and the second structural path is calculated.

[0022] Based on the above, we can see that by first calculating structural path similarity using the term tree, we can quickly find nodes with similar structural paths. Similar structural paths mean that the terms within the nodes are more likely to have high correlations. In other words, the structural path similarity evaluation process is simpler and more efficient. Therefore, evaluating structural path similarity first, then calculating correlations, avoids extensive correlation calculations and effectively improves correlation calculation efficiency.

[0023] According to at least one embodiment of the present disclosure, keywords are extracted from the first file and the second file respectively using a specified extraction method; wherein the specified extraction method includes: TF-IDF, BERT attention weight analysis, entity / term extraction; and a keyword set is constructed using the extracted keywords.

[0024] Based on the above content, we can see that these keyword sets not only provide basic data for subsequent pointwise mutual information (PMI) calculations, but also help the system more accurately quantify the semantic relevance between policy clauses, thereby significantly improving the accuracy and efficiency of conflict detection.

[0025] According to at least one embodiment of the present disclosure, the time difference, effectiveness level and correlation of the effective time are determined; and the clause analysis result is calculated using the time difference, effectiveness level and correlation.

[0026] Based on the above content, it can be seen that the final generated clause analysis results can not only clearly reflect the severity of the conflict, but also provide a scientific basis for subsequent risk assessment and visual early warning, helping decision makers quickly identify problems and take optimization measures.

[0027] According to at least one embodiment of the present disclosure, an adaptive update model is constructed; the cross entropy loss corresponding to the newly acquired policy documents, the KL divergence of the historical policy documents, the model parameters, and the penalty coefficient of the KL divergence are used to calculate the model weight vector after integrating the new and old policy knowledge.

[0028] Based on the above content, it can be seen that this mechanism not only improves the system's response speed to policy changes, but also provides more accurate and reliable support for policy conflict detection, thereby significantly enhancing the system's dynamic adaptability and intelligence level.

[0029] According to a second aspect of the present disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the method described in the first aspect of any embodiment of the present disclosure.

[0030] According to a third aspect of the present disclosure, a readable storage medium is provided, in which execution instructions are stored. When the execution instructions are executed by a processor, they are used to implement the method described in the first aspect of any embodiment of the present disclosure.

[0031] According to a fourth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method according to the first aspect of any embodiment of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0033] Figure 1 A flowchart of a file analysis method provided by the present disclosure.

[0034] Figure 2 This is a schematic diagram of the structure of the first tree or the second tree exemplified in the present disclosure.

[0035] Figure 3 A schematic diagram illustrating the clause analysis and visualization process of the present disclosure.

[0036] Figure 4 This is a schematic block diagram of the structure of a file analysis device according to one embodiment of the present disclosure.

[0037] Figure 5 The present invention is a block diagram showing the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The present disclosure is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are intended only to illustrate the relevant content and are not intended to limit the present disclosure. It should also be noted that, for ease of description, only the portions relevant to the present disclosure are shown in the accompanying drawings.

[0039] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solutions of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0040] In the digital application of policy documents, an increasing number of electronic documents are being managed digitally. With existing technologies, the digital transformation of government systems has provided significant convenience for staff, reducing workloads such as printing and signing paper documents and significantly improving work efficiency. However, this has also created numerous challenges. For example, with improved office efficiency, the frequency and number of policy document updates have increased significantly. However, policy interpretation relies on manual analysis and judgment, which is subject to strong subjectivity, low efficiency, and high rates of missed detection. The heterogeneous nature of government data also makes it difficult to quantify policy implementation indicators.

[0041] While AI models have been introduced in some application scenarios to assist in interpreting policy documents, these often rely on keyword matching, which cannot accurately identify implicit meanings within clauses or the contextual relationships between different clauses. This is particularly true for policy documents at different levels of effectiveness or from different administrative departments, where differing descriptive terms can lead to conflicts. Therefore, a solution that can accurately parse policy documents is urgently needed.

[0042] For the convenience of description and to make the technical solutions of the specific embodiments of the present disclosure easier to understand, before describing the file analysis method implemented by the present disclosure, the technical terms involved in the specific embodiments of the present disclosure are explained as follows.

[0043] The effectiveness level can be understood as the administrative level at which policy documents are issued.

[0044] After parsing the policy document, the clauses in the policy document are used as nodes in the clause tree. In other words, the policy document is represented as a knowledge graph in the form of a clause tree.

[0045] Figure 1 This is a flowchart of a file analysis method provided by the present disclosure. Figure 1 The method shown includes steps 101 to 104. The method may be executed by a file analysis device.

[0046] In step 101, policy documents belonging to different effectiveness levels or different administrative departments are obtained, wherein the policy documents include a first document and a second document.

[0047] In practical applications, each department will discard some outdated policy documents according to the needs of the executive ability, supplement some new policy documents or policy content that meet the current needs. When each administrative level formulates a policy document, it will be formulated according to the current latest policy direction. The formulated policy document may be for merchants or for subordinate administrative departments. The subordinate administrative departments will draft and issue policy documents according to their own interpretation of the local actual situation and notify the merchants or grassroots workers to execute. Generally, there is no conflict between the policy documents issued by the same administrative department. However, there may be direct or implicit conflicts between the policy documents issued by different administrative departments of the same level of effectiveness or different administrative departments of different levels of effectiveness.

[0048] The first document and the second document mentioned here can be policy documents belonging to different levels of effectiveness respectively. For example, the first document is a low-effectiveness policy document, and the second document is a high-effectiveness policy document. Alternatively, the first document and the second document mentioned here are policy documents belonging to different administrative departments of the same level respectively. For example, the first document is a policy document issued by a low-effectiveness department, and the second document is a policy document issued by another low-effectiveness department.

[0049] Step 102: Analyzing the policy document to obtain a clause tree. The nodes in the clause tree contain the clause statements in the policy document. The clause tree includes a first tree corresponding to the first document and a second tree corresponding to the second document.

[0050] The clause tree mentioned here contains many clause tree nodes. Moreover, each node contains a corresponding clause statement. In other words, the clause statement is the smallest analysis unit in the clause tree, and the clause statement does not need to be further split into single words or characters. In the clause tree, the hierarchical relationship and context relationship between the clause statements are expressed through the hierarchical connection relationship between the nodes.

[0051] In the nodes of the clause tree, in addition to storing the parsed clause statements, the effective time and the level of effectiveness corresponding to the policy document are also stored, which provides a basis for subsequent analysis of the similarity of each clause.

[0052] The policy document analysis process will be described in subsequent embodiments, which will not be repeated here.

[0053] It should be noted that when converting the policy document into a clause tree, it can be converted in batches and stored in a specified location. When needed later, the clause tree can be extracted at any time.

[0054] Step 103: vectorizing the clause statements in the clause tree to obtain a first semantic vector corresponding to the first file and a second semantic vector corresponding to the second file.

[0055] As described above, after the clause tree is generated, each clause statement is stored in each node of the clause tree.

[0056] For the convenience of subsequent analysis, the clause statements in the nodes need to be vectorized into semantic vectors. Here, the semantic vector obtained by vectorizing the clause statements in the first file is referred to as a first semantic vector, and the semantic vector obtained by vectorizing the clause statements in the second file is referred to as a second semantic vector.

[0057] When vectorizing, the clause statements in the specified nodes can be selected for vectorization according to actual needs. For example, the clause statements in the nodes with the same or similar structure paths are selected for vectorization. The specific vectorization process will be described in subsequent embodiments, which will not be repeated here.

[0058] Step 104: calculating the policy file analysis result by using the first tree and the first semantic vector, and the second tree and the second semantic vector.

[0059] The clause analysis result referred to herein refers to the result of the clause conflict analysis. When analyzing the clauses, the clause tree and the semantic vector need to be used for analysis. It should be noted that since some clause trees are relatively large and contain many nodes, it means that many clause statements need to be analyzed. If each clause statement is analyzed, a large amount of computing power will be consumed, and the analysis efficiency is very low.

[0060] Therefore, the scheme of the present disclosure proposes that part of the nodes with certain similarity can be selected from the clause tree for conflict analysis according to actual needs.

[0061] That is, before the conflict analysis, the nodes with similarity are found from the first tree and the second tree. The more similar the clause statements in the nodes are, the greater the probability of conflict is. Further, the clause statements in the nodes with high similarity are analyzed for conflict.

[0062] Based on the above-mentioned public scheme, when conducting document analysis, due to the different levels of issuance of policy documents, different administrative departments, and different levels of effectiveness. Therefore, when formulating policy documents, it is necessary to fully consider whether the policy document conflicts or contradicts with other policies. Since policy documents often have a lot of content and the clause levels are cumbersome, in order to facilitate the analysis of policy documents, the policy documents can be converted into a clause tree, and then the clause tree is converted into a semantic vector. Then, the first file is analyzed using the clause tree and the semantic vector to obtain the analysis result. This analysis result is used to indicate the degree of conflict between the first file and the second file. Through the above method, it is possible to more comprehensively and detailedly analyze whether the first file has obvious conflicts with the other second files. This analysis process is a comprehensive analysis based on the clause statements and the contextual relationship of the clause statements, rather than just analysis through the similarity of words and phrases. Therefore, the analysis results are more comprehensive and accurate.

[0063] In one or more embodiments of the present disclosure, the method further includes: marking result identifiers indicating the degree of conflict in the nodes of the first tree with different colors according to the analysis results.

[0064] Based on the results of the conflict analysis, the system will mark the result identifiers indicating the degree of conflict in the nodes of the first tree with different colors to intuitively present the conflict situation between the policy clauses. Specifically, the system will combine the risk score generated by the dynamic conflict detection engine and color each clause node according to the preset warning classification rules. For example, red indicates high-risk conflict, yellow indicates medium-risk conflict, and green indicates no conflict or low risk. For example, when a high-effectiveness policy and a low-effectiveness policy have serious contradictions in specific clauses and the impact is wide-ranging, the relevant clause nodes will be marked in red, with a detailed conflict score and analysis report; for clauses with less impact or only potential risks, they may be marked in yellow or green. In addition, users can click on the node to view the specific cause of the conflict, related clauses, and optimization suggestions, so as to quickly locate the problem and take corresponding measures.

[0065] Based on the above-mentioned public plan, it can be seen that this visual identification method based on the clause tree can not only clearly reflect the logical relationship within the policy, but also help decision makers efficiently identify and resolve cross-level and cross-departmental policy conflicts, and improve the consistency and transparency of policy implementation.

[0066] In one or more embodiments of the present disclosure, the policy file is parsed to obtain a clause tree, including: parsing the policy file to determine the format structure and / or semantic structure contained in the policy file; based on the format structure and / or semantic structure, splitting to obtain a clause sentence used as a node in the clause tree; if no format structure or semantic structure is found, segmenting the policy file to obtain a clause sentence used as a node in the clause tree; and constructing the clause tree using the context relationship of the clause sentence.

[0067] The process of parsing the policy file to generate the clause tree is one of the core links of the policy consistency early warning system, and the goal is to convert the unstructured policy text into structured data with clear logical relationships. First, the system deeply parses the policy file through natural language processing technology to identify the format structure and semantic structure contained therein. The format structure mainly includes numbering rules (such as "Article 1", "1.1", etc.), paragraph identifiers (such as line breaks, indents, etc.), and structural guide words (such as "as follows", "apply to", etc.), which provide clear boundaries for clause splitting. The semantic structure further excavates the implicit logical relationships between clauses, such as master-slave relationship, cause-effect relationship, or parallel relationship, through dependency syntax analysis and semantic role labeling. If the policy file lacks obvious format or semantic structure (such as pure text or scanned PDF documents converted), the system will segment the file into independent semantic units based on language models combined with punctuation symbols and semantic segmentation algorithms. Each semantic unit is a node in the clause tree, and the node content includes specific clause sentences and their context information. For example, Figure 2 The structure diagram of the first tree or the second tree illustrated by the present disclosure. From Figure 2 As can be seen from the above, when constructing the clause tree (which can be the first tree corresponding to the first file or the second tree corresponding to the second file), the system uses the context relationship of the clause sentence to associate the main clause with the sub-clause layer by layer, forming a hierarchical structure of "main clause-sub-clause-sub-clause", and the effective time, validity level, and other meta-information. For example, "AAA completes BBB in 2025" can be split into the main clause "AAA needs to perform BBB" and the sub-clause "applicable to AAA" and "expiration date is 2025", and further organized into a tree structure. The finally generated clause tree not only can intuitively reflect the logical framework of the policy text, but also provides an accurate data basis for subsequent semantic comparison and conflict detection.

[0068] Based on the above disclosed scheme, each node in the constructed clause tree has a clear and accurate context relationship, as well as the implicit logical relationship in the context. This provides a data basis for subsequent clause analysis, thereby facilitating the improvement of the accuracy of clause conflict analysis.

[0069] In one or more embodiments of the present disclosure, the clause sentences in the clause tree are vectorized, specifically including: obtaining the clause sentences in the nodes of the clause tree; and vectorizing the clause sentences to obtain sentence vectors with specified dimensions.

[0070] In practical applications, vectorizing clauses in a clause tree is a key step in achieving deep semantic understanding in policy consistency early warning systems. Specifically, each clause sentence is first extracted from the nodes of the clause tree. These sentences may be main clauses, subclauses, or further refined semantic units. These extracted clause sentences are then fed into a deep learning-based language model (such as Legal-BERT) for vectorization. During this process, the model uses a multi-layer Transformer encoder to perform context-aware semantic parsing of the clause sentences and generates sentence vectors with a specified dimensionality (e.g., 768). These vectors not only capture the explicit semantic information of the clause sentences but also, through an attention mechanism, mine deep semantic features such as implicit conditions, exceptions, and complex logical relationships. For example, after vectorization, the two sentences "AAA will complete BBB by 2025" and "CCC can continue DDD" can be represented as high-dimensional vectors, providing an accurate data foundation for further semantic comparison and conflict detection. Furthermore, to improve the efficiency and accuracy of vectorization, the system can also fine-tune the model by integrating it with domain-specific knowledge bases to ensure its applicability and robustness to policy texts.

[0071] Based on the above, we can see that the resulting sentence vectors will serve as the core input for subsequent modules such as relevance calculation and conflict assessment, supporting the system's intelligent policy consistency analysis. They will also provide the data foundation for subsequent similarity calculation and conflict analysis.

[0072] In one or more embodiments of the present disclosure, a clause tree is constructed using the contextual relationship of clause statements, including: determining the effective time and effectiveness level corresponding to each clause statement based on the release information of the policy document; and constructing a clause tree using clause statements carrying the effective time and effectiveness level as nodes.

[0073] The process of constructing a clause tree based on the contextual relationships of clauses is a key step in organizing clauses in a policy document into a hierarchical structure according to its logical structure. First, the system extracts metadata such as the effective date and effectiveness level of each clause based on the policy document's publication information (such as the title, preamble, and appendices). For example, high-effectiveness policies typically have a higher effectiveness level, while low-effectiveness policies have a lower effectiveness level. The effective date of a clause may be explicitly stated in the text (e.g., "effective from January 1, 2025") or inferred from the publication date. This metadata, combined with the semantic content of the clause, provides a crucial basis for subsequent conflict detection and risk assessment. Next, the system uses clauses carrying metadata such as effective date and effectiveness level as nodes and constructs a clause tree based on their contextual relationships. Specifically, the main clause serves as the root node, with subclauses and supplementary notes as child nodes, forming a hierarchical structure of "policy-clause-subclause." For example, a main clause, such as "AAA completes BBB by 2025," can be broken down into subclauses such as "applicable to AAA" and "deadline 2025," with corresponding validity levels and effective dates marked. Furthermore, the construction of the clause tree incorporates dependency parsing technology to ensure that the logical relationships between nodes accurately reflect the actual intent of the policy text.

[0074] Based on the aforementioned disclosures, this structured clause tree not only intuitively presents the logical framework of policy documents but also provides a precise data foundation for subsequent semantic comparison, conflict identification, and dynamic monitoring, effectively supporting the intelligent analysis capabilities of the policy consistency early warning system. Unlike existing techniques that analyze only based on segmented characters and words, the clause tree provides a broader range of logical relationships between clauses, as well as hidden meanings.

[0075] In one or more embodiments of the present disclosure, the first tree and the first semantic vector, the second tree and the second semantic vector are used to calculate the clause analysis result, specifically including: calculating the cosine similarity and point mutual information between the first semantic vector and the second semantic vector; calculating the correlation between the first semantic vector and the second semantic vector using the cosine similarity and point mutual information; when the correlation is greater than the correlation threshold, the clause analysis result is calculated.

[0076] The process of calculating the policy document analysis results using the first tree and the first semantic vector, the second tree and the second semantic vector is a key step in achieving accurate conflict detection in the policy consistency early warning system. First, the system extracts the semantic vectors corresponding to the nodes in the first tree and the second tree, including the first semantic vector and the second semantic vector. The semantic vector can have a specified dimension, such as the 768-dimensional vector generated based on Legal-BERT. The cosine similarity and point mutual information between the first semantic vector and the second semantic vector are calculated. Cosine similarity is used to measure the degree of directional proximity of two semantic vectors in high-dimensional space, reflecting the relevance of the overall semantics of the clause; while point mutual information captures the potential connection between the two clause keyword sets in specific expressions by quantifying the co-occurrence probability of the two clause keyword sets.

[0077] For example, for “Policy A requires AAA to complete BBB” and “Policy B provides AAA with DDD”, the system will extract a set of keywords (such as “AAA”, “BBB”, “DDD”) and calculate their point mutual information values ​​to evaluate whether there is implicit conflict between these keywords at the semantic level.

[0078] The system then combines cosine similarity and point mutual information to calculate the overall correlation between the first and second semantic vectors using a weighted formula. The weighting coefficient can be dynamically adjusted based on actual needs. When the calculated correlation exceeds a preset correlation threshold, the system determines that there is a potential conflict or overlap between the two policy clauses, further triggering the conflict assessment model to generate detailed clause analysis results.

[0079] Based on the above-mentioned public solution, it can be seen that this process can not only effectively identify the explicit and implicit connections between policy clauses, but also significantly improve the accuracy and efficiency of conflict detection through a structured and semantic dual comparison mechanism, providing a basis for policy optimization.

[0080] In one or more embodiments of the present disclosure, the association between a first semantic vector and a second semantic vector is calculated using cosine similarity and point mutual information, including: analyzing the structural path similarity between a first node corresponding to the first semantic vector in a first tree and a second node corresponding to the second semantic vector in a second tree; when the structural path similarity is greater than a first threshold, calculating the cosine similarity and point mutual information of a first clause statement in the first node and a second clause statement in the second node; and calculating the association between the first semantic vector and the second semantic vector using cosine similarity and point mutual information.

[0081] Using cosine similarity and point mutual information to calculate the correlation between the first semantic vector and the second semantic vector is a key step in achieving accurate semantic comparison in the policy consistency early warning system.

[0082] The system analyzes the structural path similarity between the first node corresponding to the first semantic vector in the first tree and the second node corresponding to the second semantic vector in the second tree. Structural path similarity measures whether the hierarchical relationship and logical context of two nodes in the clause tree are similar. For example, whether both nodes belong to subclauses under a specific topic path such as "AAA" or "DDD"?

[0083] If the structural path similarity exceeds a preset first threshold, the cosine similarity and pointwise mutual information (PMI) of the first clause in the first node and the second clause in the second node are further calculated. Cosine similarity reflects the overall semantic relevance of the clauses by comparing the directional proximity of two semantic vectors; while PMI captures the potential connection between the two clauses in their specific expressions by quantifying the probability of co-occurrence of keyword sets. For example, "AAA" and "BBB" may frequently co-occur in multiple clauses, and their high PMI values ​​indicate a strong semantic connection between the two.

[0084] Furthermore, by combining cosine similarity and point mutual information, the comprehensive correlation between the first semantic vector and the second semantic vector is calculated through a weighted formula, and the weight coefficient can be dynamically adjusted according to actual needs.

[0085] Based on the above-mentioned public scheme, it can be seen that it can not only effectively identify the explicit and implicit connections between policy clauses, but also significantly improve the accuracy and efficiency of conflict detection through a structured and semantic dual comparison mechanism, providing a basis for policy optimization.

[0086] In one or more embodiments of the present disclosure, the cosine similarity and point mutual information of a first clause statement in a first node and a second clause statement in a second node are calculated, specifically including: extracting a keyword set of the first clause statement and the second clause statement; using the keyword set to calculate the point mutual information; and calculating the cosine similarity between a first semantic vector corresponding to the first clause statement and a second semantic vector corresponding to the second clause statement.

[0087] The process of calculating the cosine similarity and point mutual information between the first clause statement in the first node and the second clause statement in the second node is a key link in achieving accurate semantic comparison in the policy consistency early warning system.

[0088] Keyword sets for the first and second clauses are extracted. These keyword sets are generated using various methods: TF-IDF is used to filter out high-frequency and discriminative words, attention weight analysis is combined with the Legal-BERT model to capture semantically significant key words, and entities and terminology are extracted from the government affairs knowledge base. For example, "AAA will complete BBB by 2025" might extract keywords such as "AAA," "BBB," and "2025," while "CCC can continue DDD" might extract keywords such as "CCC" and "DDD."

[0089] Based on these keyword sets, the system calculates pointwise mutual information (PMI), quantifying the probability of keywords co-occurring in the two clauses to assess their potential connection within the specific expressions. For example, if "AAA" appears frequently in both clauses, its PMI value is high, indicating a strong semantic connection between the two clauses.

[0090] Next, the cosine similarity between the first semantic vector corresponding to the first clause and the second semantic vector corresponding to the second clause is calculated. By comparing the directional proximity of the two vectors, the overall semantic relevance of the clause is reflected.

[0091] Furthermore, the results of cosine similarity and point mutual information are weighted and fused to form a comprehensive correlation score, which is used to determine whether there is a potential conflict or synergy between two clauses.

[0092] This publicly available solution not only effectively identifies explicit and implicit connections between policy clauses, but also significantly improves the accuracy and efficiency of conflict detection through multi-level semantic parsing and quantitative analysis, providing a basis for policy optimization. Furthermore, before calculating conflicts between clauses, it first assesses their relevance using cosine similarity and point-wise mutual information, screening out clauses with high relevance for conflict analysis, effectively reducing the workload of conflict analysis.

[0093] In one or more embodiments of the present disclosure, analyzing the structural path similarity between a first node in a first tree and a second node in a second tree specifically includes: obtaining a first structural path for the first node in the first tree to represent a contextual relationship, and a second structural path for the second node in the second tree to represent a contextual relationship; and calculating the structural path similarity between the first structural path and the second structural path.

[0094] Analyzing the structural path similarity between the first node in the first tree and the second node in the second tree is an important step in achieving accurate conflict detection in the policy consistency early warning system.

[0095] Obtain the first structural path of the first node in the first tree and the second structural path of the second node in the second tree. These structural paths represent the contextual logical relationship of the nodes through the hierarchical relationship of "policy-clause-subclause". For example, "BBB > AAA > deadline" is a typical structural path.

[0096] Specifically, the extraction of the first structural path and the second structural path depends on the hierarchical organization of the clause tree. The path of each node consists of its complete hierarchical identification from the root node to the current node, ensuring that it can accurately reflect the position and semantic constraints of the node in the entire policy text.

[0097] By calculating the similarity between two structural paths, the logical connection between two nodes in the policy text is assessed. This similarity calculation typically uses methods based on tree edit distance (TED) or path matching algorithms, taking into account factors such as path length, node label similarity, and hierarchical overlap. For example, if two paths both involve clauses related to "AAA" and have similar hierarchical logical structures, their structural path similarity is high; conversely, if one path involves "BBB" and the other involves "DDD," the similarity is low.

[0098] Based on the aforementioned public solution, we can see that by first calculating structural path similarity using the clause tree, we can quickly find nodes with similar structural paths. Similar structural paths mean that the clauses within the nodes are more likely to have high correlations. In other words, the structural path similarity evaluation process is simpler and more efficient. Therefore, evaluating structural path similarity first, then calculating correlations, avoids extensive correlation calculations and effectively improves correlation calculation efficiency.

[0099] In one or more embodiments of the present disclosure, extracting a keyword set from the first clause statement and the second clause statement specifically includes: using a specified extraction method to extract keywords from the first file and the second file respectively; wherein the specified extraction method includes: TF-IDF, BERT attention weight analysis, entity / term extraction; and constructing a keyword set using the extracted keywords.

[0100] Extracting keywords from the first and second clauses is an important step in achieving accurate semantic comparison in the policy consistency early warning system. Specifically, keywords can be extracted from the clauses in the first and second documents using a variety of specified extraction methods.

[0101] For example, the TF-IDF algorithm can be used to filter out high-frequency and distinctive words that reflect the core themes and key content of policy texts. The Legal-BERT model's attention weight analysis technology can also be used to capture words or phrases with high semantic weight within clauses. These words are often key points that influence semantic understanding, such as "AAA" and "BBB." Furthermore, entity and term extraction methods from the government sector can be combined to identify specialized terminology and named entities in specific fields, such as "DDD" and "CCC," from policy texts.

[0102] These extraction methods complement each other, ensuring the comprehensiveness and accuracy of the keyword set. After extracting keywords, the system further integrates them into a standardized keyword set and constructs the final keyword set through processing steps such as deduplication and normalization. For example, "AAA completes BBB by 2025" might generate the keyword set {"AAA", "BBB", "2025"}, while "CCC can continue DDD" might generate the keyword set {"CCC", "DDD"}.

[0103] Based on the above-mentioned public solutions, these keyword sets not only provide basic data for subsequent point mutual information (PMI) calculations, but also help the system more accurately quantify the semantic relevance between policy clauses, thereby significantly improving the accuracy and efficiency of conflict detection.

[0104] In one or more embodiments of the present disclosure, when the correlation is greater than the correlation threshold, the clause analysis result is calculated, specifically including: determining the time difference, effectiveness level and correlation of the effective time; and using the time difference, effectiveness level and correlation to calculate the clause analysis result.

[0105] When the correlation is greater than the preset correlation threshold, the system will further calculate the policy document analysis results to quantify the potential conflicts or synergies between policy clauses.

[0106] Specifically, we first determine the time difference between the effective dates of two clauses, their respective effectiveness levels, and the degree of correlation calculated through cosine similarity and point-wise mutual information. These key dimensions together constitute the core input data for conflict analysis. For example, the time difference reflects the time sensitivity of the conflict; recently released policy clauses generally have a higher timeliness weight; the effectiveness level reflects the authority and priority of the policy; higher-level policies may have a constraining or overriding effect on lower-level policies; and the degree of correlation measures the semantic similarity or degree of contradiction between the clauses.

[0107] Next, the policy document analysis results are calculated using a comprehensive scoring formula based on these dimensions. This formula typically includes weighting coefficients (γ1, γ2, and γ3) to dynamically adjust the proportion of each dimension's impact on the final outcome. For example, the conflict timeliness score (T) is calculated based on a time-decay function, with conflicts closer to the current time having a greater impact. The effectiveness hierarchy score is weighted based on differences in policy hierarchies to ensure that conflicts with high-priority policies are prioritized. The relevance score further incorporates the contextual path of the clause to determine whether there are logical contradictions or conflicts of purpose.

[0108] Based on the above public plan, it can be seen that the final generated clause analysis results can not only clearly reflect the severity of the conflict, but also provide a scientific basis for subsequent risk assessment and visual early warning, helping decision makers quickly identify problems and take optimization measures.

[0109] In one or more embodiments of the present disclosure, it also includes: building an adaptive update model; using the cross entropy loss corresponding to the newly acquired policy file, the KL divergence of the historical policy file, the model parameters, and the penalty coefficient of the KL divergence , calculate the model weight vector after integrating new and old policy knowledge.

[0110] Building an adaptive update model is the core link to achieve dynamic learning and knowledge fusion in the policy consistency early warning system. Its goal is to ensure that the system can quickly adapt to the release of new policies while avoiding forgetting historical policy knowledge. Specifically, when a new policy document is released, the system first calculates the cross entropy loss corresponding to the new policy data ( L new ), which is used to measure the prediction error of the model on the new policy sample and reflect the model's adaptability to new knowledge; at the same time, the system calculates the KL divergence of historical policy documents ( D KL ), quantify the output distribution difference between the new and old models on historical data, and prevent the "catastrophic forgetting" of old policy knowledge due to overfitting the new policy. On this basis, combined with the current model parameters and the penalty coefficient of KL divergence And dynamic learning rate η , the model weight vector after integrating new and old policy knowledge is obtained by weighted formula calculation ( θ new For example, when a new policy with high effectiveness is released, the system will adjust the model parameters to adapt to the change based on the conflict detection results between the policy terms and the less effective policies. At the same time, the KL divergence term is used to constrain the model's understanding of existing policies, ensuring its stability and robustness in the long run.

[0111] Based on the above-mentioned public solution, it can be seen that this mechanism not only improves the system's response speed to policy changes, but also provides more accurate and reliable support for policy conflict detection, thereby significantly enhancing the system's dynamic adaptability and intelligence level.

[0112] For ease of understanding, the following will be described in conjunction with specific embodiments. Figure 3 A schematic diagram illustrating the clause analysis and visualization process of the present disclosure.

[0113] As shown in step 301, data collection is first performed and a clause tree is established. After receiving the policy document, data collection is performed on the policy document. This is because the policy documents issued by different departments and regions have different formats. Therefore, data collection needs to be performed for different data structure types.

[0114] Common data structure types include: (1) Structured data: policies and regulations in government transparency databases (formats such as XML and JSON). (2) Semi-structured data: implementation details (formats such as HTML tables and Excel). (3) Unstructured data: policy interpretation documents and meeting minutes (formats such as PDF and Word).

[0115] For example, let's say Policy A is the first file mentioned above, and Policy B is the second file mentioned above. The system will deduplicate, clean, and convert this data to ensure accuracy and consistency.

[0116] After completing data collection, the collected data needs to be subjected to deep semantic analysis. Deep semantic analysis is required because many policy clause conflicts are not direct conflicts (not literal conflicts of a certain word or phrase), but conflicts implicit in semantic details.

[0117] Parsing the clauses in a policy document can be understood as splitting the clauses into separate sentences. Parsing is done at both the sentence and paragraph levels to ensure parsing accuracy.

[0118] Combining the formal characteristics and semantic logical structure of policy documents at the language and format levels, long text clauses are reasonably divided into sentences or paragraphs with independent semantic units.

[0119] 1. Format structure (explicit structure) identification: Utilize the document structure parsing algorithm in natural language processing, combined with regular rules, title detectors, and syntactic chunkers, to identify the following structural clues.

[0120] Numbering rules: such as "Article 1", "1.1", "I", "(I)", "①" and other clause numbers.

[0121] Paragraph markers: typical formatting symbols such as line breaks, multiple spaces, and indents.

[0122] Structural guide words: such as "provided as follows", "applicable to", "excluding", "proviso clause", etc.

[0123] Title blocks: such as "scope of application", "penalty clauses", "incentive mechanism", etc., are used as logical breakpoints.

[0124] The system will prioritize breaking down text into hierarchical paragraph units based on the numbering structure (such as "1.2," "1.3.1," etc.). For texts where the numbers cannot be identified, semantic segmentation will be performed based on punctuation marks such as periods and semicolons combined with a language model.

[0125] 2. Semantic structure (implicit logic) identification: Based on format parsing, the fine-tuned Legal-BERT model is used to perform syntactic dependency analysis and semantic role labeling to determine whether the following semantic relationships exist between clauses.

[0126] Main-subordinate clause relationship: semantic dependence between the main clause and supplementary explanations and conditional restrictions.

[0127] Cause and effect and transition: for example, “if…, then…”, “but if… then there is an exception”, etc.

[0128] Parallel / contrast: Parallel logic such as "the company must meet condition A or condition B".

[0129] These semantic clues are used to further refine the sentence-level segmentation, ensuring that the Legal-BERT model can reasonably decompose a complex sentence into multiple "clause statements" with independent meanings.

[0130] 3. Segmentation processing method: If the policy clauses are structured in a standardized manner (such as the XML / JSON format of regulatory documents), they are directly located using structural tags such as <clause> <subclause>; if they are plain text or PDF converted text, segmentation is achieved through the structure recognition module (combining rule templates and language model output).

[0131] For example, a policy paragraph will be broken down into three semantic units by the system. Each semantic unit will be converted into a vector input for subsequent clause tree construction and semantic comparison.

[0132] After parsing the clauses as described above, we can further construct a clause tree. Based on the policy text structure, a tree structure with "policy-clause-subclause" as the hierarchy is generated, along with information such as the effective date and effectiveness level.

[0133] It should be noted that the policy document is converted into a clause tree to facilitate subsequent clause analysis. This is because the clause tree is not only a formal representation of the text structure but also a key data structure for policy semantic comparison, conflict identification, and contextual alignment.

[0134] The clause tree can assist in conflict identification from multiple dimensions. It reflects the logical dependencies between parent and child clauses, ensuring that the comparison process doesn't simply compare clauses in isolation. Instead, it considers the restrictions or scope of application of clauses above and below them, thus avoiding semantic misjudgments. For example, two subclauses may appear contradictory, but if their parent clauses specify different applicable objects, they don't actually constitute a conflict.

[0135] The clause tree also defines the comparison scope and path mapping relationship. It provides a path positioning mechanism for the comparison algorithm: comparisons occur not only between leaf nodes, but also along the "policy-clause-subclause" path for structured alignment, making the comparison more targeted and improving computational efficiency.

[0136] The structural hierarchy of the clause tree supports similarity analysis. Structural paths within the clause tree serve as factors in weighted semantic similarity calculations. The closer the clauses are in the structural path, the higher the probability of semantic conflict is weighted.

[0137] In addition, in the knowledge graph visualization, the nodes of the clause tree are directly mapped to nodes in the graph, and each node corresponds to a clause text; the conflict detection model writes back the high-risk comparison results to the clause tree nodes, marks the colors (red, yellow, green) and outputs them as a structured risk report.

[0138] After parsing the clauses, the clauses need to be further semantically vectorized: each clause is input into Legal-BERT and converted into a 768-dimensional vector representation. The clause-level comprehensive semantic vector is calculated through the attention mechanism. .

[0139]

[0140] in is the i-th clause, Represents a 768-dimensional vector. For example, policy A's vector is (0.32, -0.45, 0.87, ..., a total of 768 values); policy B's vector is (0.28, -0.40, 0.83, ..., a total of 768 values). Traditional methods only check whether "BBB" and "DDD" appear together, potentially missing other implicit conflicts. The disclosed solution can truly understand the meaning of policy clauses and determine whether these clauses contradict each other in terms of their objectives.

[0141] As shown in step 302, the clauses are subjected to conflict detection. After the vectorization of the clause statements is completed, the correlation between the clause statements in the two clause trees can be further evaluated. When calculating the correlation, cosine similarity and point mutual information are used to quantify the semantic correlation between different clauses. . The calculation formula is as follows.

[0142]

[0143] in, 、 is the semantic vector of terms i and j, cosine similarity Reflects the semantic association of terms, 、 It is a set of clause keywords. α、β is the weight coefficient, and the point mutual information quantifies the co-occurrence probability of terms .

[0144] It should be noted that clause i and clause j refer to node pairs in the clause trees of two different policies, including but not limited to the following types: main clause i to main clause j, main clause i to subclause j, subclause i to subclause j, and subclause i to main clause j.

[0145] The cosine similarity mentioned here can be understood as measuring the overall similarity of semantic vectors; point mutual information: measures the co-occurrence probability of a keyword set.

[0146] Because some policy documents contain extensive content, the resulting clause tree contains numerous nodes. Analyzing every node in the clause tree would require significant computing power and be time-consuming. Therefore, a partial calculation can be employed. Three methods are available.

[0147] The first is structural path matching selection: only pairs of terms with similar structural paths are compared.

[0148] The second is keyword semantic cluster screening: after clustering the terms through keyword clustering (or topic models such as LDA), only the terms in the same cluster are compared.

[0149] The third method is coarse screening of semantic vectors: first use fast dimensionality reduction (such as PCA or quantitative indexing) to roughly screen out the top K potentially relevant terms in the low-dimensional space, and then perform high-precision comparison.

[0150] After calculating the correlation between clauses in the above way, we can further perform conflict detection. We can detect whether there are conflicts between policies at different levels and from different sources, and measure the severity of the conflicts. In other words, after calculating the semantic correlation (i.e., cosine similarity + point mutual information in the previous step), the system will obtain the correlation of each clause pair. Only when Only when the correlation exceeds the first threshold (e.g., 0.65) does the system enter the conflict scoring model (reinforcement learning + reward function) phase. This means that only when a conflict is predicted, will conflict analysis continue. Irrelevant clause pairs (i.e., those with a correlation less than the first threshold) are skipped, eliminating the risk of conflict.

[0151] In the disclosed solution, a reinforcement learning system is constructed to comprehensively evaluate the conflicts between clauses. The reinforcement learning system uses the conflict state as input to construct a complete policy network structure, including action selection function, reward function design and policy optimization mechanism.

[0152] Among them, the conflict state is used to represent the severity of the conflict between two clauses. Here, a reinforcement learning system is established by combining the policy effectiveness level and the release time factors. In the reinforcement learning system, the state space S t It is used to describe the policy conflict situation at the current time t, and the state space is defined as follows:

[0153]

[0154] in, Level represents the policy effectiveness level (high effectiveness = 3, medium effectiveness = 2, low effectiveness = 1), which is used to measure the scope of the conflict. Δt Represents the time difference of policy release, that is, the time interval between the release of the new and old policies. Represents the correlation between clauses and calculates the possibility of conflict. The range is 0-1, and the closer to 1, the greater the possibility of conflict.

[0155] This state space provides input for conflict detection, and the conflict states are input into the reinforcement learning system to calculate the severity of the conflict in each state.

[0156] In order to obtain a more comprehensive conflict assessment result, in addition to calculating the conflict status, the timeliness of the conflict and the degree of socio-economic impact are also calculated.

[0157] Step 303: After completing the conflict detection, the conflict analysis results can be calculated. In the disclosed solution, a solution is proposed to dynamically evaluate the conflict risk using a reward function. On the basis of , a quantitative indicator is needed to measure the severity of the conflict and define the reward function of conflict detection , covering the following three dimensions.

[0158]

[0159] in, Trepresents the timeliness score of the conflict (range 0-1, the closer to the current time, the greater the impact of the conflict), T Value calculation based on the difference in publishing time of conflicting terms Δt , through an exponential decay function The conclusion is that it can effectively reflect the time sensitivity of conflicts and ensure that the conflict policies that have recently come into effect or been revised receive higher warning weights. Δt =|t now −t policy ∣: Indicates the interval between the current time and the effective time of the clause (the unit can be days or months). λ is the time decay coefficient. The larger the λ is, the faster the decay caused by time. T∈(0,1]: The closer it is to 1, the more recent the policy conflict is and the more worthy of attention it is.

[0160] S (that is, the state space S calculated above) t ) represents the severity of the clause conflict (which can be weighted by the policy effectiveness level). The calculation process will not be repeated here; please refer to the previous examples for details. L represents the predicted socioeconomic impact, and γ1, γ2, and γ3 are dynamic adjustment coefficients that control the impact of different factors on the final reward.

[0161] L uses an LSTM model to model trends in the socioeconomic impacts that may follow policy conflicts. The model integrates multiple sources of information, including policy semantics, historical conflict cases, corporate profiles, and macroeconomic data, to output a normalized score L∈[0,1], which measures the potential destructiveness of the conflict. L's core mechanism is an LSTM-based multi-factor time series prediction model. Using a long short-term memory (LSTM) network, it models the following multi-source data to predict trends in the socioeconomic impacts following conflict events. The final output is a normalized score L∈[0,1].

[0162] The input data dimensions of the LSTM model used to calculate L include: semantic vectors of clause content (obtained from Legal-BERT, encoding the conflict type and domain); feature vectors of historical conflict events; macroeconomic indicators; industry sensitivity weights; and company profiles. The LSTM model outputs the predicted degree of economic disruption caused by the conflict (e.g., GDP impact, number of affected companies, etc.), mapped to the [0, 1] range using a normalization function: .in is the prediction output of LSTM, and Normalize is the normalization function.

[0163] It should be noted that the above LSMT model is trained using historical data as training samples. The sources of historical data include: historical policy conflict case library (including subsequent economic impact indicators); statistical yearbook, public economic data; credit rating, enterprise announcement, industry analysis report and other auxiliary information.

[0164] The reward function quantifies the state space S of policy conflict t into a score value, which measures whether the currently detected conflict is serious, general or minor. This score value will affect the subsequent adaptive learning process, helping the system continuously optimize the conflict detection decision strategy.

[0165] In practical applications, the situation of policy update and release also needs to be considered. When a new policy is released, the present disclosure uses an adaptive learning rate to update the model: .

[0166] Among them, represents the KL divergence of historical policy data, which measures the difference between new and old policies, and prevents the model from forgetting old policies.

[0167] η represents the dynamic learning rate, which controls the model update amplitude, and is adaptively adjusted according to the policy change frequency. The more frequent the policy changes, the higher the learning rate, so as to ensure that the system can adapt to the new policy. The incremental learning mechanism allows the system to continuously optimize its policy conflict detection ability, ensuring that the system can quickly adapt after the release of a new policy, rather than relying on outdated detection rules. As a penalty coefficient of KL divergence, it is usually valued in the range of 0.01~0.1, the larger the incremental learning, the less forgetting of old policies.

[0168] Parameter update result θ new represents the model weight vector after integrating the knowledge of new and old policies, which is the current effective parameter of the conflict detection strategy network.

[0169] Cross-entropy loss L new Based on the classification prediction error of the model on the new policy sample, it measures the adaptability of the model to the new policy.

[0170] The initial model weight is θ old , which represents the parameters trained under the historical policy. The model will perform a "memory weight update" every time it receives new policy data. The final output θ new is the optimal weight that integrates the knowledge of new and old policies and can adapt to the current environment.

[0171] L new calculation method . Among them: CrossEntropyrepresents cross entropy; y pred : The conflict label (such as whether there is a conflict, the conflict level) predicted by the model based on the current new policy data; y true : Real conflict results for new policy data annotations (either from manual annotations or rule-guided labels).

[0172] KL divergence term D KL (L old ) It represents the output deviation between the new and old models on historical data, and is used to control "catastrophic forgetting" and ensure that the model retains the ability to remember existing policy knowledge when updating, thereby achieving a dynamic and adaptive stable learning process.

[0173] KL divergence calculation method .

[0174] P(x) is the historical model weight ( θ old ) output distribution on the old policy data; Q(x) The parameter update result of the current model ( θ new ) on the same old data. Its purpose is to measure the difference in output between the new and old models based on the old knowledge. A larger value indicates that the new model has “forgotten” more of the old knowledge.

[0175] KL divergence is added to the update formula as a "forgetting penalty term." If the new model's output deviates too much from the old data, a large penalty will be incurred, inhibiting the model's biased adjustment. The ultimate effect is to maintain the ability to remember the old policy while absorbing the new policy.

[0176] After completing the conflict assessment and obtaining the conflict analysis results, as described in step 304, the conflict analysis results can be visualized. That is, the conflict analysis results are represented by different colors in the clause tree. The conflict analysis results can be quantified first. The formula is as follows: .

[0177] in, Represents the weight of the mth assessment dimension; indicates the "relative importance" of each risk dimension in the final score; is a weight coefficient that controls the scoring structure and is used to reflect the contribution of different conflict attributes to the overall risk. It can be set based on experience.

[0178] Represents the standardized evaluation value of dimension m, which comes from the calculation result of the reward function. Each evaluation dimension has a corresponding conflict score. These scores need to be standardized (that is, normalized to 0-1) so that different evaluation dimensions can be weighted. These scores mainly come from the severity of the conflict (S), the policy timeliness score (T) and the predicted socioeconomic impact value (L). These values ​​will be multiplied by the weights A weighted calculation is performed to ultimately affect the risk index; μ is the time attenuation coefficient, and Δt is the time difference in policy release.

[0179] The time decay factor is used to measure the impact of policy conflicts over time. μ represents the time decay coefficient, which controls the speed at which time affects the risk index. A larger μ indicates a more pronounced time decay effect. Δt represents the time difference between policy releases; a larger time difference indicates a more pronounced time decay effect.

[0180] After calculating the risk index, you can further mark the clauses in the clause tree according to the risk level. Set red, yellow, and green alerts based on the risk index. A knowledge graph node coloring strategy based on threshold judgment is also implemented.

[0181]

[0182] If the conflict index between policy A (high-efficiency policy) and policy B (low-efficiency policy) is higher than 0.9, the system will trigger a red alert and recommend modifying policy B to comply with policy A.

[0183] It should be noted that when scoring the severity of a conflict, it is not to judge two sentences in isolation, but to combine the context path of the clause tree to determine whether the following conditions are met: whether they belong to the same subject path (such as "implementation mechanism" and "target task"); whether there is a contradiction in the instructions of the upper main clause (such as "must" and "allow"); whether there is an intersection between high-efficiency policies and low-efficiency policies.

[0184] In this public solution, by combining large models, reinforcement learning, knowledge graph (i.e., clause tree) construction, incremental learning and visual analysis, it breaks through the limitations of traditional policy consistency detection methods, improves the accuracy, dynamic adaptability and automation of policy comparison, and can effectively support policy formulation and implementation agencies to improve decision-making efficiency, reduce compliance risks, and at the same time enhance the transparency of policy implementation, providing more intelligent policy early warning and evaluation tools.

[0185] Based on any of the above embodiments, the present disclosure also provides a file analysis device. Figure 4 FIG. 1 is a schematic block diagram of the structure of a file analysis device according to an embodiment of the present disclosure. Figure 4As shown, the file analysis method device includes: an acquisition module 41, which is used to obtain policy documents belonging to different effectiveness levels or different administrative departments; wherein the policy documents include a first file and a second file.

[0186] The parsing module 42 is used to parse the policy file to obtain a clause tree, wherein the nodes in the clause tree include clause statements in the policy file, and the clause tree includes a first tree corresponding to the first file and a second tree corresponding to the second file.

[0187] The vectorization processing module 43 is used to perform vectorization processing on the clause statements in the clause tree to obtain a first semantic vector corresponding to the first file and a second semantic vector corresponding to the second file.

[0188] The calculation module 44 is configured to calculate a policy document analysis result using the first tree and the first semantic vector, the second tree and the second semantic vector.

[0189] Optionally, a visualization module 45 is further included, which is used to mark result identifiers indicating the degree of conflict in the nodes of the first tree with different colors according to the analysis results.

[0190] The parsing module 42 is used to parse the policy document and determine the format structure and / or semantic structure contained in the policy document; split the policy document based on the format structure and / or semantic structure to obtain the clause statements used as nodes in the clause tree; if the format structure or semantic structure is not found, the policy document is segmented to obtain the clause statements used as nodes in the clause tree; and the clause tree is constructed using the contextual relationship of the clause statements.

[0191] The parsing module 42 is used to obtain the clause sentences in the nodes of the clause tree; and vectorize the clause sentences to obtain sentence vectors with specified dimensions.

[0192] The parsing module 42 is used to determine the effective time and effectiveness level corresponding to each clause statement according to the release information of the policy document; and construct a clause tree using the clause statements carrying the effective time and effectiveness level as nodes.

[0193] The calculation module 44 is used to calculate the cosine similarity and point mutual information between the first semantic vector and the second semantic vector; use the cosine similarity and point mutual information to calculate the correlation between the first semantic vector and the second semantic vector; when the correlation is greater than the correlation threshold, the clause analysis result is calculated.

[0194] The calculation module 44 is used to analyze the structural path similarity between the first node corresponding to the first semantic vector in the first tree and the second node corresponding to the second semantic vector in the second tree; when the structural path similarity is greater than the first threshold, calculate the cosine similarity and point mutual information of the first clause statement in the first node and the second clause statement in the second node; and use the cosine similarity and point mutual information to calculate the correlation between the first semantic vector and the second semantic vector.

[0195] The calculation module 44 is used to extract the keyword set of the first clause statement and the second clause statement; calculate the point mutual information using the keyword set; and calculate the cosine similarity between the first semantic vector corresponding to the first clause statement and the second semantic vector corresponding to the second clause statement.

[0196] The calculation module 44 is used to obtain a first structural path for the first node in the first tree to represent the contextual relationship, and a second structural path for the second node in the second tree to represent the contextual relationship; and calculate the structural path similarity between the first structural path and the second structural path.

[0197] The calculation module 44 is used to extract keywords from the first file and the second file respectively using a specified extraction method; wherein the specified extraction method includes: TF-IDF, BERT attention weight analysis, entity / term extraction; and construct a keyword set using the extracted keywords.

[0198] The calculation module 44 is used to determine the time difference, effectiveness level and correlation of the effective time; and obtain the clause analysis result by using the time difference, effectiveness level and correlation.

[0199] Optionally, an update module 46 is also included for: building an adaptive update model; using the cross entropy loss corresponding to the newly acquired policy document, the KL divergence of the historical policy document, the model parameters, and the penalty coefficient of the KL divergence , calculate the model weight vector after integrating new and old policy knowledge.

[0200] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0201] The execution subject of the file analysis method in the specific embodiment of the present disclosure may be an electronic device such as a server (including a local server or a cloud server).

[0202] Therefore, based on any of the above embodiments, the present disclosure further provides an electronic device, which can execute the file analysis method of any of the above embodiments of the present disclosure.

[0203] Figure 5A structural schematic block diagram of an electronic device of one embodiment of the present disclosure.

[0204] The hardware structure of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnecting buses and bridges, depending on the specific application of the hardware and the overall design constraints. The bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripheral devices, voltage regulators, power management circuits, external antennas, and the like.

[0205] The bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one connection line is shown in the diagram, but it does not mean that there is only one bus or one type of bus.

[0206] The present disclosure also provides a readable storage medium having a computer program stored therein, the computer program being executed by a processor to implement the above-described method. The "readable storage medium" can be any device that can contain, store, communicate, propagate or transport programs for use by or in connection with an instruction execution system, apparatus or device. More specific examples of the readable storage medium include the following: an electrical connection having one or more wires (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM), and the like.

[0207] The present disclosure also provides a computer program product, and the method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, the processes or functions of the present disclosure are executed in whole or in part.

[0208] A computer program or instruction can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, the computer program or instruction can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The readable storage medium can be any accessible medium or a data storage device such as a server or data center that integrates one or more accessible media. The accessible medium can be a magnetic medium such as a floppy disk, hard disk, or magnetic tape; an optical medium such as a digital video disk; or a semiconductor medium such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or can include both volatile and non-volatile types of storage media.

[0209] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0210] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing method device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing method device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure One a process or multiple processes and / or boxes Figure One A device that provides the functions specified in a block or multiple blocks.

[0211] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure One a process or multiple processes and / or boxes Figure One The function specified in one or more boxes.

[0212] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure One Figure One

[0213] In the description of the specification, the description of the terms "one embodiment / way", "some embodiments / ways", "example", "specific example", or "some examples" and the like means that the specific features, structures, or characteristics described in connection with the embodiment / way or example are included in at least one embodiment / way or example of the present disclosure. In the specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / way or example. Also, the specific features, structures, or characteristics described can be combined in any appropriate manner in any one or more embodiments / ways or examples. In addition, the person skilled in the art can combine and combine the different embodiments / ways or examples described in the specification and the features of the different embodiments / ways or examples, without contradiction.

[0214] In addition, the terms "first", "second" are only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise explicitly specified.

[0215] The person skilled in the art should understand that the above-mentioned embodiments are only for clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. Based on the above disclosure, other changes or modifications can also be made by those skilled in the art, and these changes or modifications are still within the scope of the present disclosure.​​

Claims

1. A file analysis method, characterized in that: The method comprises: Obtaining policy documents belonging to different levels of effectiveness or different administrative departments, wherein the policy documents include a first document and a second document; The policy document is parsed to obtain a clause tree, wherein the nodes in the clause tree contain clause statements in the policy document, and the clause tree includes a first tree corresponding to the first document and a second tree corresponding to the second document; wherein, the policy document is parsed to obtain a clause tree, including: parsing the policy document to determine the format structure and / or semantic structure contained in the policy document; splitting the policy document based on the format structure and / or semantic structure to obtain clause statements used as nodes in the clause tree; if the format structure or the semantic structure is not found, segmenting the policy document to obtain clause statements used as nodes in the clause tree; and constructing the clause tree using the contextual relationship of the clause statements; performing vectorization processing on the clause statements in the clause tree to obtain a first semantic vector corresponding to the first file and a second semantic vector corresponding to the second file; A policy document analysis result is calculated using the first tree and the first semantic vector, the second tree and the second semantic vector.

2. The method according to claim 1, characterized in that Vectorizing the clause statements in the clause tree includes: Obtaining a clause statement in a node of the clause tree; Vectorizing the clause sentence to obtain a sentence vector with a specified dimension; Constructing the clause tree using the contextual relationship of the clause statements includes: Determine the effective time and effectiveness level corresponding to each clause statement based on the release information of the policy document; The clause tree is constructed by using clause statements carrying the effective time and the effectiveness level as nodes.

3. The method according to claim 1, characterized in that Calculating a clause analysis result using the first tree and the first semantic vector, the second tree and the second semantic vector, includes: Calculating cosine similarity and point mutual information between the first semantic vector and the second semantic vector; Calculating the correlation between the first semantic vector and the second semantic vector using the cosine similarity and the point mutual information; When the correlation is greater than the correlation threshold, the clause analysis result is calculated, specifically including: determining the time difference of the effective time, the effectiveness level and the correlation; and using the time difference, the effectiveness level and the correlation to calculate the clause analysis result.

4. The method according to claim 3, characterized in that Calculating the association between the first semantic vector and the second semantic vector using the cosine similarity and the point mutual information includes: analyzing a structural path similarity between a first node corresponding to the first semantic vector in the first tree and a second node corresponding to the second semantic vector in the second tree; When the structural path similarity is greater than a first threshold, calculating the cosine similarity and point mutual information between the first clause statement in the first node and the second clause statement in the second node; The association degree between the first semantic vector and the second semantic vector is calculated using the cosine similarity and the point mutual information.

5. The method according to claim 4, characterized in that Calculating the cosine similarity and point mutual information between the first clause statement in the first node and the second clause statement in the second node includes: Extracting a keyword set from the first clause and the second clause, specifically comprising: extracting keywords from the first file and the second file using a specified extraction method; wherein the specified extraction method includes TF-IDF, BERT attention weight analysis, and entity / term extraction; Using the extracted keywords to construct a keyword set; Calculating point mutual information using the keyword set; Calculating the cosine similarity between a first semantic vector corresponding to the first clause statement and a second semantic vector corresponding to the second clause statement; Analyzing the structural path similarity between a first node corresponding to the first semantic vector in the first tree and a second node corresponding to the second semantic vector in the second tree includes: Obtaining a first structural path of the first node in the first tree for representing a contextual relationship, and a second structural path of the second node in the second tree for representing a contextual relationship; Calculate the structural path similarity between the first structural path and the second structural path.

6. The method according to claim 1, characterized in that Also includes: Build an adaptive update model; Using the cross entropy loss corresponding to the newly acquired policy documents, the KL divergence of the historical policy documents, the model parameters, and the penalty coefficient λ1 of the KL divergence, we calculate the model weight vector after integrating the new and old policy knowledge. Also includes: According to the analysis result, result identifiers indicating the degree of conflict are marked in the nodes of the first tree with different colors.

7. An electronic device, characterized in that: include: a memory storing execution instructions; as well as A processor, wherein the processor executes the execution instructions stored in the memory, so that the processor executes the method according to any one of claims 1 to 6.

8. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and device for calculating similarity of text data

    CN102214232A

  • Structured policy knowledge graph construction method and system

    CN117520553A