Rich text multi-dimensional difference analysis and accurate revision method and system based on AI
By using AI models to perform structured analysis and multidimensional difference analysis of rich text data, combined with knowledge graphs, precise revision suggestions are generated. This solves the problem of vague revision suggestions in corporate system revisions and achieves efficient and accurate system optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-27
Smart Images

Figure CN121745115A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of artificial intelligence and data analysis, in particular to an AI-based rich text multi-dimensional difference analysis and accurate revision method and system. BACKGROUND
[0002] Rich text refers to text containing format information, which defines the appearance of the text, such as font size, color, thickness, italic, etc. Rich text usually uses HTML, RTF (Rich Text Format) or other markup languages to represent format information, so that it can present rich visual effects when displayed. For rich text data, it is often necessary to merge two versions of different data or revise one version of rich text data based on another version of rich text data. For example, in the current enterprise management and decision-making process, in order to respond to the continuous promulgation and revision of external laws and regulations, and the dynamic adjustment of the system of the superior unit, the enterprise usually needs to timely and systematically revise the internal system and business rules. Although some methods have tried to use natural language processing technology to perform rough comparison of system text and generate revision suggestions based on the summary, such methods still have obvious limitations: it is difficult to accurately focus on specific system clause level to carry out fine-grained difference analysis, and it also lacks deep understanding of the context of the superior system and the penetrating and systematic analysis ability of the related systems. Therefore, the revision suggestions generated by the prior art are often general, and cannot fully combine the internal logic and semantic association of the system, resulting in insufficient comprehensiveness and depth, which makes it difficult to support high-quality and efficient system optimization and compliance management practice. SUMMARY
[0003] The application provides an AI-based rich text multi-dimensional difference analysis and accurate revision method and system, aiming to solve the problem that the revision suggestions generated by the prior art are often general, and cannot fully combine the internal logic and semantic association of the system, resulting in insufficient comprehensiveness and depth, which makes it difficult to support high-quality and efficient system optimization and compliance management practice.
[0004] The first aspect of the application provides an AI-based rich text multi-dimensional difference analysis and accurate revision method, comprising: obtaining target rich text data, and using an AI model to perform structured analysis and information enhancement on the target rich text data to obtain preprocessed target rich text data; the target rich text data represents new text data; Based on the preprocessed target rich text data, a multi-dimensional difference analysis algorithm is used to analyze the text surface differences, semantic deep differences, and structural and relational differences between the target rich text data and the source rich text data to determine the difference information; the source rich text data refers to the text data to be revised. Construct a knowledge graph corresponding to the source rich text data, and perform revision impact analysis and penetration analysis on the difference information based on the knowledge graph to determine the analysis results; Based on the analysis results, rich text precise revision suggestions are generated, and a document with revision marks is generated according to the rich text precise revision suggestions, thus completing AI-based rich text multidimensional difference analysis and precise revision.
[0005] In one possible implementation, target rich text data is acquired, and an AI model is used to perform structured parsing and information enhancement on the target rich text data to obtain preprocessed target rich text data, including: Obtain the target rich text data; The target rich text data is subjected to format stripping and text extraction, document structure reconstruction, AI-based semantic block segmentation and vectorization, and AI-based key information annotation to obtain preprocessed target rich text data.
[0006] In one possible implementation, the target rich text data undergoes format stripping and text extraction, document structure reconstruction, AI-based semantic block segmentation and vectorization, and AI-based key information annotation to obtain preprocessed target rich text data, including: Remove all formatting information other than plain text from the target rich text data to obtain the target rich text data after format stripping and text extraction; Identify the hierarchical structure of the target rich text data after format stripping and text extraction, and construct it as a document structure tree; After format stripping and text extraction, the target rich text data is divided into continuous semantic blocks, and a deep learning model is used to convert the semantic blocks into semantic vectors. The Big Language Model is used to extract entities corresponding to the target rich text data from semantic vectors; The document structure tree, semantic vectors, and entities are used together as the target rich text data after preprocessing.
[0007] In one possible implementation, based on the preprocessed target rich text data, a multi-dimensional difference analysis algorithm is used to analyze the text surface differences, deep semantic differences, and structural and relational differences between the target rich text data and the source rich text data, to determine the difference information, including: Text surface difference analysis is performed on the semantic blocks corresponding to the target rich text data and the source rich text data to obtain the text difference analysis results; any semantic block in the source rich text data has a corresponding semantic block in the target rich text data. A deep semantic difference analysis is performed on the semantic vectors corresponding to the semantic blocks between the target rich text data and the source rich text data to obtain the semantic difference analysis results. The structural and relational differences between the document structure tree of the target rich text data and the source rich text data are analyzed to identify new data and obtain the results of structural and relational difference analysis. The results of textual difference analysis, semantic difference analysis, and structural correlation difference analysis are used together as difference information.
[0008] In one possible implementation, a difference algorithm is used to perform text surface difference analysis to obtain text difference analysis results; a cosine similarity algorithm is used to perform semantic deep difference analysis to obtain semantic difference analysis results.
[0009] In one possible implementation, a knowledge graph corresponding to the source rich text data is constructed, and the impact analysis and penetration analysis of the difference information are performed based on the knowledge graph to determine the analysis results, including: Based on the entities corresponding to the target rich text data, a knowledge graph corresponding to the source rich text data is constructed; Based on the aforementioned difference information, query the knowledge graph for changed data and directly or indirectly related data; Based on directly or indirectly related data, the impact of changes on the data corresponding to the differences is scored to obtain the impact score. The semantic vector corresponding to the changed data is semantically compared with other data in the knowledge graph that conflict with the relationship edge to determine the conflict detection result. The change impact score and the conflict detection results are used together as the analysis results.
[0010] In one possible implementation, based on the analysis results, rich text precision revision suggestions are generated, including: Based on the difference information, the impact score of the change, and the conflict detection results, a preset template is invoked to generate rich text precise revision suggestions.
[0011] In one possible implementation, the revised content is highlighted in the rich text precise revision suggestion.
[0012] In one possible implementation, generating a document with revision marks based on rich text precision revision suggestions includes: revising the content of the rich text precision revision suggestions into the source rich text data and attaching the modification marks.
[0013] The second aspect of this application provides an AI-based rich text multidimensional difference analysis and precise revision system, including: The preprocessing module is used to acquire target rich text data and use an AI model to perform structured parsing and information enhancement on the target rich text data to obtain preprocessed target rich text data; the target rich text data represents new text data. The difference analysis module is used to analyze the text surface differences, semantic deep differences, and structural and relational differences between the target rich text data and the source rich text data based on the preprocessed target rich text data, using a multi-dimensional difference analysis algorithm to determine the difference information; the source rich text data refers to the text data to be revised. The impact analysis module is used to construct a knowledge graph corresponding to the source rich text data, and to perform revision impact analysis and penetration analysis on the difference information based on the knowledge graph to determine the analysis results; The revision suggestion module is used to generate rich text precise revision suggestions based on the analysis results, and to generate a document with revision marks based on the rich text precise revision suggestions, thus completing AI-based rich text multidimensional difference analysis and precise revision.
[0014] Beneficial effects: This application provides an AI-based method and system for multi-dimensional difference analysis and precise revision of rich text. First, it parses the rich text file, reconstructs the document structure, and vectorizes semantic blocks and annotates key information to achieve text structuring and semantic enhancement. Second, it conducts parallel difference analysis across three dimensions: surface level, deep semantic level, and structural relationships. Then, based on differential analysis, it assesses the revision impact using a system knowledge graph. Through penetrating analysis, it traces related clauses, calculates impact scores, and warns of potential conflicts, automatically generating precise revision suggestions. It provides a visual preview of the differences and one-click generation of a draft revision, achieving a closed loop from problem discovery to problem resolution, greatly improving the efficiency and accuracy of system revision. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1This is a flowchart illustrating an AI-based rich text multidimensional difference analysis and precise revision method proposed in one embodiment of this application. Figure 2 This is a schematic diagram of the structure of an AI-based rich text multidimensional difference analysis and precise revision system proposed in one embodiment of this application.
[0017] Figure labeling: 201-Preprocessing module, 202-Difference analysis module, 203-Impact analysis module, 204-Revision suggestion module. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] like Figure 1 As shown in the embodiments of this application, a method for rich text multidimensional difference analysis and precise revision based on AI is provided, including: S101. Obtain target rich text data, and use an AI model to perform structured parsing and information enhancement on the target rich text data to obtain preprocessed target rich text data; the target rich text data represents new text data. S102. Based on the preprocessed target rich text data, a multi-dimensional difference analysis algorithm is used to analyze the text surface differences, semantic deep differences, and structural and relational differences between the target rich text data and the source rich text data to determine the difference information; the source rich text data refers to the text data to be revised. S103. Construct a knowledge graph corresponding to the source rich text data, and perform revision impact analysis and penetration analysis on the difference information based on the knowledge graph to determine the analysis results; S104. Based on the analysis results, generate rich text precise revision suggestions, and generate a document with revision marks according to the rich text precise revision suggestions, thus completing AI-based rich text multidimensional difference analysis and precise revision.
[0020] In one possible implementation, target rich text data is acquired, and an AI model is used to perform structured parsing and information enhancement on the target rich text data to obtain preprocessed target rich text data, including: Obtain the target rich text data; The target rich text data is subjected to format stripping and text extraction, document structure reconstruction, AI-based semantic block segmentation and vectorization, and AI-based key information annotation to obtain preprocessed target rich text data.
[0021] In one possible implementation, the target rich text data undergoes format stripping and text extraction, document structure reconstruction, AI-based semantic block segmentation and vectorization, and AI-based key information annotation to obtain preprocessed target rich text data, including: Remove all formatting information other than plain text from the target rich text data to obtain the target rich text data after format stripping and text extraction; Identify the hierarchical structure of the target rich text data after format stripping and text extraction, and construct it as a document structure tree; After format stripping and text extraction, the target rich text data is divided into continuous semantic blocks, and a deep learning model is used to convert the semantic blocks into semantic vectors. The Big Language Model is used to extract entities corresponding to the target rich text data from semantic vectors; The document structure tree, semantic vectors, and entities are used together as the target rich text data after preprocessing.
[0022] For example, (1) format stripping and text extraction; Use parsing libraries (such as Apache POI for .docx, PDFBox for PDF) to parse the input rich text documents (such as Word and PDF formats) and remove formatting information (such as fonts, colors, tables, and directory structures) from the plain text content.
[0023] It is worth noting that the target rich text data can be rich text policy documents, while the source rich text data can be corporate policy documents.
[0024] (2) Document structure restructuring; Based on heading style, numbering sequence (such as "Chapter 1", "1.1", "(I)"), indentation, and font size, the document's hierarchical structure is automatically identified and reconstructed, dividing the document into logical units such as "section-article-section-article-item-item". A document structure tree is then constructed.
[0025] (3) Semantic block partitioning and vectorization; Using "section" or "clause" as the basic semantic unit, the plain text is segmented into continuous semantic blocks. Then, a deep learning model (such as BERT, ERNIE, etc.) is used to convert each semantic block into a high-dimensional semantic vector.
[0026] (4) Key information annotation; Named entity recognition technology, such as large language models, is used to extract and label entities such as "responsible department", "effective date", "scope of application" and "key verbs" (such as "should", "must not", "encourage") from text.
[0027] Transforming unstructured rich text into structured data with clear hierarchical relationships lays the foundation for subsequent fine-grained comparisons at the clause level, overcoming the limitations of traditional whole-document comparisons. Semantic vectorization converts textual meaning into computer-measurable numerical values, supporting deep semantic similarity calculations, rather than just keyword matching. The labeled key information provides data support for subsequent assessment of the impact of revisions.
[0028] In one possible implementation, based on the preprocessed target rich text data, a multi-dimensional difference analysis algorithm is used to analyze the text surface differences, deep semantic differences, and structural and relational differences between the target rich text data and the source rich text data, to determine the difference information, including: Text surface difference analysis is performed on the semantic blocks corresponding to the target rich text data and the source rich text data to obtain the text difference analysis results; any semantic block in the source rich text data has a corresponding semantic block in the target rich text data. A deep semantic difference analysis is performed on the semantic vectors corresponding to the semantic blocks between the target rich text data and the source rich text data to obtain the semantic difference analysis results. The structural and relational differences between the document structure tree of the target rich text data and the source rich text data are analyzed to identify new data and obtain the results of structural and relational difference analysis. The results of textual difference analysis, semantic difference analysis, and structural correlation difference analysis are used together as difference information.
[0029] In one possible implementation, a difference algorithm is used to perform text surface difference analysis to obtain text difference analysis results; a cosine similarity algorithm is used to perform semantic deep difference analysis to obtain semantic difference analysis results.
[0030] For example, (1) text surface difference analysis; Based on improved differential algorithms (such as the Myers differential algorithm based on word granularity), the text content of corresponding semantic blocks A and B is accurately compared to identify added, deleted, or modified words or sentences.
[0031] Function: Provides the most intuitive, character-level change record.
[0032] (2) Semantic deep difference analysis; Calculate the cosine similarity of semantic vectors between corresponding semantic blocks or matched by the algorithm in A and B.
[0033] A dynamic threshold is set, and when the similarity falls below the threshold, it is determined that there is a "semantic change". At the same time, attention mechanism visualization technology, such as AttentionViz, is used to locate the keywords that cause the semantic difference.
[0034] Function: It identifies situations where the textual expressions are different but the meanings are similar (such as "should" and "must"), or where the text has not been significantly modified but the semantics have changed significantly, thus solving the problem of lack of contextual understanding.
[0035] (3) Structural and relational difference analysis; By comparing the document structure trees of A and B, we can identify the addition, deletion, shifting, or hierarchical changes of clauses.
[0036] Function: To grasp the adjustment of the overall institutional framework from a macro perspective, which is a dimension that traditional comparisons completely ignore.
[0037] Its role: Through multi-dimensional parallel analysis, it integrates surface, deep, and structural information to form a three-dimensional view of differences, ensuring the comprehensiveness and depth of difference discovery.
[0038] In one possible implementation, a knowledge graph corresponding to the source rich text data is constructed, and the impact analysis and penetration analysis of the difference information are performed based on the knowledge graph to determine the analysis results, including: Based on the entities corresponding to the target rich text data, a knowledge graph corresponding to the source rich text data is constructed; Based on the aforementioned difference information, query the knowledge graph for changed data and directly or indirectly related data; Based on directly or indirectly related data, the impact of changes on the data corresponding to the differences is scored to obtain the impact score. The semantic vector corresponding to the changed data is semantically compared with other data in the knowledge graph that conflict with the relationship edge to determine the conflict detection result. The change impact score and the conflict detection results are used together as the analysis results.
[0039] For example, (1) constructing an institutional knowledge graph; Build a knowledge graph of enterprise systems in advance or in real time. The nodes are systems, chapters and clauses, and the edge relationships include "reference", "referenced", "supplement", "conflict" and "belonging to the same topic".
[0040] (2) Impact assessment; For each difference identified in step two, the system performs the following operations: (3) Internal penetration; The system searches for and locates the changed clauses in the graph, and then automatically traces all directly or indirectly related downstream clauses and systems along the edges of "reference" and "referenced".
[0041] (4) Calculation of influence; Based on the type and strength of the related edges and the importance of the downstream clauses, the impact score of the change is calculated using the graph algorithm ItemRank (a variant of PageRank). The larger the scope of impact and the more critical the related clauses, the higher the score.
[0042] (5) Conflict detection; By comparing the modified semantics with other clauses in the graph that have a "conflicting" relationship, potential institutional conflicts can be identified and warned.
[0043] Its role: It enables systematic correlation analysis, placing an isolated point of change within the entire institutional network for examination, accurately answering the question "What other regulations will this change affect?", and fundamentally solving the problem of weak correlation analysis capabilities.
[0044] In one possible implementation, based on the analysis results, rich text precision revision suggestions are generated, including: Based on the difference information, the impact score of the change, and the conflict detection results, a preset template is invoked to generate rich text precise revision suggestions.
[0045] In one possible implementation, the revised content is highlighted in the rich text precise revision suggestion.
[0046] In one possible implementation, generating a document with revision marks based on rich text precision revision suggestions includes: revising the content of the rich text precision revision suggestions into the source rich text data and attaching the modification marks.
[0047] For example, (1) Suggestion template and rule engine: Based on the difference type (surface / semantics / structure) and the level of impact, invoke the preset revision suggestion template and rule.
[0048] For example: "It is recommended that '...' be changed to '...' in Article Y of the XX System, since Article N of the superior law ZZZ has been updated. This change will also affect Article M of the AAA System, and it is recommended that it be reviewed concurrently." (2) Rich Text Revision Preview In the user interface, differences are highlighted in rich text (e.g., red strikethrough indicates deletion, and green underline indicates addition), and users can click on the highlighted areas to view detailed difference analysis reports and impact chains.
[0049] (3) Generate revised draft with one click The system can integrate all revision suggestions and automatically generate a draft Word document with revision marks for users to review and use directly.
[0050] Its role is to transform the analysis results into specific, actionable, and evidence-based action guidelines, thus achieving a closed loop from "identifying problems" to "solving problems," and ultimately outputting accurate and actionable revision suggestions.
[0051] In the semantic vectorization stage: In addition to BERT-like models, sentence vector models specifically optimized by Sentence-BERT can also be used, or language models further pre-trained on legal and regulatory texts in specific domains can be used to improve the professionalism of semantic representation.
[0052] In the difference analysis stage: For semantic similarity calculation, in addition to cosine similarity, word-shift distance-based methods or Siamese neural networks can also be used to learn the similarity between two text segments.
[0053] In the knowledge graph construction stage: In addition to using predefined rules (such as the sentence structure "in accordance with Article X of this regulation..."), relation extraction can adopt joint learning or remote supervision methods to automatically extract the relationships between entities from a large number of institutional texts, so as to reduce the burden of manually constructing the graph.
[0054] Compared with existing natural language processing technologies used in institutional comparison, this method has the following significant advantages: (1) It has achieved a leap from “document-level coarse comparison” to “clause-level fine-grained analysis”, which has significantly improved the accuracy and practicality of the analysis; Existing technologies typically treat policy documents as a single text for similarity comparison, resulting in generalized results. This invention, through rich text structured parsing, accurately identifies and reconstructs the hierarchy and clause units of the policy, enabling difference analysis to pinpoint specific "articles," "clauses," and even individual words. This allows managers to directly revise specific clauses without having to locate them again within lengthy documents, significantly improving work efficiency and the directness of revision work.
[0055] (2) A multi-dimensional difference analysis model of "surface-semantics-structure" was constructed, which effectively overcame the bottleneck of missing semantic understanding; Existing technologies only focus on surface-level character differences in text. This invention innovatively introduces semantic vectorization and deep learning models, enabling it to uncover the deeper semantic changes behind textual alterations and effectively identify complex situations such as "rewriting the expression without semantic change" or "minor adjustments to keywords resulting in significant semantic shifts." Simultaneously, structural difference analysis can detect adjustments to the position and logical order of clauses. This multidimensional analysis ensures the comprehensiveness and depth of difference identification, leading to more scientific and reliable conclusions.
[0056] (3) A knowledge graph-based correlation and penetration analysis mechanism was introduced, realizing a fundamental shift from "isolated revision" to "systematic collaboration"; This is one of the core effects that distinguishes this invention from existing technologies. Existing technologies are completely unable to address the interconnected impacts between regulations. By constructing and querying a knowledge graph of regulations, this invention can automatically and accurately track the "ripple effect" caused by the revision of a single clause, revealing its potential impact on downstream related regulations and providing early warnings of regulatory conflicts. This makes regulation revision no longer a matter of "treating the symptoms but addressing the root cause," but rather ensures the consistency, synergy, and self-consistency of the entire regulatory system, fundamentally improving the systematization level of corporate compliance management.
[0057] (4) It generates accurate revision suggestions that are operable and based on evidence, which greatly reduces the cost of manual review and improves the quality of revision; Existing technologies typically provide summary suggestions, still requiring significant manual interpretation. This invention, by integrating multidimensional discrepancies and penetrating analysis results, can generate specific, actionable revision suggestions—"where, how, and why"—and can generate a draft revision with a single click. This directly liberates users from tedious information filtering and text drafting, transforming the human role from "executor" to "decision-maker and reviewer," significantly reducing labor and time costs while minimizing compliance risks caused by human oversight.
[0058] In summary, through systematic innovation in technical means, this invention successfully transforms the revision of regulations from an "art" that relies on personal experience and a large amount of manual labor into a quantifiable, traceable, and intelligent "scientific" process, providing enterprises with strong, efficient, and reliable technical support to cope with the increasingly complex regulatory environment.
[0059] To facilitate understanding by those skilled in the art, more detailed examples are used for attribution, as follows.
[0060] In the production, operation, and safety management of a large power generation enterprise, establishing and strictly implementing a set of rigorous, comprehensive, and up-to-date technical procedures, safety standards, and management systems is the lifeline for ensuring power grid stability and preventing major safety accidents. This enterprise typically faces an extremely complex and dynamically changing institutional environment: externally, it must continuously comply with the laws, regulations, industry standards, and power grid company dispatching procedures that are constantly updated and promulgated by regulatory agencies such as the National Energy Administration, the Ministry of Emergency Management, and the Ministry of Ecology and Environment; internally, to adapt to technological upgrades, equipment modifications, and management optimizations, the group headquarters and its subordinate power plants also need to periodically revise their internal safety work procedures, operating procedures, and maintenance management systems.
[0061] However, the current system of management, which relies on manual comparison and general document comparison software, has revealed serious shortcomings under high-standard and strict requirements: The trade-off between accuracy and safety is prominent: when manually comparing key documents such as the "Electric Power Safety Work Regulations," minor adjustments to the sequence of operations (such as changes in the wording of "power off" and "power test") are easily overlooked due to fatigue or negligence. However, such omissions may directly violate the mandatory requirements of safety regulations, creating huge safety hazards.
[0062] Lack of comprehensive analysis: When a higher-level unit revises a general technical supervision regulation, managers find it difficult to quickly and comprehensively determine which specific operating procedures, maintenance work instructions, or emergency plans within the plant will be affected. This isolated revision, addressing symptoms rather than the root cause, may lead to inconsistencies or even conflicts within the regulatory system, creating a "vacuum" and posing systemic risks to safe production.
[0063] Insufficient revision efficiency and emergency response: When faced with urgent security notices or regulatory orders, traditional methods are time-consuming and slow, making it impossible to complete comprehensive and accurate internal system adaptation revisions and reviews within the required timeframe, leaving enterprises at compliance risk for a period of time.
[0064] Therefore, when the methods and systems described in this invention are applied to this scenario, they can perform structured parsing of thousands of complex rich text procedural documents, achieving precise and multi-dimensional difference analysis at the core institutional clause level, and generating accurate, executable, and systematic revision suggestions. This provides large power generation enterprises with core technological support for transforming their institutional management model from "passive response, experience-driven" to "proactive early warning, data-driven," greatly improving the accuracy, comprehensiveness, and timeliness of institutional revisions, and laying a solid technical foundation for building inherently safe enterprises.
[0065] For the example above, the specific implementation can be as follows: 1. System hardware environment; The method described in this invention can be implemented in a general-purpose computing system, including but not limited to: a central processing unit (CPU), memory (RAM), storage devices (such as hard disks or SSDs), and input / output devices (such as monitors, keyboards, and mice). These hardware components form the physical basis for performing the physical steps described below.
[0066] 2. A detailed description of the computer program flow (in chronological order); The following describes each physical step in chronological order using natural language, combining rich text difference analysis and precise revision of the main flowchart.
[0067] Step S101: Receive and load the rich text file physical data; Physical process: The system receives physical files submitted by the user through its data input interfaces, including network interfaces and USB interfaces. These files are binary data streams stored on storage media, representing two policy documents to be compared, such as the old policy document File_A.doc and the new policy document File_B.doc.
[0068] Technical features: The program allocates a buffer in memory and loads the binary data streams of the two files into memory, ready for parsing. This step completes the physical conversion from "static files on storage media" to "dynamic data to be processed in memory".
[0069] Step S102: Rich text structured parsing and information enhancement; This step aims to transform the unstructured physical structure of a document into a logical structure that the program can understand.
[0070] S1021: Format stripping and text extraction; (1) Physical process; The program calls the Apache POI library to parse .docx format files and the PDFBox library to parse .pdf format files. Using these as "translators," it parses the binary structure of the files, identifies and separates the plain text character stream and format control characters (such as font, color, and paragraph marks).
[0071] Variables and their physical meaning; The output consists of two string objects: Text_A and Text_B, representing the plain text content of the two files, respectively.
[0072] S1022: Document structure restructuring; (1) Physical process; The program scans Text_A and Text_B, identifying heading numbers (such as "Chapter X", "1.1", "(a)") based on regular expression matching and layout feature analysis. Based on the identified heading levels, the program constructs a Document Object Model (DOM) tree in memory.
[0073] (2) Mathematical model / logical judgment; Node definition: Each node Node_i in the tree represents a structural unit, containing attributes: level (level, such as 1 for chapter, 2 for section), title (title text), and content (body text).
[0074] Parent-child relationship determination: By comparing the level values of adjacent headings, it determines whether a node is a child node or a sibling node of the current node.
[0075] Variables and physical meaning: Output two DOM trees: DOM_Tree_A and DOM_Tree_B. This completes the physical transformation from a "linear text flow" to a "non-linear tree structure," providing physical coordinates for item-level positioning.
[0076] S1023: Semantic block partitioning and vectorization; (1) Physical process; The program traverses the leaf nodes of the DOM tree (usually corresponding to "bars" or "sections"), treating the content field of each node as an independent semantic block. Then, the program loads a pre-trained deep learning model (such as BERT) into memory. The text of this semantic block is input into the model, which performs calculations using its millions of internal parameters, ultimately outputting a fixed-length array of floating-point numbers.
[0077] (2) Mathematical model; Let the semantic block text be S.
[0078] The vectorization process is as follows: Vec = BERT_Model.forward(S) Vec is a vector of dimension [1, N] (e.g., N=768), which is a physical quantity that represents the semantics of text S in a high-dimensional space.
[0079] Variables and physical meaning: Generate a corresponding semantic vector Vector_i for each semantic block. This vector is the physical basis for subsequent semantic difference calculations.
[0080] Step S103: Multidimensional difference analysis; This step executes three physical analysis processes in parallel.
[0081] S1031: Text surface difference analysis; (1) Physical process; The program runs a word-granular differential algorithm on the corresponding clause nodes in DOM_Tree_A and DOM_Tree_B that are matched by structural matching or semantic similarity matching.
[0082] (2) Mathematical model; The Myers difference algorithm is used, which uses dynamic programming to find the shortest edit path from the start to the end of the string (containing only "insert" and "delete" operations). The algorithm outputs a sequence of operations: Diff_List = [("insert", word, pos), ("delete", word, pos), ...].
[0083] (3) Variables and their physical meaning; The Diff_List accurately records the minimum character-level operations required to physically transform text A into text B.
[0084] S1032: Semantic Deep Difference Analysis; (1) Physical process; The program calculates the cosine similarity of the corresponding clause semantic vectors generated in S1023.
[0085] (2) Mathematical model; Let the vector of clause A be Vec_A and the vector of clause B be Vec_B.
[0086] The cosine similarity Sim = (Vec_A • Vec_B) / (||Vec_A|| * ||Vec_B||).
[0087] Where • represents the dot product and ||Vec|| represents the norm of the vector. This is a scalar physical quantity with a value range of [-1, 1], and the larger the value, the more similar the semantics.
[0088] (3) Logical judgment; The program sets a dynamic threshold Theta (e.g., 0.85). If Sim < Theta, then it is determined that there is a semantic change in the clause. This judgment is a physical switch that determines whether the subsequent process will mark the clause as a major change.
[0089] S1033: Structural and Associative Difference Analysis; (1) Physical process; The program performs a depth-first traversal of two DOM trees and compares their topological structures.
[0090] (2) Logical judgment; By comparing the parent-child relationships and the front-back order of nodes, the addition, deletion, and shifting of nodes are identified. For example, if there is a node in DOM_Tree_B that has no corresponding parent node and sibling node match in DOM_Tree_A, it is determined as an "added clause".
[0091] Step S104: Revised Impact Assessment and Penetration Analysis; (1) Physical process; The program accesses an external graph database (such as Neo4j), which stores an institutional knowledge graph with all historical institutions as nodes and institutional reference relationships as edges. For each difference point (set as Clause_X) identified in S103, the program sends a graph query language (such as Cypher) request to the graph database.
[0092] (2) Mathematical model and logic; Example of a query statement: MATCH (c:Clause {id: 'Clause_X'})-[r:REFERENCES_BY |AFFECTS*1..5]->(downstream:Clause) RETURN downstream, r This query means: find all downstream clauses that are directly or indirectly (up to 5 layers down) referenced or affected by Clause_X.
[0093] (3) Calculation of influence score; For each downstream term `downstream_j` retrieved, calculate its impact score `Impact_Score_j = f(r.type, r.strength, downstream_j.importance)`. Here, `r.type` is the relationship type (e.g., "strong reference" or "weak reference"), and `downstream_j.importance` is the importance weight of the downstream term itself (which can be calculated based on factors such as the number of times it is referenced). The function `f` can be a weighted summation formula. This score is a comprehensive physical quantity used to quantify the scope of the change's impact.
[0094] Step S105: Generate and visualize precise revision suggestions; (1) Physical process; The program takes the analysis results from all the preceding steps (Diff_List, Sim values, structural change types, Impact_Score, and impact chains) as input and populates them into a predefined report template. The program controls the graphics processing unit (GPU) and the monitor to highlight the difference text on the user interface with specific colors (red strikethrough, green underline). Simultaneously, the program calls a document generation library (such as Apache POI) to write the revision suggestions and difference markers into a new Word document.
[0095] (2) Technical effects; This step completes the final physical transformation from "internal computational data" to "visual information that humans can intuitively perceive" and "physical documents that can be used directly."
[0096] 3. General Specifications; The core of this invention lies in providing a universal intelligent solution for compliance and risk management in modern organizations. Its design aims to address the fundamental pain points faced by various organizations when dealing with dynamic changes in internal and external rules, including inefficient and inaccurate policy revisions and difficulties in systematic coordination.
[0097] Whether in the strictly regulated financial and healthcare sectors, the complex energy and manufacturing industries, or government agencies and large corporate groups pursuing standardized services, their internal management systems, standard operating procedures, and quality system documents constitute an interconnected and dynamically evolving "institutional organism." This invention, through its systematic technical architecture, empowers organizations to gain precise insights and intelligently operate this "organization."
[0098] Therefore, this invention is essentially a foundational tool that empowers organizations to achieve digital and intelligent transformation of their institutional management. It can be seamlessly embedded into the existing OA, legal compliance, or risk control management processes of various organizations, providing a powerful, reliable, and universal technical engine to cope with increasingly complex regulatory environments and improve the refinement and agility of internal governance.
[0099] like Figure 2 As shown, based on the same inventive concept, this application provides an AI-based rich text multidimensional difference analysis and precise revision system, including: The preprocessing module 201 is used to acquire target rich text data and use an AI model to perform structured parsing and information enhancement on the target rich text data to obtain preprocessed target rich text data; the target rich text data represents new text data. The difference analysis module 202 is used to analyze the text surface differences, semantic deep differences, and structural and relational differences between the target rich text data and the source rich text data based on the preprocessed target rich text data, using a multi-dimensional difference analysis algorithm to determine the difference information; the source rich text data refers to the text data to be revised. The impact analysis module 203 is used to construct a knowledge graph corresponding to the source rich text data, and to perform revision impact analysis and penetration analysis on the difference information based on the knowledge graph to determine the analysis results; The revision suggestion module 204 is used to generate rich text precise revision suggestions based on the analysis results, and to generate a document with revision marks based on the rich text precise revision suggestions, thereby completing AI-based rich text multidimensional difference analysis and precise revision.
[0100] The AI-based rich text multidimensional difference analysis and precise revision system provided in this application embodiment can be based on the above-described method and technical solution. Its principle and beneficial effects are similar, and will not be repeated here.
[0101] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0102] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0103] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0105] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0106] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0107] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An AI-based rich-text multi-dimensional diff analysis and precise revision method, characterized in that, The method comprises the following steps: acquiring target rich text data, and performing structured analysis and information enhancement on the target rich text data by using an AI model to obtain preprocessed target rich text data; the target rich text data represents new text data; based on the preprocessed target rich text data, a multi-dimensional difference analysis algorithm is used to analyze text surface differences, semantic deep differences and structure and association differences between the target rich text data and source rich text data, and difference information is determined; the source rich text data represents text data to be revised; a knowledge graph corresponding to the source rich text data is constructed, and based on the knowledge graph, revision influence degree analysis and penetration analysis are performed on the difference information to determine an analysis result; based on the analysis result, a rich text precise revision suggestion is generated, and a document with revision marks is generated according to the rich text precise revision suggestion, thereby completing AI-based rich text multi-dimensional difference analysis and precise revision.
2. The AI-based rich-text multi-dimensional delta analysis and precise revision method according to claim 1, characterized in that, acquiring target rich text data, and performing structured analysis and information enhancement on the target rich text data by using an AI model to obtain preprocessed target rich text data, comprising: acquiring target rich text data; performing format stripping and text extraction, document structure reconstruction, AI-based semantic block division and vectorization, and AI-based key information labeling on the target rich text data to obtain preprocessed target rich text data. 3.The AI-based rich-text multi-dimensional delta analysis and precise revision method according to claim 2, characterized in that, performing format stripping and text extraction, document structure reconstruction, AI-based semantic block division and vectorization, and AI-based key information labeling on the target rich text data to obtain preprocessed target rich text data, comprising: removing other format information except pure text in the target rich text data to obtain target rich text data after format stripping and text extraction; identifying the hierarchical structure of the target rich text data after format stripping and text extraction, and constructing a document structure tree; dividing the target rich text data after format stripping and text extraction into continuous semantic blocks, and converting the semantic blocks into semantic vectors by using a deep learning model; extracting entities corresponding to the target rich text data from the semantic vectors by using a large language model; the document structure tree, the semantic vectors and the entities together are the preprocessed target rich text data.
4. The AI-based rich-text multi-dimensional delta analysis and precise revision method according to claim 3, characterized in that, based on the preprocessed target rich text data, a multi-dimensional difference analysis algorithm is used to analyze text surface differences, semantic deep differences and structure and association differences between the target rich text data and source rich text data, and difference information is determined, comprising: performing text surface difference analysis on the semantic blocks corresponding to the target rich text data and the source rich text data to obtain a text difference analysis result; any semantic block in the source rich text data has a corresponding semantic block in the target rich text data; performing semantic deep difference analysis on the semantic vectors corresponding to the semantic blocks corresponding to the target rich text data and the source rich text data to obtain a semantic difference analysis result; performing structure and association difference analysis on the document structure trees between the target rich text data and the source rich text data to identify new data and obtain a structure and association difference analysis result; The text difference analysis result, the semantic difference analysis result and the structure correlation difference analysis result are collectively used as the difference information. 5.The AI-based rich-text multi-dimensional delta analysis and precise revision method according to claim 4, characterized in that, The text surface difference analysis is performed by using a difference algorithm to obtain the text difference analysis result; and the semantic deep difference analysis is performed by using a cosine similarity algorithm to obtain the semantic difference analysis result.
6. The AI-based rich-text multi-dimensional delta analysis and precise revision method according to claim 4, characterized in that, The knowledge graph corresponding to the source rich text data is constructed, and the difference information is analyzed based on the knowledge graph to determine an analysis result, including: The knowledge graph corresponding to the source rich text data is constructed based on the entities corresponding to the target rich text data; The changed data and the directly or indirectly associated data are queried in the knowledge graph based on the difference information; The changed data corresponding to the difference information is scored based on the directly or indirectly associated data to obtain a change impact score; The semantic vector of the changed data is compared with other data in the knowledge graph to determine a conflict detection result; The change impact score and the conflict detection result are collectively used as the analysis result.
7. The AI-based rich-text multi-dimensional diff analysis and precision revision method according to claim 6, characterized in that, Based on the analysis result, a rich text precise revision suggestion is generated, including: The difference information, the change impact score and the conflict detection result are used to call a preset template to generate the rich text precise revision suggestion.
8. The AI-based rich-text multi-dimensional diff analysis and precision revision method according to claim 7, characterized in that, The revision content in the rich text precise revision suggestion is highlighted. 9.The AI-based rich-text multi-dimensional delta analysis and precise revision method according to claim 7, characterized in that, Based on the rich text precise revision suggestion, a document with revision marks is generated, including revising the revision content of the rich text precise revision suggestion into the source rich text data and attaching revision marks.
10. An AI-based rich text multi-dimensional diff analysis and precision revision system, characterized in that, Including: A preprocessing module is configured to obtain target rich text data and perform structural analysis and information enhancement on the target rich text data by using an AI model to obtain preprocessed target rich text data; The target rich text data represents new text data; A difference analysis module is configured to perform multi-dimensional difference analysis on the text surface difference, the semantic deep difference and the structure and correlation difference between the target rich text data and source rich text data based on the preprocessed target rich text data, to determine difference information; the source rich text data represents text data to be revised; An impact analysis module is configured to construct a knowledge graph corresponding to the source rich text data, and analyze the revision impact and penetration of the difference information based on the knowledge graph to determine an analysis result; A revision suggestion module is configured to generate a rich text precise revision suggestion based on the analysis result, and generate a document with revision marks based on the rich text precise revision suggestion, to complete AI-based rich text multi-dimensional difference analysis and precise revision.
Citation Information
Cited By
Method for dynamic comparison and difference insight of text content of multi-modal document
CN122221835A
Method for dynamic comparison and difference insight of text content of multi-modal document
CN122221835B