Page structured extraction and automatic segmentation method, system, medium and program product

CN122990726APending Publication Date: 2026-10-27PANDA XUEQU (WUHAN) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611074265.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-20
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

当面对词书页面中密集的嵌套排版或不规则的换行时,物理文本块的边界往往与实际的语义字段边界不重合,基于空间邻接关系的归并逻辑容易受到相邻条目内容的视觉干扰,会导致不同条目之间的字段发生错配,或者使属于同一条目的内容被错误截断与合并,进而增加条目切分漂移的概率,降低了所提取条目对象的结构化准确率与直接入库的可用性

Benefits of technology

[0065]1、本申请提供了一种页面结构化抽取与自动切分方法,通过对页面图像进行版面分析获取版面区域与阅读顺序,并提取字符序列及位置序列,进而融合这些信息构建多模态特征,使得系统在处理页面时能够同时感知文本的语义内容与物理排版结构。基于这种多模态特征识别字段类型并抽取从属关系,相较于单一文本特征,能够更精准地捕捉复杂版面下的逻辑关联。结合词边界标签生成候选切分点集合,缩小了切分边界的搜索空间。在此基础上,结合字段类型、从属关系以及位置序列,分别从几何一致性、语义连贯性以及结构完整性三个维度计算分段代价,将视觉排版的连续性、上下文语义的顺畅度以及条目结构的完备性共同作为评估标准。通过最小化这一综合分段代价来确定目标切分边界,实现了全局最优的切分决策,减少了因单一特征误判造成的切分截断或粘连,进而提高了最终生成的结构化条目对象的准确度与信息抽取质量,提高了直接入库的可用性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990726A_ABST
    Figure CN122990726A_ABST
Patent Text Reader

Abstract

A page structured extraction and automatic segmentation method, system, medium and program product, in the method, the page image to be processed is analyzed, the layout area and its reading order are extracted, and then the character sequence, position sequence and word boundary label are obtained. Subsequently, the above information is fused to construct a multi-modal feature, which is used to identify the field type and extract the dependency relationship between fields. On this basis, a candidate segmentation point set is generated according to the word boundary label, and the field type, dependency relationship and position sequence are combined to calculate the segmentation cost from three dimensions of geometric consistency, semantic coherence and structural integrity. The target segmentation boundary is accurately determined by minimizing the comprehensive segmentation cost, and finally the structured entry object is generated according to the boundary. The application is used to improve the structured accuracy of the extracted entry object and the availability of direct warehousing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image data processing, and in particular relates to a method, system, medium and program product for structured extraction and automatic segmentation of pages. Background Technology

[0002] With the advancement of digital transformation of educational publishing resources, converting physical paper page images into structured digital data that can be retrieved and processed by computers has become an important task. Traditional document image processing methods typically rely on basic optical character recognition technology to extract plain text content. This approach loses the rich spatial layout and semantic hierarchy between text blocks in the original page during processing, resulting in a flat distribution of output data. This reduces the ability of downstream digital question bank construction or intelligent teaching systems to access and analyze the data at a high level.

[0003] Related technologies typically employ a pipeline that combines layout analysis and optical character recognition (OCR), incorporating multimodal pre-trained models to jointly encode text sequences, two-dimensional spatial coordinates, and visual image features on a page, thereby performing entity classification and relationship linking. Through this joint visual and text modeling approach, the technology can identify homogeneous areas such as titles, body text, and illustrations on a page, and extract specific key-value pairs or predefined entities, thus improving the structured parsing capabilities of visually rich documents such as forms and invoices.

[0004] However, the content on textbook and dictionary pages typically exhibits weak template-based characteristics, and a complete dictionary entry usually includes multiple subordinate fields such as prefixes, phonetic symbols, parts of speech, definitions, and example sentences. These fields often involve cross-line layout, close side-by-side arrangement, and mixed multilingual characters. Related technologies, when implemented, primarily rely on the physical text lines or detection boxes output by optical character recognition at the basic granularity, depending on the two-dimensional spatial distance between text blocks or the global reading order for entity merging. When faced with dense nested layouts or irregular line breaks on dictionary pages, the boundaries of physical text blocks often do not coincide with the actual semantic field boundaries. Merging logic based on spatial adjacency is easily affected by visual interference from adjacent entries, leading to field mismatches between different entries, or incorrect truncation and merging of content belonging to the same entry. This increases the probability of entry segmentation drift, reducing the structural accuracy of the extracted entry objects and the usability for direct database entry. Summary of the Invention

[0005] This application provides a method, system, medium, and program product for structured extraction and automatic segmentation of pages, which improves the structured accuracy of extracted item objects and the usability of direct database entry.

[0006] Firstly, this application provides a method for structured extraction and automatic segmentation of pages, which performs layout analysis on the page image to be processed to obtain multiple layout areas and the reading order between the layout areas;

[0007] Extract the character sequence and the corresponding position sequence within the page area, and determine the word boundary label for each character in the character sequence;

[0008] Multimodal features are constructed by integrating page layout, reading order, character sequence, and position sequence;

[0009] Based on multimodal features, the field types corresponding to character sequences are identified, and the subordinate relationships between different field types are extracted;

[0010] Generate a set of candidate segmentation points based on word boundary labels;

[0011] Based on the candidate segmentation point set, and combined with field type, subordinate relationship and position sequence, the segmentation cost is calculated from the dimensions of geometric consistency, semantic coherence and structural integrity, and the target segmentation boundary is determined by minimizing the segmentation cost.

[0012] Based on the target segmentation boundary, the character sequences and their corresponding field types and subordinate relationships are merged to generate structured entry objects.

[0013] By employing the aforementioned technical solution, page layout analysis is performed on page images to obtain page areas and reading order, and character and position sequences are extracted. This information is then fused to construct multimodal features, enabling the system to simultaneously perceive the semantic content and physical layout structure of the text when processing pages. Based on this multimodal feature identification, field types and subordinate relationships are extracted, which, compared to single text features, can more accurately capture the logical connections under complex layouts. A candidate segmentation point set is generated by combining word boundary tags, narrowing the search space for segmentation boundaries. Furthermore, combining field type, subordinate relationships, and position sequences, segmentation costs are calculated from three dimensions: geometric consistency, semantic coherence, and structural integrity. The continuity of visual layout, the smoothness of contextual semantics, and the completeness of the item structure are used as evaluation criteria. By minimizing this comprehensive segmentation cost to determine the target segmentation boundary, globally optimal segmentation decisions are achieved, reducing segmentation truncation or adhesion caused by misjudgment of a single feature. This improves the accuracy and information extraction quality of the final generated structured item objects, enhancing the usability for direct database entry.

[0014] In conjunction with some implementation methods of the first aspect, in some implementation methods, the character sequence and the corresponding position sequence within the page area are extracted, and the word boundary label of each character in the character sequence is determined, specifically including:

[0015] Text lines are detected within the layout area to obtain multiple initial text boxes within the layout area;

[0016] The initial text box is input into a pre-trained optical character recognition network, which outputs the initial text content within the initial text box and the corresponding geometric coordinates.

[0017] The initial text content is segmented into character-level segments according to a preset single-character segmentation rule to obtain a character sequence. Geometric coordinates are then mapped to the character sequence to obtain the position sequence corresponding to the character sequence.

[0018] Extract the local image features corresponding to the initial text box, and concatenate the local image features with the character sequence to obtain the character visual fusion features. The local image features represent the visual information of the font size and font thickness of the character sequence in the page image.

[0019] Input the visual fusion features of characters into a pre-defined sequence labeling model, and output the classification probability of each character in the character sequence as a word beginning, word within, word ending, or independent word;

[0020] The word boundary label for each character in the character sequence is determined based on classification probability.

[0021] By employing the aforementioned technical solution, text line detection is performed on the page area, and the initial text content and its geometric coordinates are obtained using an optical character recognition network, achieving preliminary alignment between text information and spatial location. Character-level segmentation is performed according to preset rules, and the geometric coordinates are mapped to the character sequence, obtaining a fine-grained character position sequence. Furthermore, local image features corresponding to the initial text box are extracted; these features explicitly represent visual information such as font size and thickness of characters on the page. The local image features are concatenated with the character sequence to obtain character visual fusion features, enabling the subsequent model to not only possess semantic perception capabilities but also incorporate intuitive visual typography attributes when processing text. This fusion feature is input into a preset sequence labeling model. When predicting the classification probability of a character belonging to a word prefix, word within a word, word suffix, or independent word, the model can fully consider typography variations such as bolding or enlarging the font size, thereby reducing the misjudgment rate of word boundary recognition in complex and varied page layouts and improving the accuracy of character sequence word boundary label determination.

[0022] In conjunction with some implementation methods of the first aspect, in some implementation methods, based on the candidate segmentation point set, and in combination with field type, subordinate relationship, and position sequence, the segmentation cost is calculated from the dimensions of geometric consistency, semantic coherence, and structural integrity, respectively, and the target segmentation boundary is determined by minimizing the segmentation cost, specifically including:

[0023] Based on the set of candidate segmentation points, the character sequence is divided into multiple candidate segments;

[0024] For each candidate segment, extract the position sequence of the character sequence within the candidate segment;

[0025] Calculate the line height change value and indentation jump value between adjacent characters within the candidate segment, and use the weighted penalty sum of the line height change value and indentation jump value as the geometric consistency cost;

[0026] Extract the field types corresponding to the character sequences within the candidate segments;

[0027] If the detection result of the preset field type mutation within the candidate segment indicates that there is a preset field type jump, the preset first penalty score will be used as the semantic coherence cost.

[0028] Based on the subordinate relationship, the character sequence in the candidate segment is checked to see if it contains the preset necessary prefix field and definition field, and the core field set verification result indicating the missing field status is obtained. If the core field set verification result indicates the missing field, the preset second penalty score is used as the structural integrity cost.

[0029] The segmentation cost of the candidate segment is obtained by weighted summation of the geometric consistency cost, semantic coherence cost, and structural integrity cost.

[0030] Construct a directed acyclic graph with candidate split points as nodes and segmentation costs as edge weights;

[0031] The optimal splitting path with the minimum total cost is searched in the directed acyclic graph, and the candidate splitting points on the optimal splitting path are determined as the target splitting boundary.

[0032] By employing the aforementioned technical solution, the physical continuity of text in visual typography is objectively quantified by dividing the character sequence into multiple candidate segments and extracting their position sequences. A weighted penalty sum of line height variation and indentation jump values ​​between adjacent characters is calculated as the geometric consistency cost. Simultaneously, the field types of candidate segments are extracted. A first penalty score is applied as the semantic coherence cost when a sudden change in field type is detected. Furthermore, the core field set is verified based on hierarchical relationships, and a second penalty score is applied as the structural integrity cost when a field is missing. This incorporates deep semantic logic and content completeness constraints into the evaluation system. The costs of these three dimensions are weighted and summed to obtain the comprehensive segmentation cost. Based on this, a directed acyclic graph is constructed with candidate segmentation points as nodes and segmentation costs as edge weights. Determining the segmentation boundary is transformed into an optimal path search process within the graph structure, reducing sentence breaks that violate typographical rules or disrupt logical integrity, and improving the rationality of the target segmentation boundary location.

[0033] In conjunction with some implementation methods of the first aspect, in some implementation methods, character sequences and their corresponding field types and subordinate relationships are merged according to the target segmentation boundary to generate structured entry objects, specifically including:

[0034] Based on the target segmentation boundary, the character sequences and their corresponding field types and subordinate relationships are initially merged to obtain the initial entry objects;

[0035] Traverse the structured initial entry object and detect the preset abbreviation contained in the character sequence corresponding to the target field type in the initial entry object;

[0036] In response to the detection of a preset abbreviation, extract the adjacent context features of the preset abbreviation in the character sequence;

[0037] Extract the base character sequence corresponding to the prefix field from the same initial entry object containing the preset abbreviation;

[0038] Lexical transformation rules for a baseline character sequence are determined based on adjacent context features;

[0039] The baseline character sequence is input into the lexical transformation rules for conversion, generating a complete pronoun vocabulary that matches the features of the adjacent context.

[0040] The preset abbreviations and adjacent characters in the character sequence corresponding to the target field type are replaced with complete referential words to eliminate cross-field referential ambiguity within the initial entry object and generate a semantically aligned structured entry object.

[0041] By employing the aforementioned technical solution, the system iterates through the initial entry objects obtained through preliminary merging, detects the pre-defined abbreviations contained in the target field types, and extracts the adjacent contextual features of these abbreviations in the character sequence. This allows for the accurate capture of the specific linguistic environment in which the abbreviations are expressed. A baseline character sequence corresponding to the prefix field is extracted from the same initial entry object, and lexical transformation rules are determined based on the aforementioned adjacent contextual features. This enables the system to dynamically adjust the lexical form according to specific contexts. The baseline character sequence is then input into these rules for transformation, generating a complete vocabulary that perfectly matches the adjacent contextual features. Finally, the pre-defined abbreviations and adjacent characters in the target field types are replaced with this complete vocabulary. This eliminates cross-field referential ambiguity caused by the use of abbreviations within the initial entry objects, reduces the risk of semantic gaps in text reading and machine understanding, and ultimately improves the semantic alignment and overall logical coherence of the final generated structured entry objects.

[0042] In conjunction with some implementations of the first aspect, in some implementations, a baseline character sequence is input to lexical transformation rules for conversion to generate a complete pronoun vocabulary that matches the features of the adjacent context, specifically including:

[0043] Extract the tail truncation length and target concatenation suffix contained in the lexical inflection rules;

[0044] Based on the truncation length, the last character of the base character sequence is removed to obtain the initial truncated sequence;

[0045] Based on the syllable change markers in the lexical inflection rules, and if the junction of the initial truncated sequence and the target concatenated suffix satisfies the preset consonant double-writing condition, the last character of the initial truncated sequence is copied to perform double-writing compensation on the initial truncated sequence.

[0046] The target concatenation suffix is ​​appended to the end of the compensated initial truncated sequence to generate a complete pronoun that matches the features of the adjacent context.

[0047] By employing the aforementioned technical solution, the truncation length and target concatenation suffix are extracted from the lexical derivation rules. Following this length, the last character of the baseline character sequence is removed to obtain an initial truncation sequence. Then, based on syllable change indicators, it is determined whether the consonant double-writing condition is met at the junction. If the condition is met, double-writing compensation is performed by copying the last character. Finally, the target concatenation suffix is ​​appended to the end of the compensated sequence. This refines the macroscopic lexical derivation rules into precise character-level truncation, conditional compensation, and concatenation actions, ensuring that the restoration of pronouns strictly follows the morphological changes of natural language. This dynamic morphological transformation mechanism, based on specific contextual information and syllable features, reduces grammatical errors or awkward spelling caused by mechanical concatenation, thereby improving the grammatical accuracy and naturalness of the generated complete pronouns in specific contexts and reducing the risk of semantic comprehension bias caused by awkward morphological transformation.

[0048] In conjunction with some implementations of the first aspect, in some implementations, after replacing the preset abbreviations and adjacent characters in the character sequence corresponding to the target field type with complete referential terms to eliminate cross-field referential ambiguity within the entry object and generate semantically aligned entry objects, the method further includes:

[0049] From the multimodal features, we backtrack to extract the first visual typography features corresponding to the baseline character sequence in the page image, as well as the second visual typography features corresponding to the preset abbreviation and adjacent characters in the page image.

[0050] Based on lexical inflection rules, complete referential words are divided into root segments and derived suffix segments;

[0051] Map the first visual typographic features to the root word segments in the entry object, and map the second visual typographic features to the derived suffix segments in the entry object;

[0052] Based on the mapped first and second visual typographic features, the complete pronouns are rendered as rich text objects.

[0053] Update the rich text object to the entry object.

[0054] By employing the aforementioned technical solution, the first visual typography features of the baseline character sequence and the second visual typography features of preset referential abbreviations and adjacent characters are extracted from multimodal features. Based on lexical transformation rules, the generated complete referential vocabulary is precisely divided into root fragments and derived suffix fragments. The first visual typography features are then mapped to the root fragments, and the second visual typography features are mapped to the derived suffix fragments. This process performs fine-grained alignment of the font, size, and other visual typography attributes of different text parts in the original page image with the morphologically restored vocabulary fragments. Based on this, the complete referential vocabulary is rendered as a rich text object and updated in the entry object. This allows the restored referential vocabulary to inherit the complex typographic emphasis intent of the original document, thereby improving the visual fidelity and typographic information richness of the structured entry object and reducing the probability of losing the original typographic semantics during text normalization.

[0055] In conjunction with some implementation methods of the first aspect, in some implementation methods, based on lexical inflection rules, the complete referential vocabulary is divided into root segments and derived suffix segments, specifically including:

[0056] Based on lexical transformation rules, the number of unmutated characters in the baseline character sequence that did not undergo character substitution or deletion during morphological transformation is determined.

[0057] Based on the number of unmutated characters, a morphological truncation index is determined in the character sequence of the complete referential word to separate the root segment and the derived suffix segment;

[0058] Based on the morphological truncation index, the character sequence from the starting position to the morphological truncation index is extracted from the complete pronoun to obtain the root fragment;

[0059] Extract the character sequence from the morphological truncation index to the end position in the complete pronoun to obtain the derived suffix fragment.

[0060] By employing the aforementioned technical solution, the number of unmutated characters in the baseline character sequence that did not undergo character substitution or deletion during morphological transformation is determined based on lexical transformation rules. Using this number as a basis, a morphological truncation index for segmenting root and derived suffix segments is accurately located within the character sequence of the complete referential word. This index is then used to accurately truncate the complete referential word into root and derived suffix segments. This solution leverages the conservation properties of characters during morphological transformation to establish a quantitative computational model that achieves precise morpheme-level segmentation without relying on complex external word segmentation tools. It transforms complex morphological boundary recognition into a clear character index positioning process, reducing the ambiguity in boundary determination caused by irregular word morphology or spelling variations. This improves the accuracy of segmenting root and derived suffix segments within the complete referential word and reduces the risk of misalignment during visual feature mapping.

[0061] Secondly, embodiments of this application provide a page structure extraction and automatic segmentation system, which includes: one or more processors and a memory; the memory is coupled to one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and one or more processors call the computer instructions to cause the system to perform the method described in the first aspect and any possible implementation of the first aspect.

[0062] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a system, cause the system to perform the method described in the first aspect and any possible implementation thereof.

[0063] Fourthly, embodiments of this application provide a computer program product that, when run on a system, causes the system to execute the method described in any possible implementation of the first aspect.

[0064] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0065] 1. This application provides a method for structured page extraction and automatic segmentation. It analyzes page images to obtain layout areas and reading order, extracts character sequences and position sequences, and then integrates this information to construct multimodal features. This allows the system to simultaneously perceive the semantic content and physical layout structure of the text when processing pages. Based on this multimodal feature, field types are identified and subordinate relationships are extracted, which can more accurately capture the logical connections under complex layouts compared to single text features. A candidate segmentation point set is generated by combining word boundary tags, narrowing the search space for segmentation boundaries. Furthermore, combining field type, subordinate relationships, and position sequences, the segmentation cost is calculated from three dimensions: geometric consistency, semantic coherence, and structural integrity. The continuity of visual layout, the smoothness of contextual semantics, and the completeness of the item structure are used as evaluation criteria. By minimizing this comprehensive segmentation cost to determine the target segmentation boundary, globally optimal segmentation decisions are achieved, reducing segmentation truncation or adhesion caused by misjudgment of a single feature. This improves the accuracy and information extraction quality of the final generated structured item objects and enhances the usability for direct database entry.

[0066] 2. This application provides a method for structured page extraction and automatic segmentation. By traversing the initial entry objects obtained through preliminary merging, it detects the preset abbreviations contained in the target field types and extracts the adjacent context features of these abbreviations in the character sequence, accurately capturing the specific linguistic environment in which the abbreviations are expressed. A baseline character sequence corresponding to the prefix field is extracted from the same initial entry object, and lexical transformation rules are determined for this baseline character sequence based on the aforementioned adjacent context features, enabling the system to dynamically adjust the lexical form according to specific contexts. The baseline character sequence is input into this rule for transformation, generating a complete vocabulary that perfectly matches the adjacent context features. Finally, the preset abbreviations and adjacent characters in the target field types are replaced with this complete vocabulary, eliminating cross-field ambiguity caused by the use of abbreviations within the initial entry objects, reducing the risk of semantic breaks in text reading and machine understanding, and thus improving the semantic alignment and overall logical coherence of the final generated structured entry objects.

[0067] 3. This application provides a method for structured page extraction and automatic segmentation. It extracts first visual typography features from a baseline character sequence and second visual typography features from preset abbreviations and adjacent characters from multimodal features. Based on lexical transformation rules, it accurately divides the generated complete pronouns into root fragments and derived suffix fragments. The first visual typography features are then mapped to the root fragments, and the second visual typography features are mapped to the derived suffix fragments. This process performs fine-grained alignment of the font, size, and other visual typography attributes of different text parts in the original page image with the morphologically restored word fragments. Based on this, the complete pronouns are rendered as rich text objects and updated in the entry objects. This allows the restored pronouns to inherit the complex typographic emphasis intentions of the original document, thereby improving the visual fidelity and typographic information richness of the structured entry objects and reducing the probability of losing the original typographic semantics during text normalization. Attached Figure Description

[0068] Figure 1 This is a flowchart illustrating a method for structured extraction and automatic segmentation of pages in an embodiment of this application.

[0069] Figure 2 This is another flowchart illustrating a page structure extraction and automatic segmentation method in an embodiment of this application.

[0070] Figure 3 This is another flowchart illustrating a method for structured extraction and automatic segmentation of pages in this application.

[0071] Figure 4 This is a schematic diagram of the physical device structure of a page structure extraction and automatic segmentation system provided in an embodiment of this application. Detailed Implementation

[0072] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0073] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0074] The following example is used in conjunction with Figure 1 This application describes a method for extracting and automatically segmenting page structures according to an embodiment:

[0075] Please see Figure 1 This is a flowchart illustrating a method for structured extraction and automatic segmentation of pages in an embodiment of this application.

[0076] S101. Perform layout analysis on the page image to be processed to obtain multiple layout areas and the reading order between each layout area;

[0077] The page image to be processed refers to the visual image file input into the system for parsing and extraction, including but not limited to scanned documents, webpage screenshots, or rendered electronic documents. Layout analysis refers to the technical process of analyzing the physical and logical structure of an image. A layout area refers to a block in an image with independent layout attributes, including but not limited to text blocks, table blocks, or image blocks. Reading order refers to the logical sequence in which different layout areas should be arranged according to natural human reading habits. This step is performed to grasp the overall physical layout framework and logical flow of the document from a macroscopic perspective before extracting specific text. Since complex pages often contain multi-column layouts and mixed text and images, directly performing full-image text recognition would lead to logically confused and semantically fragmented extracted text paragraphs. By pre-dividing independent layout areas and determining their reading order, it is possible to ensure that the subsequently extracted text content maintains correct coherence in both physical space and logical semantics, providing an accurate contextual basis for subsequent structured extraction.

[0078] The system employs a combination of deep learning-based object detection and heuristic rules. First, the system inputs the page image to be processed into a pre-trained convolutional neural network object detection model. This model extracts multi-scale visual features of the image through a feature pyramid network and outputs multiple page regions containing category labels and bounding box coordinates. Subsequently, the system extracts the center point coordinates and bounding box dimensions of each page region and uses a pre-defined heuristic sorting algorithm to sort these page regions according to their geometric position priority from top to bottom and left to right. During the sorting process, the system calculates the vertical overlap between adjacent page regions. When the vertical overlap exceeds a preset overlap threshold, it prioritizes sorting according to the order of the horizontal coordinates, ultimately generating the reading order among the page regions.

[0079] The system can also be implemented using an end-to-end layout analysis model based on graph neural networks. First, a lightweight backbone network is used to extract global visual feature maps of the page images to be processed, and a region candidate network is used to generate feature vectors for multiple layout regions. Next, the system treats each layout region as a graph node, constructing a document graph structure using the spatial distance between layout regions as edge weights. This graph structure is then input into a graph convolutional neural network, updating the feature representation of each node through inter-node information transfer mechanisms. The network ultimately outputs not only the classification result of each node to determine the attributes of the layout region, but also the directed edge probabilities between nodes through link prediction branches. Based on these directed edge probabilities, the system generates a directed acyclic graph and directly derives the reading order between the various layout regions using a topological sorting algorithm.

[0080] S102. Extract the character sequence and the corresponding position sequence within the page area, and determine the word boundary label for each character in the character sequence;

[0081] The system extracts character sequences and their corresponding position sequences within a page area, and determines the word boundary label for each character in the character sequence. Specifically, this includes: performing text line detection on the page area to obtain multiple initial text boxes; inputting the initial text boxes into a pre-trained optical character recognition network to output the initial text content within the initial text boxes and the corresponding geometric coordinates; performing character-level segmentation on the initial text content according to a preset single-character segmentation rule to obtain a character sequence, and mapping the geometric coordinates to the character sequence to obtain the corresponding position sequence; extracting local image features corresponding to the initial text boxes, and concatenating the local image features with the character sequence features to obtain character visual fusion features, where the local image features represent the font size and font thickness visual information of the character sequence in the page image; inputting the character visual fusion features into a preset sequence labeling model to output the classification probability of each character in the character sequence belonging to a word beginning, word within, word ending, or independent word; and determining the word boundary label for each character in the character sequence based on the classification probability.

[0082] First, let's explain the terms used in this step: Character sequence refers to a continuous set of text characters identified from an image. Position sequence refers to a set of spatial coordinates corresponding one-to-one with each character in the character sequence. Word boundary label refers to a classification marker used to identify the relative position of a single character within its vocabulary. Initial text box refers to the rectangular boundary region surrounding a single line of text initially detected. Optical character recognition network refers to a deep learning model used to convert text in an image into computer-readable text. Initial text content refers to the raw recognized string without fine-grained segmentation. Geometric coordinates refer to numerical pairs describing the absolute position of text in an image. Predefined single-character segmentation rules refer to predefined logic used to split an entire text segment into independent characters. Local image features refer to vector representations reflecting the visual style of a specific text region, characterizing the font size and thickness visual information of the character sequence in the page image. Character visual fusion features refer to comprehensive features that combine text semantics with visual style. Predefined sequence labeling model refers to a large-scale artificial intelligence model used to assign classification labels to sequence data. Classification probability refers to the confidence value of the model predicting that a character belongs to a specific label. This step is performed to accurately preserve the visual layout attributes of the text in the original image while acquiring the basic text content, and to clearly define the boundaries of words. Simple text recognition will lose visual cues that are extremely important for determining the hierarchy, such as font size and bolding. However, by fusing visual information through feature splicing and using sequence labeling models to determine word boundaries, the accuracy of subsequent field type recognition and segmentation point location can be greatly improved, avoiding the truncation of complete words in the middle.

[0083] The system can be implemented using a combined architecture of convolutional recurrent neural networks and conditional random fields. The system performs text line detection on the page area, using a differentiable binarization network to obtain multiple initial text boxes within the page area. The system inputs these initial text boxes into a pre-trained optical character recognition network (OCR), whose underlying structure combines a residual network and a bidirectional long short-term memory network. The network outputs the initial text content within each initial text box and its corresponding geometric coordinates. The system performs character-level segmentation of the initial text content according to a preset single-character segmentation rule based on proportional character width, obtaining a character sequence. The geometric coordinates are then mapped proportionally to the character sequence to obtain the corresponding position sequence. The system uses a feature pyramid network to extract local image features corresponding to the initial text boxes and concatenates these local image features with the word embedding vectors of the character sequence to obtain character visual fusion features. The system then inputs these character visual fusion features into a preset sequence labeling model. The underlying structure of this model is a Transformer encoder based on a self-attention mechanism. The training set is a document image dataset containing rich typographic styles and manually labeled word boundaries. The test set is an independent validation dataset with the same distribution. The input data is the visual fusion features of characters, and the output data is the classification probability of each character in the character sequence belonging to the beginning, middle, end, or independent word. The system determines the word boundary label of each character in the character sequence based on the category with the highest classification probability.

[0084] The system can also be implemented using a combined architecture of instance segmentation and graph attention networks. The system performs text line detection on the page area, using a masked region convolutional neural network to obtain multiple initial text boxes within the page area. The system inputs these initial text boxes into a pre-trained optical character recognition network. This network's underlying structure is a recognition model based on a visual Transformer architecture, outputting the initial text content within the initial text boxes and their corresponding geometric coordinates. The system performs character-level segmentation on the initial text content according to a preset single-character segmentation rule based on attention weight alignment, obtaining a character sequence. It then maps the geometric coordinates to the character sequence to obtain the corresponding position sequence. The system uses a lightweight convolutional network to extract local image features corresponding to the initial text boxes and concatenates these local image features with the character-level feature vectors of the character sequence to obtain character visual fusion features. The system then inputs these character visual fusion features into a preset sequence labeling model. The underlying structure of this model is a cascaded structure of graph attention network and conditional random field. The training set is a multilingual, multi-format open-source document understanding dataset, and the test set is a document dataset from a specific vertical domain. The input data is character visual fusion features, and the output data is the classification probability of each character in the character sequence belonging to the beginning, middle, end, or independent word. Based on the classification probability, the system determines the globally optimal word boundary label for each character in the character sequence using the Viterbi decoding algorithm.

[0085] S103. Construct multimodal features by integrating page layout areas, reading order, character sequences, and position sequences;

[0086] Multimodal features refer to joint vector representations that integrate various data dimensions such as visual layout, spatial location, logical order, and textual semantics. This step aims to overcome the limitations of single data modalities and construct a comprehensive feature space that fully reflects the content and form of a document. In complex page structures, determining whether a piece of text is a title or body text often requires more than just the meaning of the text itself; it also necessitates considering its position on the page, its order in the reading sequence, and its spatial layout characteristics. Deeply fusing this information from different modalities allows the system to perceive both "what was written" and "how it was formatted," much like human reading, thus providing comprehensive underlying data support for subsequent accurate identification of field types and extraction of hierarchical relationships.

[0087] The system can be implemented using a feature concatenation and dimensionality reduction method based on a multilayer perceptron. First, the system converts the category labels of the page areas into region vectors using one-hot encoding, and the reading order numbers into sequence vectors using sinusoidal positional encoding. Simultaneously, the system uses a pre-trained word vector model to convert character sequences into semantic vectors, and normalizes the coordinate values ​​of the position sequences to their minimum and maximum values ​​before converting them into spatial vectors. Next, the system directly concatenates the region vectors, sequence vectors, semantic vectors, and spatial vectors along the feature dimension to form a high-dimensional joint feature vector. Finally, the system inputs this high-dimensional joint feature vector into a multilayer perceptron containing multiple hidden layers for nonlinear mapping and feature dimensionality reduction, eliminating dimensional differences between different modal features, and ultimately outputting a multimodal feature that integrates page areas, reading order, character sequences, and position sequences.

[0088] The system can also employ a feature fusion method based on a cross-modal attention mechanism. The system utilizes independent linear projection layers to map layout area information, reading order information, character sequences, and position sequences into a latent space of the same dimension, resulting in four initial modal embedding vectors. The system uses the character sequence embedding vector as the query vector and the layout area, reading order, and position sequence embedding vectors as key and value vectors, respectively, and inputs them into a multi-head cross-modal attention network. By calculating the attention weights between the query vector and each key vector, the system can dynamically assign visual, spatial, and logical attention to each character. Through the interaction and aggregation of multiple layers of the cross-modal attention network, the system deeply interweaves the information from each modality, outputting a fusion vector containing rich context and typographic information, which serves as the multi-modal feature for fusing layout areas, reading order, character sequences, and position sequences.

[0089] S104. Identify the field types corresponding to the character sequence based on multimodal features, and extract the subordinate relationships between different field types;

[0090] Field type refers to a specific business semantic label assigned to a character sequence, including but not limited to title, body text, author, or abstract. Hierarchical relationship refers to the hierarchical and containment relationships between different fields in their logical structure, including but not limited to parent-child node relationships or peer-to-peer relationships. This step is performed to transform a flat, unstructured text stream into a logical tree with clear semantic roles and hierarchical structures. By identifying field types, the system understands the role each sentence plays in the document; by extracting hierarchical relationships, the system can reconstruct the outline logic implicitly created by the document author during formatting. This is a crucial step in achieving structured page extraction, ensuring that the final extracted data is no longer scattered text, but rather structured information with tight logical connections.

[0091] The system can utilize a pre-trained multimodal document understanding model. The underlying structure of this model is based on a multimodal Transformer architecture, incorporating a spatially aware self-attention mechanism. The training set is a large-scale document dataset containing rich typographical formats and manually labeled field types and hierarchical relationships, while the test set is a reserved identically distributed validation dataset. The model's input data consists of the multimodal features constructed in the previous steps, and the output data includes the probability distribution of field types corresponding to character sequences, as well as an adjacency matrix showing the hierarchical relationships between different character sequences. The system inputs the multimodal features into the model and determines the field type corresponding to the character sequence based on the category with the highest probability in the output field type probability distribution. Simultaneously, the system parses the adjacency matrix output by the model, extracting node pairs with probability values ​​greater than a preset connection threshold, thereby extracting the hierarchical relationships between different field types.

[0092] The system can also be implemented using a joint model based on graph convolutional neural networks and relation extraction. The underlying structure of this model includes graph convolutional layers for node classification and a bilinear classifier for edge prediction. The training set is a document graph dataset labeled with entity categories and hierarchical relationships between entities, while the test set consists of document graph data from a specific business scenario. The model's input data consists of graph node features constructed from multimodal features, and the output data consists of field type labels corresponding to nodes and a probability matrix showing the dependencies between nodes. The system constructs a document graph using multimodal features as node attributes and inputs it into the model. The graph convolutional layers output the classification result of each node as the field type corresponding to the character sequence. Next, the system uses a bilinear classifier to interactively calculate the features of node pairs, outputting a probability matrix. The system then extracts the dependencies between different field types based on this probability matrix.

[0093] S105. Generate a set of candidate segmentation points based on word boundary labels;

[0094] The candidate segmentation point set refers to the list of index positions in the character sequence that are initially selected and are likely to serve as the final segmentation locations for paragraphs or entries. This step is performed to significantly reduce the search space of the target segmentation boundaries and improve the algorithm's execution efficiency. Calculating the segmentation cost for every character gap in the character sequence is not only computationally intensive but also prone to forcibly cutting a complete word in the middle, destroying semantic integrity. By utilizing the pre-determined word boundary labels, the system generates candidate segmentation points only at the edges of words (such as word endings or after independent words), thereby ensuring segmentation efficiency while fundamentally avoiding intra-word truncation errors and providing a high-quality candidate foundation for subsequent refined cost calculations.

[0095] The system generates a candidate segmentation point set through traversal and conditional judgment. The system initializes an empty dynamic array to store the indices of the candidate segmentation points. The system uses a loop to traverse the word boundary labels corresponding to each character in the character sequence from beginning to end. During traversal, the system checks the word boundary label of the current character using conditional statements. When the word boundary label of the current character is detected as a word suffix or an independent word label, the system determines that the position after the current character is a valid word boundary, increments the current index value of that character in the sequence by one, and stores it in the dynamic array. After the entire character sequence has been traversed, the system converts this dynamic array into an immutable list structure, which serves as the final generated candidate segmentation point set.

[0096] The system can also generate a candidate segmentation point set through pattern matching and regular expressions. First, the system concatenates the word boundary labels of all characters in the character sequence into a continuous string pattern in their original order. For example, it maps the beginning, middle, end, and independent words to specific English characters. The system pre-writes regular expressions for matching legal segmentation gaps. These expressions define legal boundary transformation patterns, such as matching any combination of characters following the end of a word or any combination of characters following an independent word. The system calls the regular expression engine to perform a global search on the concatenated string pattern, extracting the position indices of transformations for all successfully matched pattern segments. The system then deduplicates and sorts these extracted position indices, ultimately generating a candidate segmentation point set.

[0097] S106. Based on the candidate segmentation point set, combined with field type, subordinate relationship and position sequence, calculate the segmentation cost from the dimensions of geometric consistency, semantic coherence and structural integrity, and determine the target segmentation boundary by minimizing the segmentation cost.

[0098] The system, based on a set of candidate segmentation points, and considering field type, hierarchical relationship, and position sequence, calculates segmentation costs from the dimensions of geometric consistency, semantic coherence, and structural integrity. It then determines the target segmentation boundary by minimizing the segmentation cost. Specifically, this includes: dividing the character sequence into multiple candidate segments based on the candidate segmentation point set; extracting the position sequence of the character sequence within each candidate segment; calculating the line height change and indentation jump values ​​between adjacent characters within the candidate segment, and using the weighted penalty sum of these values ​​as the geometric consistency cost; extracting the field type corresponding to the character sequence within the candidate segment; and detecting predefined field type mutations within the candidate segment to indicate the presence of predefined field type jumps. In this case, a preset first penalty score is used as the semantic coherence cost; based on the subordinate relationship, it is verified whether the character sequence in the candidate segment contains the preset necessary prefix field and definition field, and the core field set verification result indicating the missing field status is obtained. If the core field set verification result indicates the missing field, a preset second penalty score is used as the structural integrity cost; the geometric consistency cost, semantic coherence cost, and structural integrity cost are weighted and summed to obtain the segmentation cost of the candidate segment; a directed acyclic graph is constructed with candidate segmentation points as nodes and segmentation cost as edge weights; the optimal segmentation path with the minimum total cost is searched in the directed acyclic graph, and the candidate segmentation points on the optimal segmentation path are determined as the target segmentation boundary.

[0099] First, let's explain the terms involved in this step: Candidate segmentation refers to a temporary text block divided by any two candidate segmentation points that meet a preset length limit. Line height variation value refers to the vertical height difference between adjacent characters. Indentation jump value refers to the horizontal starting position difference between adjacent characters. Weighted penalty sum refers to the total penalty value obtained by adding the values ​​after assigning different weights to each difference value. Geometric consistency cost refers to an indicator that evaluates whether the text maintains continuity in physical layout. Preset field type mutation detection result refers to the system's judgment on whether there is an unreasonable jump between adjacent text field types. Preset field type jump refers to a field type change that does not conform to normal logic, including but not limited to jumping directly from the main text to an irrelevant heading. Preset first penalty score refers to a fixed penalty value set for semantic incoherence. Semantic coherence cost refers to an indicator that evaluates whether the text is logically and semantically smooth. Preset necessary prefix field refers to the starting identifier field that must be present to constitute a complete entry, including but not limited to serial numbers or specific nouns. Definition field refers to a text field that explains the prefix. The core field set validation result refers to the system's Boolean judgment on whether the current segment contains all necessary fields. The preset second penalty score is a fixed penalty value set for structural missing elements. The structural integrity cost is an indicator for evaluating the completeness of the text's information composition. The segmentation cost is the total evaluation value calculated by combining the above three dimensions. A directed acyclic graph (DAG) is a graph data structure where edges have directions and there are no cycles. The optimal segmentation path is the sequence of nodes with the minimum total cost from the global starting point to the global ending point in the graph. Since each directed edge on the path is connected end-to-end, a complete path represents a complete segmentation scheme that seamlessly covers the entire character sequence. The target segmentation boundary is the final determined precise location used to divide the text into independent entries. The preset first and second penalty scores are derived from empirical thresholds statistically derived from historical manually annotated data. The relationship between the two is that they are independent penalty bases; their relative magnitude determines which type of error the system tends to avoid when facing semantic breaks and structural missing elements. Furthermore, to ensure the robustness of the algorithm across different page sizes and font sizes, a scale normalization factor is introduced in this step. For potential zero-cost or anomalous optical character recognition results, a smoothing factor and an anomaly fallback strategy are also introduced. This step aims to find the globally optimal solution among numerous possible segmentation schemes. Relying solely on geometric distance or a single semantic element often leads to misjudgments. By comprehensively considering the consistency of visual typography, the logicality of contextual semantics, and the completeness of the item structure, and quantifying these factors as segmentation costs, the system can utilize a graph search algorithm to weigh the pros and cons from a global perspective, thereby accurately determining the segmentation boundaries and effectively solving the problems of segmentation truncation or adhesion in complex layouts.

[0100] The system can be implemented using a combination of array slicing and Dijkstra's algorithm. First, the system introduces a virtual start node representing the beginning of the character sequence and a virtual end node representing the end of the character sequence into the candidate segmentation point set. The system iterates through any two nodes i and j in this set (where node i precedes node j in the position sequence) and calculates the character span between the two nodes. When the character span meets the preset maximum and minimum entry length limits, the system determines that there is a valid directed edge between node i and node j. This directed edge specifically corresponds to a continuous character segment from node i to node j. The system then uses array slicing to extract this continuous character segment as a candidate segment. For each candidate segment, the system extracts its position sequence. To eliminate the absolute numerical differences caused by different page sizes and font sizes, the system calculates the midpoint of the line height of all characters in the current page image. Median of character width As a normalization benchmark, the system calculates the absolute value of the height difference between adjacent character bounding boxes. Difference from the horizontal axis and through the cost function Calculate the geometric consistency cost, where and These are preset geometric weight coefficients. The system extracts the field types corresponding to the candidate segments and loads a predefined two-dimensional field transition penalty matrix into memory. The rows and columns of this matrix represent the types of the preceding and following fields, respectively, and the matrix elements... Stored from field type Jump to field type The preset penalty score. The system iterates through adjacent fields within the candidate segment, and if a table lookup result is found... If the value exceeds a preset coherence threshold, it indicates the existence of a preset field type jump. The system directly assigns the value of this matrix element as the preset first penalty score to the semantic coherence cost. Based on the hierarchy, the system uses set intersection operations to verify whether candidate segments contain preset necessary prefix fields and definition fields. The system has established a rule for determining the violation of hierarchy: if a candidate segment contains a definition field marked as a child node, but lacks a parent node prefix field with which it has a hierarchical link, it is determined to be a missing core field. If the indication field is missing, a preset second penalty score is assigned to the structural integrity cost. In addition, if the system detects that a candidate segment contains abnormal optical character recognition results or missing fields with a confidence level lower than a preset threshold, the system will directly assign a preset maximum penalty value to the segment to block the segmentation path. The system uses a linear weighted formula to perform a weighted summation of the three factors to obtain the segment cost. If the calculated total cost is zero, the system automatically adds a very small positive smoothing factor. To reduce the non-uniqueness of the optimal path caused by multiple zero-cost paths and improve the numerical stability of the graph search process, the system instantiates a graph data structure in memory, constructing a directed acyclic graph (DAG) with candidate splitting points as nodes and segmentation costs as edge weights. In this DAG, any connected path from the virtual starting point to the virtual ending point consists of a series of directed edges connected end to end. This means that the ending point of the previous candidate segment is the starting point of the next candidate segment, thus forming a complete splitting scheme covering the entire graph. The system uses Dijkstra's algorithm to search for the optimal splitting path with the minimum total cost in the DAG and determines the nodes on this path as the target splitting boundary.

[0101] The system can also be implemented using a combination of sliding window and dynamic programming algorithms. The system sets the first and last characters of the character sequence as the starting state and the last character as the ending state. The system uses a sliding window of variable length to search for state transitions within the candidate segmentation point set. For the currently traversed candidate segmentation point j, the system backtracks to find historical candidate segmentation points i. When the distance between node i and node j is within the preset maximum and minimum entry length limits, the system extracts the character sequence between node i and node j as a candidate segment and establishes a state transition edge. For each candidate segment, the system extracts its position sequence, uses a variance function to calculate the fluctuation of the ordinate of the center point of adjacent characters as the line height change value, calculates the difference of the abscissa of the first character of the line as the indentation jump value, and calculates the weighted penalty sum of the two as the geometric consistency cost using a preset nonlinear penalty function. The system extracts the field type and uses a rule engine to match the preset field type mutation detection results. If a preset field type jump rule is matched, a preset first penalty score is output as the semantic coherence cost. Based on the hierarchical relationship, the system uses logical conditional statements to verify whether candidate segments contain preset necessary prefix fields and definition fields, generating a Boolean set of core field verification results. If false, a preset second penalty score is output as the structural integrity cost. The system uses a dynamic weight allocation algorithm to weightedly sum the three costs to obtain the segment cost. The system uses an adjacency matrix to construct a directed acyclic graph with candidate splitting points as nodes and segment costs as edge weights. The system uses a Viterbi dynamic programming algorithm to search for the optimal splitting path with the minimum total cost in the directed acyclic graph, and determines the candidate splitting points on the optimal splitting path as the target splitting boundary.

[0102] S107. Based on the target segmentation boundary, merge the character sequences and their corresponding field types and subordinate relationships to generate structured entry objects.

[0103] Structured entry objects refer to data entities that, after cleaning, organizing, and formatting, possess clear key-value pair relationships and hierarchical nesting structures. These include, but are not limited to, Extensible Markup Language (XML) files, Lightweight Data Interchange (LDLE) strings, or database record objects. Merging refers to the process of reassembling and piecing together fragmented character data according to logical relationships. This step is performed to complete the final transformation from unstructured image data to structured data. After the previous steps, the system has accurately identified the segmentation boundaries and recognized the attributes of all elements, but this information is still scattered in memory as arrays or variables. Through the merging operation, the system packages and encapsulates character sequences, field types, and dependencies belonging to the same entry together, generating standardized structured objects. This allows the extracted data to be directly stored by downstream database systems or accessed by other business applications, realizing the core value of data extraction.

[0104] The system utilizes dictionary construction and Extensible Markup Language (XML) serialization techniques. Based on the index position of the target segmentation boundary, the system uses a string truncation function to truncate the complete character sequence into multiple independent text blocks. For each text block, the system iterates through its internal character sequences, using the corresponding field type as the key and the specific character sequence as the value, constructing a multi-level nested dictionary data structure in memory based on hierarchical relationships. For example, fields belonging to parent nodes are used as keys in the outer dictionary, and fields belonging to child nodes are used as keys in the inner dictionary. After construction, the system calls a markup language generation library to serialize these nested dictionary data structures into an XML-compliant file, thereby generating structured entry objects.

[0105] The system can also utilize object-oriented instantiation and lightweight data exchange format conversion techniques. The system predefines entry data classes in the code that meet business requirements. These classes contain class attributes corresponding to different field types and object reference fields representing hierarchical relationships. The system traverses each segmented character sequence according to the target segmentation boundary, instantiating these entry data classes in memory. The system uses reflection or direct attribute assignment methods to populate the corresponding attributes of the data class instances with the content of the character sequences, and establishes a tree-like reference relationship between different data class instances based on hierarchical relationships. Finally, the system calls the serialization engine to convert these interconnected data class instances into lightweight data exchange format strings, generating structured entry objects.

[0106] In the above embodiments, layout analysis of page images is performed to obtain the layout area and reading order, and character sequences and position sequences are extracted. This information is then fused to construct multimodal features, enabling the system to simultaneously perceive the semantic content and physical layout structure of the text when processing the page. Based on this multimodal feature identification, field types and subordinate relationships are extracted, which can more accurately capture the logical connections under complex layouts compared to single text features. A candidate segmentation point set is generated by combining word boundary tags, narrowing the search space for segmentation boundaries. Furthermore, combining field type, subordinate relationships, and position sequences, the segmentation cost is calculated from three dimensions: geometric consistency, semantic coherence, and structural integrity. The continuity of visual layout, the smoothness of contextual semantics, and the completeness of the item structure are used as evaluation criteria. By minimizing this comprehensive segmentation cost to determine the target segmentation boundary, globally optimal segmentation decisions are achieved, reducing segmentation truncation or adhesion caused by misjudgment of a single feature. This improves the accuracy and information extraction quality of the final generated structured item objects, and enhances the usability for direct database entry.

[0107] In the above embodiments, the system can accurately segment pages and generate preliminary structured entry objects by multimodal feature fusion and segmentation cost minimization. However, in actual page structure extraction scenarios (such as complex typesetting documents like dictionaries, encyclopedias, or professional manuals), in order to save page space, specific abbreviations (such as "~" or "-") are often used to replace prefixes in the entry content. This leads to cross-field ambiguity and semantic gaps within the directly generated initial entry objects. Based on this, in order to eliminate the above-mentioned ambiguity and further improve the semantic integrity of the entry objects, this application proposes another page structure extraction and automatic segmentation method. It should be noted that the cross-field ambiguity resolution and semantic alignment scheme involved in this embodiment is strictly based on the segmentation boundaries, field types, and subordinate relationships determined in the above embodiments.

[0108] The following is combined with Figure 2 Another method for structured page extraction and automatic segmentation in the embodiments of this application is described below:

[0109] Please see Figure 2 This is another flowchart illustrating a page structure extraction and automatic segmentation method in an embodiment of this application.

[0110] S201. Based on the target segmentation boundary, perform preliminary merging of the character sequences and their corresponding field types and subordinate relationships to obtain the initial entry objects;

[0111] The initial entry object refers to the data entity formed after assembling and splicing scattered character fragments according to logical relationships based on segmentation boundaries. It may still contain unprocessed abbreviations, including but not limited to a pre-constructed lightweight data exchange format object or a draft database record. This step is performed to establish a basic hierarchical data carrier before performing refined semantic disambiguation. Although the preceding processes have determined the physical and logical boundaries of each text block, these text blocks often retain special typesetting symbols used in the original document to save space. Through the initial merging operation, the system encapsulates elements belonging to the same logical unit together, allowing subsequent detection and replacement operations to be deployed within a closed and context-complete structure. This provides a structured operational basis for cross-field abbreviation resolution.

[0112] The system utilizes dictionary mapping and Lightweight Data Interchange (LDTI) serialization technology. Based on the position index of the target segmentation boundary, the system divides continuous character sequences into text blocks belonging to different logical paragraphs. For each text block, the system extracts its corresponding field type as the dictionary key, uses the specific character sequence as the dictionary value, and merges dictionaries at the same level according to their hierarchical relationships, nesting sub-level dictionaries within their parent level dictionaries to construct a multi-level nested dictionary mapping structure in memory. After mapping, the system calls the built-in serialization module to directly convert the dictionary mapping structure into a standard Lightweight Data Interchange (LDTI) string, which is then output as the initial entry object and stored in the system's temporary cache, awaiting subsequent traversal and inspection.

[0113] The system can also utilize object-oriented instantiation and Extensible Markup Language (XML) generation techniques. The system pre-defines entry data classes in the codebase that match business requirements. These data classes contain string attributes for storing text of different field types, and list or pointer attributes for expressing hierarchical relationships. The system iterates through all character sequences within the target segmentation boundary, dynamically instantiating these entry data classes in memory, and filling the corresponding class attributes with character sequences through attribute assignment operations. Subsequently, the system establishes parent-child reference links between different instance objects based on hierarchical relationships, forming a complete object tree. Finally, the system calls the markup language generation engine to traverse this object tree, transforming it into an XML document tree structure with hierarchical tags, generating the initial entry objects.

[0114] S202. Traverse the structured initial entry object and detect the preset abbreviation contained in the character sequence corresponding to the target field type in the initial entry object.

[0115] The target field type refers to a specific category within an entry where omissions of reference are highly likely to occur in specific business semantic tags. This includes, but is not limited to, example sentence fields, collocation fields, or extended definition fields. Preset reference abbreviations are specific symbols used by document authors to save typesetting space, replacing words already mentioned in the text. These include, but are not limited to, tildes, hyphens, or long dashes. This step is performed to accurately locate semantically missing positions within an entry. In complex typesetting documents, not all special symbols represent omissions of reference; for example, a hyphen in ordinary text may simply be punctuation connecting compound words. By limiting the traversal to the target field type and specifically detecting preset reference abbreviations, the system can effectively filter out interference from irrelevant symbols, avoid misjudgments, and identify all anchor points requiring cross-field disambiguation and semantic restoration.

[0116] The system can be implemented using a combination of depth-first search and regular expression matching. The system uses the initial entry object as the root node and recursively traverses all its internal nodes using a depth-first search algorithm. When accessing each node, the system first reads the node's field type attribute and compares it with a pre-configured list of target field types. If a match is found, the system extracts the character sequence corresponding to that node and calls the regular expression engine. The system pre-writes a regular expression pattern string containing all preset abbreviations and uses this pattern string to perform a global scan of the extracted character sequence. When the regular expression engine returns the start and end indices of a successful match, the system records the specific position of the preset abbreviation in the character sequence and its associated node information.

[0117] The system can also be implemented by combining path expression lookup with a multi-pattern string matching algorithm. The system parses the initial entry object into a standard document object model (DOM) tree. Using a pre-written path expression, the system directly filters the DOM tree to find a set of target nodes whose attribute tags match the target field type. For each target node in this set, the system obtains its internal character sequence text. Subsequently, the system uses an automaton-based multi-pattern string matching algorithm, such as the Aho-Kolasik algorithm, to construct a state transition trie using all preset abbreviations. The system inputs the character sequence text into this trie for linear scanning; once the state machine reaches the accept state, it determines that a preset abbreviation has been detected and outputs the corresponding matching position.

[0118] S203. In response to the detection of a preset abbreviation, extract the adjacent context features of the preset abbreviation in the character sequence;

[0119] Adjacent context features refer to the linguistic and positional attributes of the text closely surrounding a predefined abbreviation, including but not limited to adjacent characters, part-of-speech tagging sequences, or grammatical dependencies. This step is performed to collect the necessary environmental cues for inferring lexical inflection rules. In the typographical conventions of many languages, abbreviations not only represent basic vocabulary but also implicitly contain morphological changes of that vocabulary in the current context, such as plural form, past tense, or progressive tense. Simply replacing the abbreviation with the original word often results in serious grammatical errors in the generated sentence. By extracting adjacent context features, the system can fully perceive the specific grammatical environment of the abbreviation, providing reliable data input for subsequent accurate determination of lexical inflection rules.

[0120] The system can be implemented using a character truncation and feature concatenation method based on a fixed sliding window. The system obtains the absolute position index of the preset abbreviation within the character sequence. Using this position index as the center, the system sets fixed-length sliding windows to the left and right, for example, truncating three characters to the left as the prefix context and three characters to the right as the suffix context. The system extracts these substrings falling within the sliding windows and removes whitespace and irrelevant punctuation. Next, the system concatenates the prefix context, the type identifier of the preset abbreviation itself, and the suffix context according to strict spatial relative positions, forming a structured context feature vector. This vector serves as the extracted adjacent context features and is stored in memory for subsequent retrieval.

[0121] The system can also employ part-of-speech tagging and dependency parsing based on natural language processing. The system extracts a complete character sequence containing preset abbreviations and inputs it into a pre-loaded natural language processing pipeline. First, the system processes the character sequence using a word segmentation and part-of-speech tagging model to obtain the part-of-speech tag for each word, treating the preset abbreviation as an independent placeholder node. Then, the system uses a dependency parser to construct a syntactic dependency tree for the character sequence. Within the dependency tree, the system locates the placeholder nodes and extracts the lexical content, part-of-speech tags, and dependency relationship types of their parent and child nodes. The system then packages this extracted syntactic structure information and the part-of-speech sequence into a feature dictionary, which serves as the final extracted adjacent context features.

[0122] S204. Extract the base character sequence corresponding to the prefix field from the same initial entry object containing the preset abbreviation;

[0123] The prefix field refers to the core text category that holds a central and dominant position in the entire entry structure, and is explained or described, including but not limited to the entry name in a dictionary or the main title in an encyclopedia. The base character sequence refers to the original core text string without any syntactic transformations; it forms the foundation for subsequent lexical transformations. This step is performed to obtain the actual text source pointed to by the abbreviation. The abbreviation is essentially a logical pointer, its purpose being to refer back to the core vocabulary of the current entry. Since there are a large number of entries in the document, extraction must be strictly limited to the same initial entry object. This ensures that the extracted base character sequence and the current abbreviation belong to the same logical context, preventing semantic misattribution caused by cross-entry extraction and guaranteeing the accuracy of abbreviation resolution.

[0124] The system can be implemented using key-value pair retrieval and memory references. When processing a node containing a preset abbreviation, the system obtains the memory pointer to the initial entry object to which that node belongs. The system uses this memory pointer to access the dictionary mapping structure within the initial entry object. Using a predefined prefix field identifier as the search key, the system calls the dictionary data structure's built-in lookup function to perform an exact match on the top-level key-value pairs of the current initial entry object. Once a match is found, the system directly reads the value corresponding to that key, extracting the unmodified raw text string, and caches it as a base character sequence in the local variable of the current processing thread.

[0125] The system can also achieve this through upward tracing of the object tree and attribute reading. After locating the bottom-level leaf node containing the preset abbreviation, the system uses the parent node reference pointers maintained in the object tree structure to trace upwards layer by layer along the hierarchical relationship until it reaches the root node of the current initial entry object. At the root node level, the system traverses all its direct child nodes and checks the type attribute of each child node. When the system identifies a specific child node whose type attribute is marked as a prefix field, the system calls the text reading interface of that child node to obtain the string data stored inside, removes leading and trailing whitespace characters, and extracts it as the base character sequence for subsequent transformation processing.

[0126] S205. Determine lexical transformation rules for the baseline character sequence based on adjacent context features;

[0127] Lexical conjugation rules refer to the character modification logic that must be executed to integrate basic vocabulary into a specific grammatical context. These rules include, but are not limited to, plural addition rules, tense conjugation rules, and affix derivation rules. This step establishes a transformation mapping from the original form to the target form. The base character sequence is usually in its original state, while the location of abbreviations often requires a specific grammatical form. By analyzing the extracted adjacent context features, the system can infer the implicit grammatical requirements at that location. For example, if the context features indicate that an abbreviation is immediately followed by a specific vowel suffix, special spelling changes may be required. Dynamically determining this rule ensures that the final reconstructed text fully conforms to the target language's grammar and spelling, eliminating grammatical inconsistencies caused by abrupt substitutions.

[0128] The system can be implemented using an expert rule engine based on a decision tree. The system pre-constructs a decision tree model containing various linguistic morphological rules in a knowledge base. The system uses extracted adjacent context features as input feature vectors and performs layer-by-layer conditional judgments starting from the root node of the decision tree. For example, the system first determines whether the suffix context contains a specific verb tense marker, then determines whether the prefix context contains a specific preposition or article. As the judgment progresses, the system traverses downwards along specific branches of the decision tree, eventually reaching the corresponding leaf node. This leaf node stores the specific processing instruction set for a successful match, and the system extracts this instruction set as lexical transformation rules for the baseline character sequence.

[0129] The system can also employ a classification prediction model based on support vector machines. The underlying structure of this model is a support vector machine network based on radial basis function kernels. The training set is a corpus with a large amount of manually annotated contextual features and corresponding transformation rule categories, and the test set is an independent validation corpus. The model's input data consists of numerical vectors of adjacent contextual features encoded using a bag-of-words model, and the output data is the category probability distribution in a predefined set of lexical transformation rules. The system vectorizes the currently extracted adjacent contextual features and inputs them into the model. The model calculates the geometric distance between the input vector and each hyperplane, outputting the predicted probability of each transformation rule category. The system selects the category with the highest predicted probability and determines its corresponding specific operation logic as the lexical transformation rule for the baseline character sequence.

[0130] S206. Input the baseline character sequence into the lexical transformation rules for conversion, and generate a complete pronoun that matches the features of the adjacent context.

[0131] The system inputs a baseline character sequence into lexical transformation rules for conversion, generating a complete vocabulary that matches the features of the adjacent context. Specifically, this includes: extracting the truncation length and target concatenation suffix contained in the lexical transformation rules; performing a truncation operation on the last character of the baseline character sequence according to the truncation length to obtain an initial truncated sequence; if the syllable change markers in the lexical transformation rules determine that the junction of the initial truncated sequence and the target concatenation suffix meets the preset consonant double writing condition, copying the last character of the initial truncated sequence to perform double writing compensation on the initial truncated sequence to obtain the target truncated sequence; if the preset consonant double writing condition is not met, the initial truncated sequence is used as the target truncated sequence; and the target concatenation suffix is ​​concatenated to the end of the compensated initial truncated sequence to generate a complete vocabulary that matches the features of the adjacent context.

[0132] A complete referential word refers to the final text string that, after morphological processing, can perfectly integrate into the current context. The truncation length refers to the number of characters that need to be stripped from the end of the base word. The target concatenation suffix refers to the specific letter combination that needs to be appended to the end of the word. The initial truncation sequence refers to the intermediate transition string obtained after stripping the last character. Syllable change markers refer to the marking information in the rules used to indicate whether special spelling adjustments are needed. The preset consonant doubling condition refers to the triggering premise set based on linguistic rules, which requires the repetition of the final consonant letter before appending the suffix. Doubling compensation refers to the actual process of copying the final letter. The target truncation sequence refers to the ready string used for concatenating the suffix after conditional judgment and potential compensation operations. This step is performed to accurately complete the string-level morphological reconstruction. In real language environments, word inflection is often accompanied by the removal or repetition of the final letter, such as removing silent letters or doubling the final consonant of stressed closed syllables. By strictly following a standardized process of truncation, conditional judgment, double-writing compensation, and suffix concatenation, the system can transform abstract transformation rules into concrete string operations, generating complete pronouns that fully conform to spelling standards and eliminating spelling errors caused by simple concatenation.

[0133] The system can be implemented using string slicing and conditional branching. The system parses the determined lexical transformation rules, reading the integer truncation length and the target concatenation suffix. Using string slicing, the system removes the last character of the baseline character sequence according to the truncation length, obtaining an initial truncated sequence. Next, based on the syllable change indicators in the lexical transformation rules, the system uses conditional branching statements to determine whether the junction of the initial truncated sequence and the target concatenation suffix satisfies a preset consonant doubling condition. If the condition is met, the system copies the last character of the initial truncated sequence and appends it to the end to compensate for the double consonant doubling, obtaining the target truncated sequence. If the condition is not met, the system directly uses the initial truncated sequence as the target truncated sequence. Finally, the system directly concatenates the target concatenation suffix to the end of the compensated target truncated sequence, generating a complete pronoun that matches the features of the adjacent context.

[0134] The system can also be implemented using character array operations and pattern matching functions. The system parses lexical transformation rules into a set of operation instructions, extracting the numerical truncation length and the target concatenation suffix in character form. The system converts the baseline character sequence into a dynamic character array. By repeatedly calling the array's pop function, a specified number of elements are removed from the end according to the truncation length, performing a removal operation on the last character of the baseline character sequence to obtain a character array representing the initial truncation sequence. Subsequently, based on syllable change indicators, the system calls a preset pattern matching function to determine if the junction of the initial truncation sequence and the target concatenation suffix satisfies a preset consonant double-writing condition. In this case, the system copies the last element of the array and pushes it to the end of the array, performing double-writing compensation on the initial truncation sequence, and uses the compensated character array as the target truncation array; if the condition is not met, the character array representing the initial truncation sequence is directly used as the target truncation array. Finally, the system converts the target concatenation suffix into a character array and concatenates it to the end of the compensated target truncation sequence, then converts the merged character array back into a string, generating a complete pronoun that matches the features of the adjacent context.

[0135] S207. Replace the preset abbreviations and adjacent characters in the character sequence corresponding to the target field type with complete reference words to eliminate cross-field reference ambiguity within the initial entry object and generate a semantically aligned structured entry object.

[0136] The final structured entry object refers to a data entity whose internal referential ambiguity has been eliminated, whose semantics are completely coherent, and whose structure is complete, including but not limited to cleaned database records or finalized lightweight data exchange format files. Adjacent characters refer to lexical suffixes or prefixes that immediately follow or precede the preset referential abbreviation in the actual context (e.g., "ing" or "ed" in "~ing" or "~ed"). The preset referential abbreviation and its adjacent characters together constitute the character fragment to be replaced. This step is performed to complete the final data loop of the referential resolution process. Although the preceding steps have successfully generated complete vocabulary that conforms to the context, these words only exist in the system's temporary memory. Only by accurately backfilling these complete words into the original document structure, replacing those special symbols and their accompanying variant suffixes that disrupt semantic coherence, can the semantic gaps in the entry content be truly repaired. By updating the initial entry object, this outputs high-quality structured data that can be directly called by downstream search engines or knowledge graphs, achieving the final goal of page structured extraction.

[0137] The system can be implemented using built-in string replacement functions and attribute overriding. The system obtains the start and end indices of a preset abbreviation and its adjacent characters in the original character sequence, identifying the segment consisting of the preset abbreviation and its adjacent lexical suffix as the character segment to be replaced. The system calls the built-in string replacement function of the programming language, replacing the character segment in the character sequence with the complete pronoun, thereby generating a new, semantically coherent character sequence. Subsequently, the system accesses the corresponding field attributes in the initial entry object through a memory pointer, using an overriding operation to replace the old character sequence with this new character sequence, updating the initial entry object. After all detected character segments to be replaced have been replaced, the system marks the updated initial entry object as the final structured entry object and outputs it.

[0138] The system can also be implemented using a document object model (DOM) node update and reserialization approach. When traversing the DOM tree constructed from the initial entry object, the system retains references to the text leaf nodes containing the preset abbreviations and adjacent characters, treating these abbreviations and adjacent characters as a single character segment to be replaced. The system creates a new text node containing the complete abbreviation. The system calls the DOM tree's node replacement interface, replacing the old node containing the character segment in the character sequence with the new text node containing the complete abbreviation, thus updating the initial entry object and completing semantic repair at the tree structure level. After all relevant nodes in the entire DOM tree have been updated, the system calls the serialization engine to convert the updated DOM tree back into a standard lightweight data exchange format file, generating the final structured entry object for persistent storage.

[0139] In the above embodiments, by traversing the initial entry objects obtained through preliminary merging, detecting the preset referential abbreviations contained in the target field types, and extracting the adjacent context features of the abbreviations in the character sequence, the specific linguistic environment in which the abbreviations are located can be accurately captured. A baseline character sequence corresponding to the prefix field is extracted from the same initial entry object, and lexical transformation rules for the baseline character sequence are determined based on the aforementioned adjacent context features, enabling the system to dynamically adjust the lexical form according to specific contexts. The baseline character sequence is input into the rules for transformation, generating a complete referential vocabulary that perfectly matches the adjacent context features. Finally, the preset referential abbreviations and adjacent characters in the target field types are replaced with this complete referential vocabulary, eliminating cross-field referential ambiguity caused by the use of abbreviations within the initial entry objects, reducing the risk of semantic gaps in text reading and machine understanding, and thus improving the semantic alignment and overall logical coherence of the final generated structured entry objects.

[0140] Through the processing described in the above embodiments, the system successfully replaced the preset abbreviations with morphologically matched complete abbreviations, eliminating semantic ambiguity within the item objects and achieving logical coherence at the pure text level. However, in practical applications, the prefixes or abbreviations in the original page images often have specific visual typography attributes (such as bold, italics, specific fonts or font sizes, etc.) to serve as visual emphasis and hierarchical distinctions. The simple character text replacement operation in the above embodiments inevitably leads to the loss of these important original visual typography information. In order to achieve semantic alignment while preserving the original document's layout intent to the greatest extent, so that the final generated structured item objects are not only semantically complete but also have high visual fidelity, another method for page structure extraction and automatic segmentation is further proposed.

[0141] The following is combined with Figure 3This application describes yet another method for extracting and automatically segmenting page structures in an embodiment:

[0142] Please see Figure 3 This is another flowchart illustrating a page structure extraction and automatic segmentation method in the embodiments of this application.

[0143] S301. From the multimodal features, backtrack and extract the first visual layout features corresponding to the baseline character sequence in the page image, as well as the second visual layout features corresponding to the preset abbreviation and adjacent characters in the page image.

[0144] The first visual typographic feature refers to the set of visual style attributes of the initial text in the original page image, including but not limited to font type, font size, bold status, or italic markings. Adjacent characters refer to text elements that are spatially or logically adjacent to the predefined abbreviation. The second visual typographic feature refers to the set of visual style attributes of the abbreviation and its surrounding text in the original page image, including but not limited to specific color coding, underline styles, or highlighted backgrounds. This step is performed to recover lost physical typographic information based on semantic restoration. In document typesetting, authors often use different fonts or font sizes to distinguish word roots and suffixes, or to emphasize specific grammatical variations. If only plain text is replaced, these typographic intentions with important hierarchical indications and visual emphasis will be completely lost. By tracing back through multimodal features, the system can accurately locate the visual form of the original characters in the image, extracting visual features representing the main body and visual features representing the deformed parts, thus providing accurate style data support for subsequent refined rich text rendering.

[0145] The system can be implemented using an index mapping and feature slicing approach. First, the system obtains the absolute position indices of the baseline character sequence and preset abbreviations within the initial text content. Since the multimodal features retain the strict alignment between the character sequence and visual features during construction, the system uses these absolute position indices as query keys to directly address the joint vector matrix of the multimodal features. The system then uses array slicing to extract a subset of feature vectors corresponding to the baseline character sequence, and parses out style parameters such as font and size, encapsulating them as the first visual typography feature. Similarly, the system uses preset abbreviations and the position indices of adjacent characters to extract the corresponding feature vector subsets from the joint vector matrix, parses out the corresponding style parameters, and encapsulates them as the second visual typography feature.

[0146] The system can also be implemented using a large multimodal alignment model. The underlying structure of this model is a two-stream Transformer network incorporating a cross-modal attention mechanism. The training set is a document image dataset containing rich typographic styles and fine-grained visual feature alignment annotations, while the test set is an independently validated dataset with the same distribution. The model's input data consists of semantic vectors and local image features from the multimodal features, and the output data is the character-level visual typographic attribute classification results. The system inputs the semantic vector of a baseline character sequence as the query condition to the model. The model back-projects this vector onto the local image features through cross-modal attention weights, outputting the corresponding typographic attributes as the first visual typographic feature. Next, the system inputs the semantic vectors of preset abbreviations and adjacent characters into the model. The model again back-projects this vector and outputs the corresponding typographic attributes as the second visual typographic feature.

[0147] S302. Based on lexical inflection rules, complete referential words are divided into root segments and derived suffix segments;

[0148] Based on lexical inflection rules, the system divides complete referential words into root segments and derived suffix segments. Specifically, this includes: determining the number of unmutated characters in the baseline character sequence that did not undergo character substitution or deletion during morphological transformation based on lexical inflection rules; determining the morphological truncation index for segmenting root segments and derived suffix segments in the character sequence of the complete referential words based on the number of unmutated characters; extracting the character sequence from the starting position to the morphological truncation index from the complete referential words according to the morphological truncation index to obtain the root segment; and extracting the character sequence from the morphological truncation index to the end position from the complete referential words to obtain the derived suffix segment.

[0149] Root fragments refer to the character sequences in a complete vocabulary that retain the core semantic meaning of the original prefix without spelling variations. Derived suffix fragments refer to the character sequences in a complete vocabulary that have been added or spelled differently to adapt to a specific grammatical context. The number of unvariated characters refers to the number of characters in the base character sequence that remain unchanged before and after morphological transformation, without being removed or modified. The morphological truncation index refers to the integer positional coordinates in the character sequence of a complete vocabulary used to clearly define the boundaries between the root and suffix. This step is performed to structurally decompose a complete word so that different visual styles can be assigned to each. In complex typography, the root of a word may use a regular font, while its derived suffix fragments may use italics for emphasis. Without precise morphological segmentation, it is impossible to correctly align the first and second visual typographic features extracted backtracking to the corresponding characters. By calculating the number of unvariated characters and determining the morphological truncation index, the system can accurately separate the root and suffix at the character level, providing accurate text anchors for subsequent style mapping.

[0150] The system can be implemented using rule parsing and string truncation functions. The system parses the lexical inflection rules and extracts the truncation length defined in the rules. The system calculates the total length of the base character sequence and subtracts the truncation length from the total length to obtain the number of unmutated characters in the base character sequence that did not undergo character substitution or deletion during morphological transformation. The system directly uses this number of unmutated characters as the morphological truncation index for segmenting root segments and derived suffix segments in the character sequence of the complete pronoun. Subsequently, the system calls the string truncation function to extract the character sequence from the start position to the morphological truncation index from the complete pronoun, obtaining the root segment. Then, the system calls the string truncation function again to extract the character sequence from the morphological truncation index to the end position from the complete pronoun, obtaining the derived suffix segment.

[0151] The system can also be implemented using character array comparison and pointer slicing. The system converts the base character sequence and the complete pronoun into dynamic character arrays. The system uses two pointers to compare elements in the two character arrays from left to right. When the first mismatched character is encountered or the end of the base character sequence is reached, the system stops comparing and counts the number of successfully matched characters, which is taken as the number of unmutated characters. The system uses this number of unmutated characters to determine the morphological truncation index for segmenting root fragments and derived suffix fragments. Using array slicing instructions, the system slices the elements from the start position to the morphological truncation index from the character array corresponding to the complete pronoun, and converts these elements into strings to obtain the root fragment. Finally, the system slices the elements from the morphological truncation index to the end position, converts them into strings for extraction, and obtains the derived suffix fragments.

[0152] S303. Map the first visual typography features to the root word segments in the entry object, and map the second visual typography features to the derived suffix segments in the entry object;

[0153] An entry object refers to a structured data unit that has completed logical organization and is undergoing visual style reconstruction in the current processing flow, including but not limited to entry instances in memory or specific data dictionaries. Mapping refers to the binding operation that establishes a mandatory association between abstract visual style attributes and specific text fragments. This step is performed to achieve deep integration of text content and visual style at the data structure level. The preceding steps have prepared the split text fragments and their corresponding visual features, but they remain independent variables in the system. Through the mapping operation, the system precisely binds the first visual typography feature representing the main style to the root fragment, and the second visual typography feature representing the variant style to the derived suffix fragment. This ensures that each text fragment carries its original typography genes, laying the data foundation for the subsequent generation of high-fidelity rich text objects.

[0154] The system can be implemented using a dictionary-based key-value pair binding approach. Within the memory space of the entry object, the system creates a nested dictionary data structure for the currently processed pronoun. The system uses the root word fragment as a subkey in the dictionary and encapsulates the first visual typographic feature as an attribute dictionary as the value corresponding to this subkey, thus mapping the first visual typographic feature to the root word fragment in the entry object. Simultaneously, the system uses the derived suffix fragment as another subkey in the dictionary and encapsulates the second visual typographic feature as another attribute dictionary as the value corresponding to this subkey, thus mapping the second visual typographic feature to the derived suffix fragment in the entry object. After binding is complete, the system stores this nested dictionary in a specific field of the entry object.

[0155] The system can also be implemented using an object-oriented attribute assignment approach. The system predefines a text fragment data class containing text content attributes and style feature attributes. The system instantiates two objects of this data class within the entry object, corresponding to the root word and suffix, respectively. For the first instance, the system calls its attribute assignment interface, assigning the root word fragment to the text content attribute and the first visual layout feature to the style feature attribute, thus mapping the first visual layout feature to the root word fragment in the entry object. For the second instance, the system similarly calls the attribute assignment interface, assigning the derived suffix fragment to the text content attribute and the second visual layout feature to the style feature attribute, thus mapping the second visual layout feature to the derived suffix fragment in the entry object. The system then stores these two instance objects in a list of entry objects.

[0156] S304. Based on the mapped first visual typography features and second visual typography features, render the complete pronoun as a rich text object.

[0157] A rich text object is a composite data structure that not only contains plain text characters but also embeds rich typography style instructions such as font, color, and font size. This includes, but is not limited to, Hypertext Markup Language strings, Extensible Markup Language node trees, or rich text format documents. Rendering refers to the process of generating a standard rich text format by combining plain text with style features according to specific syntax rules. This step is performed to convert the style data bound in memory into a standardized format that can be recognized and displayed by external systems. Plain text strings cannot display visual effects such as bold or italics on the screen. By concatenating and tagging root fragments and derived suffix fragments mapped with different visual typography features according to standard specifications, the system can generate a seamless rich text object with rich styles. This allows the extracted data to perfectly reproduce the visual hierarchy of the original document when called by the front-end page or typesetting software.

[0158] The system can be implemented using Hypertext Markup Language (HML) tag concatenation. The system parses the first visual typography features mapped to the root word fragment, extracting attributes such as font, size, and bold, and uses string formatting functions to generate corresponding HML inline style tags, wrapping the root word fragment within these tags. Next, the system parses the second visual typography features mapped to the derived suffix fragment, extracting its corresponding style attributes, similarly generating inline style tags, and wrapping the derived suffix fragment within them. The system then uses string concatenation operations to seamlessly connect the wrapped root word fragment and the wrapped derived suffix fragment sequentially, generating a complete HML string. This complete referential word is rendered as a rich text object and stored in the system's memory cache.

[0159] The system can also be implemented using an abstract syntax tree (AST) based construction and serialization. The system calls a rich text processing library to initialize an empty AST in memory. Based on the first visual typographic feature, the system creates a text node with style attributes and inserts the root word fragment as the node's value into the AST. Subsequently, based on the second visual typographic feature, the system creates another text node with style attributes and inserts it as a sibling node into the AST, using the derived suffix fragment as its value. The system then calls the rich text processing library's serialization engine to traverse the AST, converting it into a document object conforming to a lightweight rich text exchange format. Based on the mapped first and second visual typographic features, the system renders the complete pronoun as a rich text object.

[0160] S305. Update the rich text object to the entry object.

[0161] The update process refers to the overwrite operation of replacing existing simple data or placeholders with newly generated high-fidelity composite data. This step is performed to complete the final data assembly of the page structure extraction process. Although the rich text object generated in the previous steps already possesses complete semantics and visual style, it is still detached from the overall item structure. Only by accurately backfilling this rich text object into the corresponding field positions in the item object, replacing the original plain text or abbreviations that lacked formatting information, can a complete structured entity that contains both a rigorous logical hierarchy and rich visual expression be constructed. This ensures that the data ultimately output by the system can directly meet the business needs of high-quality electronic publishing or high-fidelity knowledge base construction.

[0162] The system can be implemented using object attribute overwriting. The system obtains a memory reference pointer to the currently processed entry object. Using this pointer, the system locates the attribute variable within the entry object specifically used to store the target field's content. The system calls the assignment operator, directly assigning the rich text object generated in memory to this attribute variable, thereby overwriting the original stored plain text character sequence or old data with preset abbreviations. After the overwriting is complete, the system triggers a state update flag within the entry object, updating the entry object with the rich text object and pushing it into the system's output queue to await subsequent persistent storage.

[0163] The system can also be implemented using a document object model (DOM) node replacement approach. The system parses the entry object into a DOM tree structure residing in memory. Using pre-recorded unique node identifiers, the system retrieves the old text node that originally stored the preset abbreviation in the DOM tree. The system then calls the DOM tree's node replacement application programming interface (API), treating the generated rich text object as a completely new composite node, and directly replacing the retrieved old text node. After the replacement is complete, the system re-validates and serializes the entire DOM tree, thereby updating the entry object with the rich text object and generating a final structured output file with high-fidelity typesetting information.

[0164] In the above embodiments, by backtracking and extracting the first visual typography features of the baseline character sequence and the second visual typography features of the preset referential abbreviations and adjacent characters from multimodal features, and accurately dividing the generated complete referential vocabulary into root fragments and derived suffix fragments based on lexical transformation rules, the first visual typography features are mapped to the root fragments, and the second visual typography features are mapped to the derived suffix fragments. This process performs fine-grained alignment of the font, font size, and other visual typography attributes of different text parts in the original page image with the morphologically restored vocabulary fragments, and accordingly renders the complete referential vocabulary as a rich text object and updates it to the entry object. This allows the restored referential vocabulary to inherit the complex typographic emphasis intentions in the original document, thereby improving the visual fidelity and typographic information richness of the structured entry object and reducing the probability of losing the original typographic semantics during text normalization.

[0165] The system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 4 This is a schematic diagram of the physical device structure of a page structure extraction and automatic segmentation system provided in an embodiment of this application.

[0166] It should be noted that, Figure 4 The structure of the system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0167] like Figure 4 As shown, the system includes a Central Processing Unit (CPU) 401, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on a program stored in Read-Only Memory (ROM) 402 or a program loaded from storage portion 408 into Random Access Memory (RAM) 403. The RAM 403 also stores various programs and data required for system operation. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus 404. An Input / Output (I / O) interface 405 is also connected to the bus 404.

[0168] The following components are connected to I / O interface 405: input section 406 including a camera, infrared sensor, etc.; output section 407 including a liquid crystal display (LCD) and speakers, etc.; storage section 408 including a hard disk, etc.; and communication section 409 including a network interface card such as a LAN (Local Area Network) card and a modem, etc. Communication section 409 performs communication processing via a network such as the Internet. Drive 410 is also connected to I / O interface 405 as needed. Removable media 411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 410 as needed so that computer programs read from them can be installed into storage section 408 as needed.

[0169] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 409, and / or installed from removable medium 411. When the computer program is executed by central processing unit (CPU) 401, it performs the various functions defined in the present invention.

[0170] It should be noted that the computer-readable medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. The transmitted data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof.

[0171] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0172] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the system described in the above embodiments; or it may exist independently and not assembled into the system. The storage medium carries one or more computer programs that, when executed by a processor of a system, cause the system to implement the methods provided in the above embodiments.

[0173] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0174] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0175] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0176] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for structured extraction and automatic segmentation of pages, characterized in that, include: The page image to be processed is analyzed to obtain multiple page areas and the reading order between the page areas; Extract the character sequence and the corresponding position sequence within the page area, and determine the word boundary label for each character in the character sequence; Multimodal features are constructed by integrating the page layout area, the reading order, the character sequence, and the position sequence; Based on the multimodal features, the field type corresponding to the character sequence is identified, and the subordinate relationship between different field types is extracted; A candidate segmentation point set is generated based on the word boundary labels; Based on the candidate segmentation point set, combined with the field type, the subordinate relationship, and the position sequence, the segmentation cost is calculated from the dimensions of geometric consistency, semantic coherence, and structural integrity, respectively, and the target segmentation boundary is determined by minimizing the segmentation cost. Based on the target segmentation boundary, the character sequence and its corresponding field type and the subordinate relationship are merged to generate a structured entry object.

2. The method according to claim 1, characterized in that, The step of extracting the character sequence and the corresponding position sequence within the page area, and determining the word boundary label for each character in the character sequence, specifically includes: Text line detection is performed on the page area to obtain multiple initial text boxes within the page area; The initial text box is input into a pre-trained optical character recognition network, which outputs the initial text content within the initial text box and the geometric coordinates corresponding to the initial text content. The initial text content is segmented into characters according to a preset single-character segmentation rule to obtain a character sequence, and the geometric coordinates are mapped to the character sequence to obtain the position sequence corresponding to the character sequence. Extract the local image features corresponding to the initial text box, and concatenate the local image features with the character sequence to obtain character visual fusion features. The local image features represent the visual information of the font size and font thickness of the character sequence in the page image. The visual fusion features of the characters are input into a preset sequence labeling model, and the classification probability of each character in the character sequence belonging to the beginning of a word, the middle of a word, the end of a word, or an independent word is output. The word boundary label of each character in the character sequence is determined based on the classification probability.

3. The method according to claim 1, characterized in that, Based on the candidate segmentation point set, and in conjunction with the field type, the dependency relationship, and the position sequence, the segmentation cost is calculated from the dimensions of geometric consistency, semantic coherence, and structural integrity, respectively. The target segmentation boundary is determined by minimizing the segmentation cost. Specifically, this includes: Based on the set of candidate segmentation points, the character sequence is divided into multiple candidate segments; For each candidate segment, extract the position sequence of the character sequence within the candidate segment; Calculate the line height change value and indentation jump value between adjacent characters in the candidate segment, and use the weighted penalty sum of the line height change value and the indentation jump value as the geometric consistency cost; Extract the field types corresponding to the character sequences within the candidate segments; If the detection result of the preset field type mutation in the candidate segment indicates that there is a preset field type jump, the preset first penalty score will be used as the semantic coherence cost. Based on the subordinate relationship, it is verified whether the character sequence in the candidate segment contains a preset necessary prefix field and definition field, and the core field set verification result indicating the missing field status is obtained. If the core field set verification result indicates the missing field, a preset second penalty score is used as the structural integrity cost. The segmentation cost of the candidate segment is obtained by weighted summation of the geometric consistency cost, the semantic coherence cost, and the structural integrity cost. Construct a directed acyclic graph with the candidate splitting points as nodes and the segmentation cost as edge weights; The optimal splitting path with the minimum total cost is searched in the directed acyclic graph, and the candidate splitting points on the optimal splitting path are determined as the target splitting boundary.

4. The method according to claim 1, characterized in that, The step of merging the character sequence and its corresponding field type with the subordinate relationship according to the target segmentation boundary to generate a structured entry object specifically includes: Based on the target segmentation boundary, the character sequence and its corresponding field type and the subordinate relationship are initially merged to obtain an initial entry object; Traverse the initial entry object and detect the preset abbreviation contained in the character sequence corresponding to the target field type in the initial entry object; In response to the detection of the preset abbreviation, the adjacent context features of the preset abbreviation in the character sequence are extracted; Extract the base character sequence corresponding to the prefix field from the same initial entry object containing the preset abbreviation; Based on the adjacent context features, lexical transformation rules for the baseline character sequence are determined; The baseline character sequence is input into the lexical transformation rules for conversion, generating a complete pronoun that matches the adjacent context features; The preset abbreviation and adjacent characters in the character sequence corresponding to the target field type are replaced with the complete referential words to eliminate cross-field referential ambiguity within the initial entry object and generate a semantically aligned structured entry object.

5. The method according to claim 4, characterized in that, The step of inputting the baseline character sequence into the lexical transformation rules for conversion to generate a complete pronoun vocabulary that matches the adjacent context features specifically includes: Extract the tail truncation length and target concatenation suffix contained in the lexical inflection rules; According to the stated truncation length, the last character of the reference character sequence is removed to obtain the initial truncated sequence; If, based on the syllable change identifier in the lexical transformation rules, the junction of the initial truncated sequence and the target concatenation suffix satisfies the preset consonant double-writing condition, the last character of the initial truncated sequence is copied to perform double-writing compensation on the initial truncated sequence. The target concatenation suffix is ​​appended to the end of the compensated initial truncated sequence to generate a complete pronoun that matches the adjacent context features.

6. The method according to claim 4, characterized in that, After replacing the preset abbreviations and adjacent characters in the character sequence corresponding to the target field type with the complete referential vocabulary to eliminate cross-field referential ambiguity within the entry object and generate a semantically aligned structured entry object, the method further includes: From the multimodal features, the first visual typography features corresponding to the baseline character sequence in the page image and the second visual typography features corresponding to the preset abbreviation and adjacent characters in the page image are extracted by backtracking. Based on the aforementioned lexical inflection rules, the complete referential vocabulary is divided into root segments and derived suffix segments; The first visual typography feature is mapped to the root word fragment in the entry object, and the second visual typography feature is mapped to the derived suffix fragment in the entry object; Based on the mapped first visual typography features and second visual typography features, the complete pronoun is rendered as a rich text object; Update the rich text object to the entry object.

7. The method according to claim 6, characterized in that, Based on the aforementioned lexical inflection rules, the complete referential vocabulary is divided into root segments and derived suffix segments, specifically including: Based on the lexical transformation rules, determine the number of unmutated characters in the baseline character sequence that did not undergo character substitution or deletion during the morphological transformation process; Based on the number of unmutated characters, a morphological truncation index is determined in the character sequence of the complete referential word to separate the root fragment and the derived suffix fragment; According to the morphological truncation index, the character sequence from the starting position to the morphological truncation index is extracted from the complete referential word to obtain the root fragment; The character sequence from the truncated index to the end position in the complete pronoun is extracted to obtain the derived suffix fragment.

8. A page structure extraction and automatic segmentation system, characterized in that, The system includes: One or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the system to perform the method as described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the system, the system performs the method as described in any one of claims 1-7.

10. A computer program product, characterized in that, When the computer program product is run on the system, the system performs the method as described in any one of claims 1-7.