A Document Progressive Semantic Governance Method for Large Models
By constructing a closed-loop mechanism of forward prediction of typesetting features and reverse verification of cross-references, and combining cross-document entity spatiotemporal graphs and pyramid information structures, the accuracy and consistency issues of converting unstructured documents into high-quality corpora are solved, thereby improving the information utilization efficiency of large models.
Patent Information
- Application Number
- CN202611341063.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies cannot effectively convert unstructured documents into high-quality corpora, and suffer from problems such as structural parsing errors, information loss, and difficulty in detecting contradictions, thus failing to meet the corpus requirements of large models.
By constructing a closed-loop mechanism of forward prediction of typesetting features and reverse verification of cross-references, and combining cross-document entity spatiotemporal graphs and pyramid information structures, we can achieve accuracy and consistency governance of document hierarchical structure and output standardized documents and structured corpora.
It improves the accuracy and consistency of converting unstructured documents into high-quality corpora, enhances information utilization and contradiction handling capabilities, and meets the query needs of large models.
Smart Images

Figure CN123115115A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and natural language processing, and in particular to a document progressive semantic governance method for large models. Background Technology
[0002] In recent years, Large Language Models (LLMs) based on the Transformer architecture have demonstrated outstanding capabilities in natural language understanding and generation, accelerating the intelligent transformation of various industries. In sectors with stringent data security and compliance requirements, such as finance, government, and energy, enterprises are actively embedding LLM capabilities into their core business processes through private deployments, aiming to achieve efficient knowledge reuse and intelligent decision-making.
[0003] However, enterprises have encountered a common bottleneck in the process of implementing this technology: more than 80% of their internal expert experience and knowledge assets are tied up in a large number of unstructured documents such as technical reports, meeting minutes, and tender documents. To effectively apply these documents to retrieval enhancement generation (RAG) systems or model fine-tuning, they must be converted into clearly structured, semantically consistent, and formatted corpora. This conversion process has become a key factor determining the efficiency of an enterprise's intelligent transformation.
[0004] To address this need, existing technologies have developed various processing approaches, but all of them have inherent flaws and cannot constitute a complete solution: Firstly, there are general document parsing tools based on typesetting features (such as Unstructured.io and LlamaParse). The core logic of these tools relies on static recognition and linear segmentation based on visual typesetting features (such as font, font size, and indentation). Their fundamental limitation lies in the unavoidable ambiguity between typesetting format and document semantic hierarchy. For example, bold text may represent a chapter title or simply be general emphasis. Existing tools lack a mechanism for reverse verification using internal semantic relationships within the document (such as chapter numbers, cross-references, and content continuity). This leads to structural parsing errors propagating along the processing chain and becoming difficult to correct once they occur. Furthermore, to adapt to the limited context window of an LLM (Local Document Module), these tools employ a fixed-length segmentation strategy, ignoring the document's inherent hierarchical logic and semantic boundaries. This results in the arbitrary cutting of contextual relationships, disrupting the complete organizational structure of information and further exacerbating information loss in subsequent retrieval and generation tasks.
[0005] Secondly, there are traditional data governance platforms designed for structured data (such as Informatica and Alibaba DataWorks). The technical architecture of these platforms is rooted in the ETL process of structured data. Their data models and processing logic do not inherently support semantic-level structure recognition and logical verification of unstructured documents, making them completely unable to meet the core challenges in this scenario.
[0006] Third, there is the workshop-style processing model that relies on manual labor. This model involves data processing personnel manually processing each document using typesetting tools and text editors. This is inefficient, costly, and the fatigue of manual operation and subjective judgment make it difficult to guarantee consistency and accuracy, failing to meet the needs of enterprises for large-scale, efficient, and standardized corpus construction.
[0007] In summary, existing technologies face three main core technical obstacles in the governance of high-quality unstructured document corpora for large models: Obstacle 1: Lack of a hierarchical "recognition-verification" closed-loop mechanism for semantic verification. Existing static typesetting recognition methods can only make unidirectional predictions based on visual features. They cannot use the semantic relationship network such as the numbering system and cross-references inherent in the document itself for reverse verification and dynamic correction. The recognition results lack reliability, and their inherent errors will continue to be propagated and amplified downstream along the processing link, resulting in an unstable hierarchical foundation for the structured corpus.
[0008] Obstacle 2: Lack of proactive logical adjudication capabilities for cross-document information conflicts. Existing technologies can only detect surface-level conflicts at the string or numerical level, but cannot deeply understand the underlying causes of conflicts (such as version iteration, typos, or conflicts of objective facts), let alone provide logically grounded automated adjudication suggestions. As a result, this preliminary step of conflict detection contributes very little to the actual value of final data governance.
[0009] Obstacle 3: A mismatch exists between the document information organization method and the cognitive characteristics of large models. Existing chunking strategies simply adapt to the context window while ignoring the document's inherent hierarchical structure and logical unit boundaries, resulting in the loss of structural information. This causes key knowledge in the middle of the document to be systematically ignored, significantly restricting the recall and utilization rate of key information in downstream tasks.
[0010] Therefore, how to provide a document-based progressive semantic governance method for large models to improve the accuracy, consistency, and usability of converting unstructured documents into high-quality corpora has become an urgent technical problem to be solved. Summary of the Invention
[0011] The technical problem to be solved by this invention is to provide a document progressive semantic governance method for large models, so as to improve the accuracy, consistency and usability of converting unstructured documents into high-quality corpora.
[0012] This invention provides a document-based progressive semantic governance method for large models, comprising the following steps: Step S1: Perform file compliance verification and format surface cleaning on the input unstructured document in sequence to obtain format-normalized document content; the file compliance verification includes detecting the true format through the file magic number, intercepting encrypted files and verifying file integrity; the format surface cleaning includes merging soft returns, extracting the content of free text boxes, unifying special characters and placeholder embedded images to complete the surface format normalization; Step S2: Extract multi-dimensional layout features from each paragraph in the document content, use a sequence labeling model to predict the hierarchical labels for each paragraph, output an initial hierarchical label sequence composed of each hierarchical label, and construct an initial document hierarchical tree; traverse the entire text to identify cross-reference information within the document, parse the target number and target level of the referenced object, compare the parsing result with the initial document hierarchical tree, if they match, the verification is passed and the confidence of the corresponding level determination is increased, if they do not match, a hierarchical correction signal is triggered, and the numbering system implicit in the cross-reference is used as a constraint to backtrack the corresponding area for local hierarchical re-inference; repeat the verification and correction process until the matching rate between the cross-references of the entire document and the current hierarchical tree reaches a preset threshold, and output the corrected final hierarchical tree; Step S3: Perform semantic content cleaning and entity annotation on the document content for which the final hierarchical tree has been established, and construct a cross-document entity spatiotemporal graph; based on the cross-document entity spatiotemporal graph, calculate the comprehensive credibility of each entity attribute value from the time dimension, source dimension and consistency dimension respectively, automatically distinguish the contradiction type according to the comprehensive credibility and output the adjudication result to obtain the document content after semantic consistency governance; Step S4: Reorganize the document content after semantic consistency governance into a three-level pyramid information structure containing a sparse layer, a medium-density layer, and a complete layer, with each level arranged from high to low information density; In response to the query request of the retrieval enhancement generation system, calculate the query complexity score, and dynamically select the content of the corresponding information density level to inject into the context window of the large language model based on the query complexity score. Step S5: Output the document content after semantic consistency governance as a standardized document, and output the final hierarchical tree and the entity annotation as a structured corpus.
[0013] Furthermore, in step S2, the multi-dimensional typesetting features include font size, bolding, centering, indentation, numbering mode, spacing from the preceding paragraph, paragraph length, and whether it starts with a serial number; the sequence labeling model is a conditional random field model or a sequence labeling model combining a bidirectional long short-term memory network and a conditional random field, and the sequence labeling model incorporates hierarchical transition probability constraints of the enterprise document numbering mode.
[0014] Furthermore, in step S2, the cross-reference information includes chapter references, section references, and figure references; wherein, the chapter reference is a reference containing the format "see Chapter X", the section reference is a reference containing the format "as described in Section XX above", and the figure reference is a reference containing the format "see Table X", where X is an arbitrary number placeholder.
[0015] Furthermore, in step S3, the cross-document entity spatiotemporal graph establishes a cross-document attribute-time-source record for each entity identified by named entity recognition. Each record includes attribute value, source document identifier, document last modification time, and document source information.
[0016] Furthermore, in step S3, the contradiction types include version update contradictions, data entry error contradictions, and real conflict contradictions; wherein, the version update contradiction is a contradiction type in which the entity attribute shows monotonous change in the time series, the data entry error contradiction is a contradiction type in which the attribute value in a single document deviates from the consistent value in most documents, and the real conflict contradiction is a contradiction type in which the attribute values in different documents are supported by each other and the source weights are equal, and the timelines are intertwined.
[0017] Furthermore, in step S3, the formula for calculating the overall credibility is: C(a)=α·w_time(a)+β·w_src(a)+θ·w_cons(a); Where C(a) is the overall credibility of attribute value a; w_time(a) is the time weight; w_src(a) is the source weight; w_cons(a) is the consistency weight; α, β, and θ are the corresponding weight coefficients, and α+β+θ=1.
[0018] Furthermore, the time weight is calculated based on the document's update time using an exponential decay function, with newer documents having higher weights; the source weight is determined according to the document type and the department from which the document originates, with officially released documents having higher weights than internal drafts, and documents from competent authorities having higher weights than documents from citing parties; the consistency weight is determined based on the frequency of the same attribute value appearing in multiple independent documents, with higher frequency resulting in higher consistency weights.
[0019] Furthermore, in step S4, in the three-level pyramid information structure, the sparse layer contains a global summary of the document and a list of key conclusions, accounting for 8% to 12% of the original text; the medium-density layer contains key points of each chapter, key data tables, and entity relationship diagrams, accounting for 25% to 35% of the original text; and the complete layer contains the original document content, accounting for 55% to 65% of the original text.
[0020] Furthermore, in step S4, when the document content after semantic consistency governance is reorganized into a three-level pyramid information structure containing a sparse layer, a medium-density layer, and a complete layer, if the document content must be segmented, the segmentation is performed based on the minimum semantic damage point determined by sentence boundary detection and semantic dependency parsing. Each segmented block automatically carries its parent title path and previous text summary information.
[0021] Furthermore, in step S5, the standardized document is a human-readable document, and the structured corpus is structured data in a machine-readable format; the human-readable format includes at least Word documents and PDF documents, and the machine-readable format includes at least JSON and XML formats.
[0022] The advantages of this invention are: 1. By constructing a progressive closed loop of "forward prediction of layout features - reverse verification of cross-references," the numbering system and citation relationships inherent in the document itself are used as semantic constraints for iterative correction, thereby ensuring the accuracy of hierarchical structure recognition. On this basis, a cross-document entity spatiotemporal graph covering attributes, time, and source is established, and the comprehensive credibility is calculated by integrating time decay weight, source authority weight, and consistency co-occurrence frequency. This enables intelligent adjudication of contradiction types such as version iteration, typos, and factual conflicts, thereby ensuring the consistency of cross-document semantics. Finally, the treated content is reorganized into a pyramid structure of sparse, medium-density, and complete layers, and the corresponding level is dynamically selected based on query complexity to inject into the large model context. At the same time, the minimum damage point segmentation and context carrying mechanism under semantic dependency parsing are used to solve the problem of structural information loss caused by fixed-length blocks, thereby comprehensively improving the accuracy, consistency, and usability of converting unstructured documents into high-quality corpora.
[0023] 2. A hierarchical structure parsing mechanism with dynamic verification and correction capabilities was established. Based on the initial hierarchical labels predicted by the sequence labeling model, the mechanism further utilizes the widely existing cross-reference information within the document (including chapter, section, and figure references) as strong semantic constraints to comprehensively compare and verify the prediction results. When a mismatch is found between the reference target and the hierarchical tree, a re-inference process for the local area is triggered. Through iterative closed-loop correction, the final hierarchical tree fully integrates layout features and semantic relationships, thereby ensuring the accuracy and reliability of document structure parsing and providing a solid structural foundation for all subsequent governance steps.
[0024] 3. It achieves multi-dimensional logical adjudication capabilities for cross-document entity conflicts. By constructing a cross-document entity spatiotemporal graph, it systematically records the source document, modification time, and source information of each entity attribute value, and calculates the comprehensive credibility from the time, source, and consistency dimensions respectively. Based on this, it can automatically classify conflicts into specific types such as version updates, data entry errors, or genuine conflicts, and output clear adjudication results according to quantified weights. This mechanism provides interpretable logical basis for conflict handling, significantly improving the depth and automation of semantic consistency governance.
[0025] 4. A three-tiered pyramid information structure adapted to the cognitive characteristics of large models was designed. The processed documents are reorganized into sparse, medium-density, and complete layers, arranged from high to low information density. Content from the appropriate layer is dynamically selected and injected into the large model's context window based on query complexity scores. This structure achieves precise matching between information density and query requirements while preserving the original semantic boundaries and hierarchical logic of the documents. It avoids context fragmentation caused by fixed-length blocks and ensures that queries of varying complexity obtain the optimal amount of information, thereby effectively improving the overall performance of the retrieval enhancement generation system.
[0026] 5. A progressive and refined end-to-end governance framework was constructed, balancing efficiency and standardization. Through five progressive steps—format cleaning, hierarchical verification, semantic disambiguation, structural reorganization, and standardized output—a clear and interconnected governance pipeline was formed. The local hierarchical re-inference mechanism avoids the waste of resources from global recalculation, while the minimum-damage segmentation strategy based on sentence boundaries and semantic dependencies ensures the semantic coherence of long document processing. Ultimately, both human-readable standardized documents and machine-readable structured corpora are output simultaneously, comprehensively meeting the needs of different downstream tasks and providing an efficient and standardized technical implementation path for large-scale corpus governance.
[0027] 6. Significantly Improved Hierarchical Recognition Accuracy: Through a semantic closed loop of prediction-verification-correction, the accuracy ceiling of pure typesetting features is broken, improving hierarchical recognition accuracy by 5-10 percentage points. Conflict Management Upgraded from Detection to Adjudication: A lightweight credibility model based on metadata enables automatic differentiation and handling of three types of conflicts without the need for large model inference, offering strong interpretability and low computational cost. Significantly Improved RAG Information Utilization Efficiency: Pyramid-style information density reorganization adapts to the attention characteristics of large models, increasing effective information volume by 2-3 times within the same context window and improving question-answering accuracy by 25%-30%. End-to-End Systematic Governance: Covering the entire process from file access to multi-format output, the governance process is traceable in terms of metadata, avoiding format loss and semantic deviation issues caused by combining multiple tools. Attached Figure Description
[0028] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0029] Figure 1 This is a flowchart of a document progressive semantic governance method for large models according to the present invention.
[0030] Figure 2 This is a flowchart of the document hierarchy tree construction and cross-reference correction process of this invention.
[0031] Figure 3 This is a flowchart of the contradiction type determination and adjudication process of the present invention. Detailed Implementation
[0032] The technical solution in this application embodiment follows the following general approach: Using unstructured documents as the processing object, an automated processing pipeline is constructed from the original document to high-quality corpus through five progressively advancing and interconnected governance stages: "format normalization → hierarchical structure progressive identification and verification → cross-document semantic consistency governance → pyramid information structure reorganization → standardized output." The core lies in no longer relying on static, one-way parsing of layout features, but establishing a closed-loop mechanism that coordinates forward prediction of layout features with reverse verification of cross-references. The numbering system and referencing relationships inherent in the document itself serve as strong semantic constraints, iteratively correcting the hierarchical structure to ensure the accuracy of structural parsing. Building upon this foundation, a cross-document entity spatiotemporal graph is further constructed, integrating quantitative weights from three dimensions: time decay, source authority, and consistent co-occurrence. This allows for type identification and credibility adjudication of entity attribute contradictions, thereby achieving cross-document consistency governance at the semantic level. Finally, the governed content is reorganized into a three-tiered pyramid structure consisting of sparse, medium-density, and complete layers. The appropriate layer is dynamically selected and injected into the large model based on query complexity. Coupled with intelligent segmentation and context-carrying mechanisms based on semantic boundaries, this fundamentally solves the context fragmentation problem caused by fixed-length blocks, thereby comprehensively improving the accuracy, consistency, and usability of converting unstructured documents into high-quality corpora for large models.
[0033] Please refer to Figures 1 to 3 As shown, a preferred embodiment of the document progressive semantic governance method for large models according to the present invention includes the following steps: Step S1: Perform file compliance verification and format surface cleaning on the input unstructured document in sequence to obtain format-normalized document content; the file compliance verification includes detecting the true format through the file magic number, intercepting encrypted files and verifying file integrity; the format surface cleaning includes merging soft returns, extracting the content of free text boxes, unifying special characters and placeholder embedded images to complete the surface format normalization; Step S2: Extract multi-dimensional layout features from each paragraph in the document content, use a sequence labeling model to predict the hierarchical labels for each paragraph, output an initial hierarchical label sequence composed of each hierarchical label, and construct an initial document hierarchical tree; traverse the entire text to identify cross-reference information within the document, parse the target number and target level of the referenced object, compare the parsing result with the initial document hierarchical tree, if they match, the verification is passed and the confidence of the corresponding level determination is increased, if they do not match, a hierarchical correction signal is triggered, and the numbering system implicit in the cross-reference is used as a constraint to backtrack the corresponding area for local hierarchical re-inference; repeat the verification and correction process until the matching rate between the cross-references of the entire document and the current hierarchical tree reaches a preset threshold, and output the corrected final hierarchical tree; Specifically, the local hierarchical re-inference process is as follows: When the cross-reference target number parsed in a paragraph does not match the actual level of the corresponding paragraph in the initial hierarchy tree, the process is centered on that paragraph, tracing back upwards to the most recently verified parent heading paragraph, and downwards to the paragraph preceding the next sibling heading paragraph. All paragraphs within this range are considered the re-inference region. Within the re-inference region, the high-confidence paragraph hierarchy labels that have passed cross-reference verification are frozen. The formatting features of each paragraph within the region are re-extracted, and combined with the implicit hierarchy order constraints in the cross-reference numbering system, the Viterbi algorithm is used to re-predict the hierarchy label sequence of each paragraph within the region, ensuring that the hierarchy labels of all paragraphs within the region satisfy the hierarchical relationship of the numbering system. After the re-inference is completed, the corrected hierarchy labels are merged with the uncorrected hierarchy labels outside the region to form an updated document hierarchy tree, and then the next round of iteration verification is performed.
[0034] The upper boundary of the re-inference region is determined as follows: starting from the current paragraph, traverse upwards until the first paragraph with a cross-reference verification mark and a successful verification result is encountered; this paragraph is the upper boundary. If no successfully verified paragraph is found when traversing upwards to the beginning of the document, the first paragraph of the document is used as the upper boundary. The lower boundary of the re-inference region is determined as follows: starting from the current paragraph, traverse downwards until the first paragraph with a different hierarchical numbering system than the chapter numbering system of the current paragraph is encountered; the paragraph preceding this paragraph is the lower boundary. If no paragraph with a different numbering system is found when traversing downwards to the end of the document, the last paragraph of the document is used as the lower boundary.
[0035] The preset threshold ranges from 95% to 100%, with a preferred value of 98%. This threshold is set based on the following: the number of cross-references in a document is positively correlated with the document length. For documents with fewer than 10 cross-references, the threshold is set to 100%, meaning the iteration terminates only after all cross-references pass verification. For documents with 10 to 50 cross-references, the threshold is set to 98%. For documents with more than 50 cross-references, the threshold is set to 95%. When the matching rate does not improve after two consecutive iterations, the iteration terminates even if the preset threshold is not reached to avoid an infinite loop. The current hierarchical tree is then output as the final hierarchical tree, and a list of failed cross-references is generated for manual review.
[0036] Step S3: Perform semantic content cleaning and entity annotation on the document content for which the final hierarchical tree has been established, and construct a cross-document entity spatiotemporal graph; based on the cross-document entity spatiotemporal graph, calculate the comprehensive credibility of each entity attribute value from the time dimension, source dimension, and consistency dimension respectively, automatically distinguish the contradiction type according to the comprehensive credibility and output the adjudication result to obtain the document content after semantic consistency governance; for each attribute value of each entity, record: [value, source document ID, document last modification time, document author / department].
[0037] The semantic content cleaning refers to content purification operations oriented towards the semantic level of a document, which are different from format surface cleaning. Specifically, it includes the following sub-steps: (a) Redundant information removal: Identify and remove duplicate paragraphs, filler words and phrases without substantial meaning (such as redundant expressions in transitional phrases such as "In summary, as mentioned above"), and placeholder text (such as "This needs to be supplemented" or "TODO") in the document, but retain the hierarchical position of the redundant information and mark it with placeholders. (b) Grammatical error correction: For paragraphs identified as main text after hierarchical structure analysis, grammatical standardization correction is performed, including subject-verb collocation correction, missing subject completion, and punctuation standardization. The correction is limited to sentence-level grammatical errors and does not change the factual meaning of the sentences. (c) Dereference resolution: Dereference pronouns (such as "the parameter", "the above method", etc.) in the document and replace them with explicit nominal references to enhance the accuracy of entity annotation and the reliability of subsequent cross-document entity alignment. (d) List structure standardization: unordered and ordered lists in the document are uniformly converted into a standard list structure, and the implicit hierarchical relationship in the list items is made explicit through indentation or numbering.
[0038] The semantic content cleaning operation described above is performed paragraph by paragraph based on the document structure range determined by the final hierarchical tree, ensuring that semantic cleaning does not disrupt the hierarchical structure of the document.
[0039] The entity annotation employs a named entity recognition model based on a pre-trained language model (such as BERT or RoBERTa) to automatically annotate document content. The annotated entity types include at least: organization name, personnel name, product model, technical parameter name, numerical parameter value, date and time, geographical location, project name, and document number. The output format of the entity recognition model is (entity mention, entity type, start position, end position), and each entity record is associated with the paragraph hierarchy path determined in step S2 (e.g., "Chapter 3 / Section 3.2 / Paragraph 3.2.1").
[0040] For numerical parameter entities, a numerical normalization operation is further performed to convert different units of measurement (such as kW and kilowatt, MPa and megapascal) into standard units of measurement, and to convert Chinese numerical expressions (such as two hundred and fifty) into Arabic numeral expressions (such as 250) to reduce the complexity of subsequent cross-document entity attribute alignment.
[0041] The data source range of the cross-document entity spatiotemporal graph is: the entire set of documents to be governed input from the same business system or the same project library. Specifically, when a batch of documents is input into the system and steps S1 to S3 are executed, the system uses all documents in the batch as the data range for graph construction, extracts the entities and their attribute values in each document, and establishes cross-document attribute-time-source records.
[0042] If the system has already built an entity spatiotemporal graph for the same project or business domain in previous governance batches, the entity information in the current batch will be incrementally merged into the existing graph. For the same attribute of the same entity, the old and new records will be sorted by the last modified document time and then jointly participate in the comprehensive credibility calculation in subsequent steps. During incremental merging, if there are records from different sources with the exact same timestamp, all records will be retained and a document source mark will be added to the source dimension for distinction, without performing deduplication.
[0043] Step S4: Reorganize the document content after semantic consistency governance into a three-level pyramid information structure containing a sparse layer, a medium-density layer, and a complete layer, with each level arranged from high to low information density; In response to the query request of the retrieval enhancement generation system, calculate the query complexity score, and dynamically select the content of the corresponding information density level to inject into the context window of the large language model based on the query complexity score. The query complexity score is calculated based on the following three dimensions: (a) Query sentence complexity dimension: By analyzing the number of logical connectors (such as AND, OR, NOT, and compared to) in the query statement, the nesting depth of clauses, and the types of interrogative words (yes / no, specific, alternative, and hypothetical questions), the query sentence complexity is quantified into a first sub-score. The more complex the sentence, the higher the first sub-score. (b) Query information granularity dimension: By matching the query statement with the pre-built domain dictionary, the knowledge granularity level involved in the query is determined. If the query only involves a single named entity or a single numerical attribute, it is determined to be a fine-grained query. If the query involves comparison between entities, causal reasoning, or multi-step logical chains, it is determined to be a coarse-grained query. Based on this, the information granularity is quantified into a second sub-score. The coarser the query granularity, the higher the second sub-score. (c) Query constraint dimension: Count the number of constraints (such as time constraints, range constraints, and condition constraints) in the query statement. Each constraint is scored as 1 point, with a maximum of 5 points, as the third sub-score; The first sub-score, the second sub-score, and the third sub-score are weighted and summed according to preset weights (such as 0.4, 0.4, and 0.2) to obtain the total query complexity score. The total score is then normalized to the interval [0,1].
[0044] The mapping rule for selecting the corresponding information density level based on the query complexity score is as follows: a sparse layer is selected when the score is less than 0.3; a medium-density layer is selected when the score is between 0.3 and 0.7; and a complete layer is selected when the score is greater than 0.7. If the query statement explicitly specifies the expected level of detail (e.g., the user instruction contains the keywords "brief answer" or "detailed explanation"), the user instruction takes precedence and overrides the above automatic mapping results.
[0045] Step S5: Output the document content after semantic consistency governance as a standardized document, and output the final hierarchical tree and the entity annotation as a structured corpus.
[0046] In step S2, the multi-dimensional typesetting features include font size, bolding, centering, indentation, numbering mode, spacing from the preceding paragraph, paragraph length, and whether it starts with a serial number; the sequence labeling model is a conditional random field model or a sequence labeling model combining a bidirectional long short-term memory network and a conditional random field, and the sequence labeling model incorporates hierarchical transition probability constraints of the enterprise document numbering mode.
[0047] The input to the sequence labeling model is an M-dimensional typesetting feature vector for each paragraph, where M corresponds to the number of extracted typesetting feature dimensions (including font size, bold, center, left indentation, first-line indentation, numbering pattern encoding, distance from the previous paragraph, paragraph length, and whether it starts with a serial number, totaling 9 features). Each feature dimension is concatenated into a feature vector after Z-score standardization.
[0048] The hierarchical tagging system uses five tag sets: TITLE_1 (first-level heading), TITLE_2 (second-level heading), TITLE_3 (third-level heading and below), BODY_TEXT (body content), and TABLE_CAPTION (table / chart title). Headings exceeding three levels are uniformly grouped into the TITLE_3 category.
[0049] The training data for the sequence labeling model comes from a manually annotated enterprise document corpus, with an annotation scale of no less than 500 documents and a total of approximately 100,000 paragraphs. The annotation consistency was tested by the Kappa coefficient (Kappa≥0.85) before being included in the training set. During training, the hold-out method was used to divide the data into training, validation, and test sets in an 8:1:1 ratio. The checkpoint with the highest F1 score on the validation set was selected as the final model.
[0050] In step S2, the cross-reference information includes chapter references, section references, and figure references; wherein, the chapter reference is a reference containing the format "see Chapter X", the section reference is a reference containing the format "as described in Section XX above", and the figure reference is a reference containing the format "see Table X", where X is an arbitrary number placeholder.
[0051] In step S3, the cross-document entity spatiotemporal graph establishes a cross-document attribute-time-source record for each entity identified by named entity. Each record includes attribute value, source document identifier, document last modification time, and document source information.
[0052] In step S3, the types of contradictions include version update contradictions, data entry error contradictions, and real conflict contradictions. Version update contradictions are those where entity attributes exhibit monotonous changes over time, such as "Product Model X-2024" in old document A becoming "X-2025" in the latest document. Data entry error contradictions are those where attribute values in a single document deviate from consistent values in most documents, such as N-1 documents containing A and 1 document containing B. Real conflict contradictions are those where attribute values in different documents each have supporting factors with comparable source weights and intertwined timelines.
[0053] For determining version update-related conflicts, the following criteria are used for different types of entity attributes: For numerical entity attributes (such as rated power, rated voltage, and dimensional parameters), extract the numerical sequence of this entity attribute in each document, sort it by the document's last modification time, and check whether the sequence shows a monotonically increasing or monotonically decreasing trend. If the numerical changes at adjacent time points always show the same direction (i.e., all increasing or all decreasing), it is determined to be a version update-related contradiction.
[0054] For non-numerical entity attributes (such as product model name, responsible person's name, supplier name, etc.), after sorting by the document's last modification time, the string edit distance (Levenshtein distance) between adjacent time points is compared. If the edit distance is positively correlated with the time interval (i.e., the closer the time, the greater the change, or the change only appears unidirectionally on the timeline without regression), it is determined to be a version update type contradiction. The phrase "unidirectionally appearing without regression" means that after any attribute value appears for the first time, its appearance in all subsequent time points does not revert to that attribute value.
[0055] For attributes that are neither numerical nor named entities (such as descriptive text), the determination of version update type contradictions is not applicable; they are directly classified as genuine conflict type contradictions and are subject to manual review.
[0056] In step S3, the formula for calculating the overall credibility is: C(a)=α·w_time(a)+β·w_src(a)+θ·w_cons(a); Where C(a) is the overall credibility of attribute value a; w_time(a) is the time weight; w_src(a) is the source weight; w_cons(a) is the consistency weight; α, β, and θ are the corresponding weight coefficients, and α+β+θ=1, the weight ratio can be adjusted according to the business scenario.
[0057] The time weight is calculated based on the document's update time using an exponential decay function; the newer the document, the higher its weight. The source weight is determined according to the document type and the department from which the document originates; officially released documents have a higher weight than internal drafts, and documents from the competent authority have a higher weight than documents from the citing party. The consistency weight is determined based on the frequency of the same attribute value in multiple independent documents; the higher the frequency, the higher the consistency weight.
[0058] In step S4, in the three-level pyramid information structure, the sparse layer contains a global summary of the document and a list of key conclusions, accounting for 8% to 12% of the original text; the medium-density layer contains key points of each chapter, key data tables, and entity relationship diagrams, accounting for 25% to 35% of the original text; and the complete layer contains the original document content, accounting for 55% to 65% of the original text.
[0059] The three-level pyramid information structure is a three-level structure of "summary-details": Layer 1 (sparse layer, accounting for about 10% of the original text): global summary of the document + list of key conclusions, ensuring that the large model can grasp the core arguments of the document in the top 2000 tokens with the strongest attention; Layer 2 (medium density layer, accounting for about 30% of the original text): key points of each chapter + key data tables + entity relationship diagrams, ensuring that the most important structured information is carried in the middle attention area; Level 3 (Complete Level, approximately 60% of the original text): Original document content, for reference only.
[0060] In RAG retrieval, this pyramid structure allows the system to select different density layers of information to inject based on the complexity of the query—simple questions only require the first layer, while complex reasoning questions gradually drill down to the third layer, maximizing the information utility of the attention window.
[0061] It should be noted that the sparse layer, medium-density layer, and complete layer do not mean dividing the original text into three mutually exclusive parts, but rather three independently encapsulated representations that refine and organize the content of the same document according to different density levels. Specifically: The sparse layer consists of independently generated extracted content, which accounts for 8% to 12% of the total length of the original text. It is not a continuous segment extracted from the original text, but a compressed representation generated based on a global understanding of the semantics of the entire text. The medium-density layer is independently generated semi-condensed content, which accounts for 25% to 35% of the total length of the original text. It is also a semi-condensed representation based on the content of the whole text. The complete layer refers to the original document content after processing through steps S1 to S3, and its length is the same as the original text length. It serves as the benchmark reference layer in the pyramid structure.
[0062] Therefore, the base for the proportion of the three layers is the total length of the same original text. The three percentages independently describe the proportion of each layer relative to the original text, and it is not required that the sum of the three equals 100%. In specific implementation, it is preferable to set the length of the sparse layer to 10% of the original text, the length of the medium-density layer to 30% of the original text, and the complete layer to be the original text itself, so as to achieve the distinguishability of information density between layers.
[0063] In step S4, when the document content after semantic consistency governance is reorganized into a three-level pyramid information structure containing a sparse layer, a medium-density layer, and a complete layer, if the document content must be segmented, the segmentation is performed based on the minimum semantic damage point determined by sentence boundary detection and semantic dependency parsing. Each segmented block automatically carries its parent title path and previous text summary information.
[0064] The determination of the minimum semantic impairment point is based on the following semantic impairment evaluation rules: Candidate segmentation points are the boundary positions between any two adjacent sentences in a document. For each candidate segmentation point, the following three semantic impairment metrics are calculated: (a) Cross-boundary dependency index of pronouns: check whether the sentence after the candidate segmentation point contains pronouns (such as "this", "its", "this", "the above"). If the antecedent of the pronoun is located in the sentence before the candidate segmentation point, it is determined that there is a cross-boundary dependency of pronouns, and the semantic impairment value increases. (b) Conditional logic cross-boundary dependency index: Check whether the sentence after the candidate segmentation point begins with a conditional conjunction (such as but, therefore, however, then), and the logical antecedent of the conjunction is located in the sentence before the candidate segmentation point. If this situation exists, it is determined that there is a cross-boundary logical dependency, and the semantic impairment value increases. (c) Topic coherence index: Calculate the semantic similarity between the two sentences before and after the candidate segmentation point in the vector space (using the pre-trained Sentence-BERT model). The higher the semantic similarity, the greater the degree of destruction of topic coherence by the segmentation, and the higher the semantic damage value. Based on the above three indicators, the candidate segmentation point with the smallest total semantic impairment value is selected as the actual segmentation location. If the candidate segmentation point with the smallest total semantic impairment value is still higher than the preset threshold, it indicates that the document is not semantically suitable for segmentation, and the segmentation is abandoned while the document is preserved as a whole.
[0065] In step S5, the standardized document is a human-readable document, and the structured corpus is structured data in a machine-readable format; the human-readable format includes at least Word documents and PDF documents, and the machine-readable format includes at least JSON and XML formats.
[0066] Taking the management of 12 bidding technical documents from a certain company as an example, the total number of pages is approximately 300, including multi-level numbering, cross-references, and multiple versions of technical parameters: 1. Hierarchical recognition stage: The initial accuracy rate of layout feature recognition was 87%. After cross-referencing and reverse verification, the accuracy rate was improved to 95%, and the problem of 6 bold paragraphs being misjudged as titles and manual numbering hierarchy errors was corrected.
[0067] 2. Conflict adjudication stage: 8 cross-document conflicts were identified in two categories: product model and rated power. Among them, 5 were judged as version evolution, 2 were judged as input errors and recommended values were given, and 1 was marked as a real conflict and pushed to manual review. The classification accuracy rate reached 88%.
[0068] 3. After pyramid optimization: Under the same context window, RAG question answering accuracy improved by 27%, and key parameter recall improved by 31%.
[0069] 4. End-to-end processing efficiency: The end-to-end processing time for a 300-page document is approximately 2.5 minutes, which is far less than the 2-3 working days required for manual processing.
[0070] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A document-based progressive semantic governance method for large-scale models, characterized in that, Includes the following steps: Step S1: Perform file compliance verification and format surface cleaning on the input unstructured document in sequence to obtain the format-normalized document content; The file compliance verification includes detecting the true format through the file magic number, intercepting encrypted files, and verifying file integrity; the format surface cleaning includes merging soft returns, extracting the content of free text boxes, unifying special characters, and embedding images in placeholders to complete the surface format normalization. Step S2: Extract multi-dimensional layout features from each paragraph in the document content, use a sequence labeling model to perform forward prediction of hierarchical labels for each paragraph, output an initial hierarchical label sequence composed of each hierarchical label, and construct an initial document hierarchical tree; Traverse the entire document to identify cross-reference information within the document, parse the target number and target level of the referenced object, compare the parsing result with the initial document hierarchy tree, if they match, the verification is passed and the confidence of the corresponding level determination is increased, if they do not match, the level correction signal is triggered, and the numbering system implicit in the cross-reference is used as a constraint to backtrack the corresponding area for local level re-inference. Repeat the verification and correction process until the matching rate between the cross-references of the entire document and the current hierarchical tree reaches a preset threshold, and output the corrected final hierarchical tree; Step S3: Perform semantic content cleaning and entity annotation on the document content for which the final hierarchical tree has been established, and construct a cross-document entity spatiotemporal graph; based on the cross-document entity spatiotemporal graph, calculate the comprehensive credibility of each entity attribute value from the time dimension, source dimension and consistency dimension respectively, automatically distinguish the contradiction type according to the comprehensive credibility and output the adjudication result to obtain the document content after semantic consistency governance; Step S4: Reorganize the document content after semantic consistency governance into a three-level pyramid information structure containing a sparse layer, a medium-density layer, and a complete layer, with each level arranged from high to low information density; In response to the query request of the retrieval enhancement generation system, calculate the query complexity score, and dynamically select the content of the corresponding information density level to inject into the context window of the large language model based on the query complexity score. Step S5: Output the document content after semantic consistency governance as a standardized document, and output the final hierarchical tree and the entity annotation as a structured corpus.
2. The document progressive semantic governance method for large models according to claim 1, characterized in that, In step S2, the multi-dimensional typesetting features include font size, bolding, centering, indentation, numbering mode, spacing from the preceding paragraph, paragraph length, and whether it starts with a serial number; the sequence labeling model is a conditional random field model or a sequence labeling model combining a bidirectional long short-term memory network and a conditional random field, and the sequence labeling model incorporates hierarchical transition probability constraints of the enterprise document numbering mode.
3. The document progressive semantic governance method for large models according to claim 1, characterized in that, In step S2, the cross-reference information includes chapter references, section references, and figure references; wherein, the chapter reference is a reference containing the format "see Chapter X", the section reference is a reference containing the format "as described in Section XX above", and the figure reference is a reference containing the format "see Table X", where X is an arbitrary number placeholder.
4. The document progressive semantic governance method for large models according to claim 1, characterized in that, In step S3, the cross-document entity spatiotemporal graph establishes a cross-document attribute-time-source record for each entity identified by named entity. Each record includes attribute value, source document identifier, document last modification time, and document source information.
5. The document progressive semantic governance method for large models according to claim 1, characterized in that, In step S3, the contradiction types include version update contradictions, data entry error contradictions, and real conflict contradictions; wherein, the version update contradiction is a contradiction type in which the entity attribute shows monotonous change in the time series, the data entry error contradiction is a contradiction type in which the attribute value in a single document deviates from the consistent value in most documents, and the real conflict contradiction is a contradiction type in which the attribute values in different documents are supported by each other and the source weights are equal, and the timelines are intertwined.
6. The document progressive semantic governance method for large models according to claim 1, characterized in that, In step S3, the formula for calculating the overall credibility is: C(a)=α·w_time(a)+β·w_src(a)+θ·w_cons(a); Where C(a) is the overall credibility of attribute value a; w_time(a) is the time weight; w_src(a) is the source weight; w_cons(a) is the consistency weight; α, β, and θ are the corresponding weight coefficients, and α+β+θ=1.
7. A document-based progressive semantic governance method for large models according to claim 6, characterized in that, The time weight is calculated based on the document's update time using an exponential decay function; the newer the document, the higher its weight. The source weight is determined according to the document type and the department from which the document originates; officially released documents have a higher weight than internal drafts, and documents from the competent authority have a higher weight than documents from the citing party. The consistency weight is determined based on the frequency of the same attribute value in multiple independent documents; the higher the frequency, the higher the consistency weight.
8. A document-based progressive semantic governance method for large models according to claim 1, characterized in that, In step S4, in the three-level pyramid information structure, the sparse layer contains a global summary of the document and a list of key conclusions, accounting for 8% to 12% of the original text; the medium-density layer contains key points of each chapter, key data tables, and entity relationship diagrams, accounting for 25% to 35% of the original text; and the complete layer contains the original document content, accounting for 55% to 65% of the original text.
9. A document-based progressive semantic governance method for large models according to claim 1, characterized in that, In step S4, when the document content after semantic consistency governance is reorganized into a three-level pyramid information structure containing a sparse layer, a medium-density layer, and a complete layer, if the document content must be segmented, the segmentation is performed based on the minimum semantic damage point determined by sentence boundary detection and semantic dependency parsing. Each segmented block automatically carries its parent title path and previous text summary information.
10. A document-based progressive semantic governance method for large models according to claim 1, characterized in that, In step S5, the standardized document is a human-readable document, and the structured corpus is structured data in a machine-readable format; the human-readable format includes at least Word documents and PDF documents, and the machine-readable format includes at least JSON and XML formats.
