Word document display method and system based on structured semantic analysis, terminal and medium

By employing adaptive parsing strategies and deep semantic modeling, a dynamic rule priority queue and knowledge graph are generated, solving the problems of intelligent interaction and adaptability in Word document display and achieving efficient document parsing and interactive display.

CN121350239APending Publication Date: 2026-01-16SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511199574.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

Existing Word document web display solutions cannot effectively build deep semantic models, resulting in the inability to support intelligent interactive functions. Furthermore, the parsing process lacks adaptability and cannot handle documents with complex formats and varied styles.

Method used

By employing adaptive parsing strategies and deep semantic modeling, a dynamic rule priority queue is generated. Combined with machine learning to identify complex elements, a document semantic structure tree and knowledge graph are constructed to achieve intelligent document interaction.

Benefits of technology

It improves the success rate and efficiency of parsing complex documents, generates semantically rich structured data models, supports highly interactive document views, and enhances the depth and efficiency of information retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121350239A_ABST
    Figure CN121350239A_ABST
Patent Text Reader

Abstract

The invention relates to the field of document processing, and particularly provides a Word document display method and system based on structured semantic parse, a terminal and a medium. Firstly, a dynamic rule priority queue arranged in a descending order according to the number of failures is constructed by analyzing historical document samples; guiding the analysis engine to cooperate with the rule and the machine learning model to perform high-precision structured analysis on the document; constructing a document structure tree rich in semantic association, and extracting entity relationships to generate knowledge graph sub-graphs; and finally, the serialized data increment is transmitted to a front end, and catalog jump, reference tracking, term prompting and graph visualization are realized through componentization rendering. According to the method, intelligent interaction of the Word document is realized through a self-adaptive analysis strategy and deep semantic modeling, and the information acquisition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of document processing, specifically to a method, system, terminal, and medium for displaying Word documents based on structured semantic parsing. Background Technology

[0002] Current web-based Word document display solutions primarily rely on two types of technologies. The first type involves server-side conversion, converting Word documents into PDF or image formats for static display. While this approach highly replicates the original layout, it renders the document content as a non-interactive "image," losing the document's inherent logical structure and semantic information. Users cannot perform advanced interactive operations such as table of contents navigation, content folding, or keyword searching. The second type utilizes client-side libraries like mammoth.js to directly render .docx documents as HTML. While this approach can output some text content, it lacks the ability to parse and reconstruct complex document elements and fails to build a deep semantic model, resulting in an inability to support intelligent interactive functions based on the document's logical structure. Furthermore, the parsing process of these technologies generally lacks adaptability; parsing rules are typically statically preset and cannot learn from past document processing experience to optimize application strategies. For documents with complex formats and varied styles, static rule sets often perform poorly, leading to decreased parsing accuracy. Summary of the Invention

[0003] To address the aforementioned issues, this invention provides a Word document display method, system, terminal, and medium based on structured semantic parsing. Through adaptive parsing strategies and deep semantic modeling, it achieves intelligent interaction with Word documents and improves the efficiency of information retrieval.

[0004] In a first aspect, the technical solution of the present invention provides a Word document display method based on structured semantic parsing, comprising the following steps: Based on a historical document sample library, each rule in the parsing rule set is processed in batches and its failure count is counted. The rules are then sorted in descending order according to the failure count to generate a dynamic rule priority queue. The dynamic rule priority queue is loaded, and the parsing rules are applied to the target Word document according to the priority order of the queue to perform structured semantic parsing and generate parsing results; for elements whose confidence evaluation after rule application is lower than a preset threshold, a failure procedure is triggered to terminate the current application and jump to the next priority rule or machine learning recognition to generate parsing results, wherein the machine learning recognition process is specific to the element. Based on the parsing results, a document semantic structure tree containing semantic relationships is constructed, and a globally unique anchor identifier is assigned to each node; entities and relations are extracted from the text and table content in the structure tree to generate entity-relation triples, and a document knowledge graph subgraph is constructed using the anchor identifier as an index; The document semantic structure tree and document knowledge graph subgraph are serialized into extended structured data objects and incrementally transmitted to the front end through the data transmission interface; The front-end parses and loads extended structured data objects, renders the document view in a component-based manner, and enables user interaction based on the semantic relationships and document knowledge graph subgraphs.

[0005] In one optional implementation, based on a historical document sample library, each rule in the parsing rule set is processed in batches and its failure count is counted. The rules are then sorted in descending order according to the failure count to generate a dynamic rule priority queue, specifically including: The historical Word documents are collected to form a historical document sample library, which contains documents in several formats, styles and structures; Construct an initial parsing rule set, which contains multiple heuristic rules for processing different document elements and triggering machine learning. Each document in the historical document sample library is input into the parsing engine, and each rule in the parsing rule set is applied sequentially for parsing. During the processing, the application result of each rule is verified and evaluated, and the number of parsing failures is counted. For each rule, the total number of failures during the processing of the entire historical document sample library is accumulated. Based on the total number of failures, all rules in the parsing rule set are sorted in descending order of total failures, and a dynamic rule priority queue is generated based on the result of the descending order.

[0006] In one optional implementation, the parsing rule set includes: The first type of rule is used to infer and reconstruct the structure of merged cells in a table. The judgment criteria include the cell border style, text alignment, and the distribution characteristics of whitespace characters within the cell. The second category of rules is used to determine the title and its level. The criteria for judgment include font size, font bolding attribute, paragraph spacing, indentation, and numbering format. The third type of rule is used to trigger machine learning models to identify specific elements.

[0007] In an optional implementation, the dynamic rule priority queue is loaded, and the parsing rules are applied to the target Word document according to the priority order of the queue to perform structured semantic parsing and generate parsing results. Specifically, this includes: For each parsing request of the target Word document, load the pre-generated dynamic rule priority queue; The target Word document is preprocessed to parse it into multiple independent document elements and identify the type of each document element; Based on the type of the current document element, the parsing rules applicable to that type of element are selected from the dynamic rule priority queue to form the current rule subset, and the parsing rules within the rule subset maintain their original priority order; Based on the order of the parsing rules within the current rule subset, the parsing rules are extracted sequentially to parse the current document elements and generate a confidence evaluation value; the confidence evaluation is based on one or more of the following: the matching degree between the rule logic and the element features, the contextual reasonableness of the processing result, and the historical success rate. If the confidence score is not less than the first preset threshold, the current rule is determined to be successfully parsed. The processing result of the current parsing rule is taken as the final parsing result of the current document element, and the next document element is processed. If the confidence score is less than the second preset threshold, a failure procedure is triggered to terminate the current parsing calculation of the document element and extract the next parsing rule to parse the current document element. If none of the parsing rules in the current rule subset produce a confidence evaluation value not less than the first preset threshold, then machine learning is triggered to process the current document element, and the processing result is used as the final parsing result of the current document element.

[0008] In one optional implementation, generating a confidence assessment value specifically includes: Get the processing result of the current parsing rule on the current document element; Based on the processing results, target evaluation features are extracted to obtain the values ​​of each target evaluation feature; the target evaluation features include rule matching degree features, result consistency features, and historical success rate features. After normalizing each evaluation feature value, a weighted sum is performed, and the weighted sum result is the confidence evaluation value.

[0009] In an optional implementation, based on the parsing results, a document semantic structure tree containing semantic relationships is constructed, and a globally unique anchor identifier is assigned to each node; entities and relations are extracted from the text and table content in the structure tree to generate entity-relation triples, and a document knowledge graph subgraph is constructed using the anchor identifier as an index, specifically including: The structure tree trunk is constructed using the parsed title hierarchy, and the content units are attached as leaf nodes. Assign a globally unique anchor identifier to each node in the tree; Analyzing node content and establishing citation, terminology, or caption relationships between nodes includes: detecting references to target nodes in source node text to establish citation relationships; detecting terminology definition nodes and terminology mention nodes to establish terminology relationships; and detecting media nodes and adjacent caption text nodes to establish caption relationships. A pre-trained natural language processing model is used to extract entities and relations from text and table content, generating triples. The extracted entities are associated with the anchor points in the original text, and the mapping relationship between the entity and the anchor point of the node it belongs to is recorded to form entity tracing information. A document knowledge graph subgraph is constructed using triples as edges and nodes, and entity anchor mapping information as entity node attributes.

[0010] In one optional implementation, the front-end parses and loads extended structured data objects, renders the document view in a component-based manner, and performs user interaction based on the semantic relationships and document knowledge graph subgraphs, specifically including: The front end performs deserialization and parsing of data objects, reconstructing a document semantic structure tree model and a document knowledge graph subgraph model; Dynamically create the user interface view skeleton based on the document semantic structure tree model; Iterate through the leaf nodes in the document semantic structure tree, and dynamically load and instantiate the corresponding dedicated rendering components according to the type attributes of the nodes, and inject the node data into the components to render the specific content. Bind event listeners to rendered document view elements to listen for click events on nodes in the table of contents navigation bar, click or hover events on referenced text in the body, click or hover events on identified entities in the body, click events on buttons triggered in the knowledge graph sidebar, and click events on buttons triggered in the question and answer dialog box. Respond to user interaction events and perform semantically related navigation and prompting operations, or perform visualization and bidirectional navigation operations based on knowledge graph subgraphs.

[0011] Secondly, the technical solution of the present invention provides a Word document display system based on structured semantic parsing, comprising: The dynamic rule priority generation module is used to batch process each rule in the parsing rule set based on the historical document sample library, count the number of failures, sort the rules in descending order according to the number of failures, and generate a dynamic rule priority queue. The document parsing module is used to load the dynamic rule priority queue, apply parsing rules to the target Word document according to the priority order of the queue to perform structured semantic parsing and generate parsing results; for elements whose confidence evaluation after applying the rules is lower than a preset threshold, a failure procedure is triggered to terminate the current application and jump to the next priority rule or machine learning recognition to generate parsing results, wherein the machine learning recognition process is specific elements; The structure graph generation module is used to construct a document semantic structure tree containing semantic relationships based on the parsing results, and assign a globally unique anchor point identifier to each node; extract entities and relations from the text and table content in the structure tree to generate entity-relation triples, and construct a document knowledge graph subgraph using the anchor point identifier as an index; The data object transmission module is used to serialize the document semantic structure tree and document knowledge graph subgraph into extended structured data objects, and incrementally transmit them to the front end through the data transmission interface; The document view display module is used by the front end to parse and load extended structured data objects, render the document view in a component-based manner, and enable user interaction based on the semantic relationships and document knowledge graph subgraphs.

[0012] Thirdly, the technical solution of the present invention provides a terminal, comprising: The memory is used to store Word document display programs based on structured semantic parsing; A processor, configured to implement the steps of the Word document display method based on structured semantic parsing as described above when executing the Word document display program based on structured semantic parsing.

[0013] Fourthly, the present invention provides a computer-readable storage medium storing a Word document display program based on structured semantic parsing. When the Word document display program based on structured semantic parsing is executed by a processor, it implements the steps of the Word document display method based on structured semantic parsing as described in any of the above claims.

[0014] As can be seen from the above technical solutions, this application has the following advantages: 1. By employing a dynamic rule priority queue based on historical failure counts, the parsing process possesses self-learning and self-optimization characteristics. It can prioritize trying the least reliable rules and quickly switch strategies using a fast-fail mechanism, improving the success rate and efficiency of parsing complex and non-standard format documents. The collaborative working mechanism between the rule engine and the machine learning model ensures efficient processing of regular elements and accurate identification of exceptionally complex elements. 2. By constructing a document semantic structure tree containing multi-level semantic relationships, and further extracting entity-relationship triples to construct a document knowledge graph subgraph, unstructured document content is transformed into a semantically rich structured data model. This not only preserves the physical structure of the document but also reveals its knowledge logic, providing a data foundation for intelligent applications. 3. Based on the received structured data model, the front-end renders a highly interactive document view using a component-based approach. Users can perform operations such as table of contents navigation, paragraph folding, citation tracking, and terminology suggestions. In particular, it integrates knowledge graph visualization capabilities, allowing users to interact with document knowledge and improving the depth and efficiency of information retrieval. 4. The generated standardized structured data objects (such as JSON) are easy to transmit, store and develop, and can be easily applied to more scenarios such as document comparison, content retrieval and knowledge base construction. Attached Figure Description

[0015] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart illustrating a Word document display method based on structured semantic parsing, provided as an embodiment of the present invention.

[0017] Figure 2 This is a schematic block diagram of a Word document display system based on structured semantic parsing, provided as an embodiment of the present invention.

[0018] Figure 3 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Detailed Implementation

[0019] To make the purpose, features, and advantages of this application more apparent and understandable, specific embodiments and accompanying drawings will be used to clearly and completely describe the technical solution protected by this application. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this application and in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0021] Figure 1 This is a schematic flowchart illustrating a Word document display method based on structured semantic parsing, provided as an embodiment of the present invention. Figure 1 The executing entity can be a Word document display system based on structured semantic parsing. The Word document display method based on structured semantic parsing provided in this embodiment of the invention is executed by a computer device, and correspondingly, the Word document display system based on structured semantic parsing runs on the computer device. Depending on different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted.

[0022] like Figure 1 As shown, the method includes the following steps.

[0023] S1, based on the historical document sample library, performs batch processing on each rule in the parsing rule set and counts the number of failures. The rules are then sorted in descending order according to the number of failures to generate a dynamic rule priority queue.

[0024] S2, load the dynamic rule priority queue, apply parsing rules to the target Word document according to the priority order of the queue to perform structured semantic parsing and generate parsing results; for elements whose confidence evaluation after applying the rules is lower than a preset threshold, trigger a failure procedure to terminate the current application and jump to the next priority rule or machine learning recognition to generate parsing results, wherein the machine learning recognition process is specific to the element.

[0025] S3. Based on the parsing results, construct a document semantic structure tree containing semantic relationships, and assign a globally unique anchor identifier to each node; extract entities and relations from the text and table content in the structure tree to generate entity-relation triples, and construct a document knowledge graph subgraph using the anchor identifier as an index.

[0026] S4, the document semantic structure tree and document knowledge graph subgraph are serialized into extended structured data objects and incrementally transmitted to the front end through the data transmission interface.

[0027] S5: The front end parses and loads extended structured data objects, renders the document view in a component-based manner, and performs user interaction based on the semantic relationships and document knowledge graph subgraphs.

[0028] As a refinement and extension of the specific implementation of the above embodiments, in order to fully explain the specific implementation process of this embodiment, the following will provide possible embodiments to describe the specific implementation of the above steps in a non-limiting manner.

[0029] In some optional implementations, step S1 involves batch processing each rule in the parsing rule set based on the historical document sample library and counting its failure counts. The rules are then sorted in descending order according to the failure count to generate a dynamic rule priority queue. This step specifically includes the following steps.

[0030] S1.1, Obtain historical Word documents to form a historical document sample library. The documents in this sample library contain several formats, styles and structures.

[0031] A large number of diverse and representative historical Word documents were acquired to form a historical document sample library. The documents in the historical document sample library cover a variety of formats, styles and complex structures, including but not limited to tables containing merged cells, non-standard hierarchical headings, mathematical formulas, chemical equations and code snippets.

[0032] S1.2, Construct the initial parsing rule set, which contains multiple heuristic rules for processing different document elements and triggering machine learning.

[0033] The parsing rule set should include at least: The first type of rule is used to infer and reconstruct the structure of merged cells in a table. The judgment criteria include the cell border style, text alignment, and the distribution characteristics of whitespace characters within the cell. The second category of rules is used to determine the title and its level. The criteria for judgment include font size, font bolding attribute, paragraph spacing, indentation, and numbering format. The third type of rule is used to trigger machine learning models to identify specific elements.

[0034] The first and second types of rules are processing rules. Their task is to directly process specific elements (such as analyzing cell borders to merge tables, or analyzing font size to determine headings). The input is document elements, and the output is the parsed result.

[0035] The third type of rule is the scheduling rule. Its task is to make a judgment: "Should this element skip all regular processing rules and be directly handed over to the machine learning module for processing?" Its input is the features of the document element, and its output is a boolean value: True (trigger ML) or False (do not trigger, continue with the regular rule process). Understandably, it can also include parsing rules for other elements as needed.

[0036] S1.3, input each document in the historical document sample library into the parsing engine, and apply each rule in the parsing rule set to the parsing engine in turn. During the processing, the application result of each rule is verified and evaluated, and the number of parsing failures is counted.

[0037] Failures include: Missed report: The rule failed to identify the actual target structure in the document that the rule is targeting. False alarms occur when the rule incorrectly identifies non-target structures in the document as target structures. Timeout occurs when the rule takes longer than a preset time threshold to process a single document element.

[0038] S1.4 For each rule, accumulate the total number of failures in the process of processing the entire historical document sample library, sort all rules in the parsing rule set in descending order of total failure count based on the total number of failures, and generate a dynamic rule priority queue based on the result of the descending sort.

[0039] Based on the total number of failures, all rules in the parsing rule set are sorted in descending order; rules with a higher total number of failures are ranked higher. A dynamic rule priority queue is used to prioritize rules with a high failure rate (i.e., those handling greater uncertainty) during subsequent real-time parsing of unknown documents. If a rule fails quickly, it can be switched to, thereby optimizing the efficiency and resource allocation of the overall parsing process. Prioritizing these high-failure-rate rules is not based on the expectation that they will succeed this time, but rather on a prediction that the rule is likely to fail again. Thanks to the confidence assessment mechanism, the system can very quickly determine whether the application of the rule to the current element has failed again (i.e., "fast failure"). Once a failure is quickly determined, the system can immediately terminate the subsequent calculation of the current rule and jump to the next rule. This avoids wasting excessive computation time and resources on a rule that is "almost destined to fail."

[0040] In some optional implementations, step S2 involves loading the dynamic rule priority queue and applying parsing rules to the target Word document according to the priority order of the queue to perform structured semantic parsing and generate parsing results. This specifically includes the following steps.

[0041] S2.1, For the parsing request of the corresponding target Word document, load the pre-generated dynamic rule priority queue.

[0042] In response to a request to parse a target Word document, a pre-generated dynamic rule priority queue is loaded; the parsing environment is initialized, and an empty parsing result set is created for the target Word document.

[0043] S2.2, preprocess the target Word document to parse it into multiple independent document elements and identify the type of each document element.

[0044] The target Word document is initially analyzed, divided into different logical element blocks, and the preliminary type of each element block is identified and labeled, such as: paragraph, table, image, list, suspected formula, suspected code, etc.

[0045] S2.3, Based on the type of the current document element, select the parsing rules applicable to the element type from the dynamic rule priority queue to form the current rule subset, and maintain the original priority order of the parsing rules within the rule subset.

[0046] Based on the initial type of the identified element, it is distributed to the corresponding rule processor. Each rule processor is associated with a dedicated subset of rules, which contains all rules used to process this type of element. The rules within the current rule subset maintain their descending order in the global dynamic rule priority queue.

[0047] For example, a table element will be dispatched to a "table processor", which is associated with a subset of rules that only include rules for handling table merging cells (Category 1) and rules for triggering ML processing of complex tables (Category 3), but will not include rules for judging the title (Category 2).

[0048] S2.4, according to the order of the parsing rules in the current rule subset, extract the parsing rules in sequence to parse the current document elements and generate a confidence evaluation value; the confidence evaluation is based on one or more of the following: the matching degree between the rule logic and the element features, the contextual rationality of the processing result, and the historical success rate.

[0049] The process of generating a confidence assessment value includes: obtaining the processing result of the current parsing rule on the current document element; extracting target assessment features based on the processing result to obtain the value of each target assessment feature; the target assessment features include rule matching degree features, result consistency features, and historical success rate features; and normalizing each assessment feature value and then performing a weighted summation, the weighted summation result being the confidence assessment value.

[0050] Rule matching degree feature: Characterizes the degree of agreement between the rule's judgment logic and the original features of the element. Its value can be calculated based on the rule's specific logic. For example, for a rule that determines the heading level, its rule matching degree feature F_m can be calculated based on the following formula: F_m = (Font size matching score * α + Font bold matching score * β + Paragraph spacing matching score * γ) Where α, β, and γ are adjustment coefficients, and α + β + γ = 1. The matching degree of each sub-item can be calculated based on the deviation between the actual attribute value and the expected value of the rule (e.g., through Gaussian function mapping). The consistency characteristic F_c represents the logical plausibility of the structured data generated by parsing (such as cell merging relationships and heading levels) within the document context. Its value can be evaluated by checking for conflicts in the parsing results within the context. For example, for a table parsing rule, its F_c can be evaluated as follows: F_c = 1 - (Number of detected collisions / Maximum possible number of collisions) "Conflicts" can include: format conflicts between merged cells and adjacent cells, and semantic type mismatches between inferred headers and data areas.

[0051] Historical success rate feature F_h: Characterizes the statistical success rate of the rule when processing similar elements in the historical document sample library. Its value can be directly obtained from historical statistical data. For example, if the number of successful attempts of the rule when processing similar elements in the historical sample library is S, and the total number of attempts is T, then its historical success rate F_h can be calculated as: F_h = S / T.

[0052] S2.5 If the confidence assessment value is not less than the first preset threshold, the current rule is determined to be successfully parsed. The processing result of the current parsing rule is taken as the final parsing result of the current document element, and the next document element is processed.

[0053] S2.6 If the confidence assessment value is less than the second preset threshold, a failure procedure is triggered to terminate the current parsing calculation of the document element, and the next parsing rule is extracted to parse the current document element.

[0054] S2.7 If none of the parsing rules in the current rule subset produce a confidence evaluation value not less than the first preset threshold, then machine learning is triggered to process the current document element, and the processing result is used as the final parsing result of the current document element.

[0055] Machine learning identifies complex document elements that rule engines cannot handle or cannot handle with extremely low confidence. It is specifically designed to identify elements with complex and varied patterns that are difficult to describe using deterministic rules. Machine learning identification includes formula recognition models, code recognition and normalization models, and complex table structure recognition models.

[0056] Formula recognition models are primarily used to identify and convert mathematical formulas and chemical equations. They are based on sequence-to-sequence (Seq2Seq) models with an encoder-decoder architecture, or utilize the Transformer architecture. Input is an image of the formula region (preprocessed and cropped by the rule engine) or a text sequence containing formula symbols; the output is a standard LaTeX expression.

[0057] The code recognition and normalization model is used to identify code snippets and perform syntax highlighting and formatting. It is based on a combination of Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) or Transformers. First, CNNs extract visual features (such as indentation and line breaks), then RNNs or Transformers process the character sequences. The input is the text content of the code snippet and its context; the output identifies the programming language type (e.g., Python, Java, C++) and completes the syntax structure parsing. Subsequent processing passes the output to standard syntax highlighting libraries (such as Highlight.js, Prism) for rendering.

[0058] The complex table structure recognition model is used to parse extremely complex tables that rule engines cannot handle. It is based on deep learning models for object detection (such as YOLO, Faster R-CNN) or semantic segmentation. The input is a rendered image of the entire table, and the output is the bounding box coordinates, row and column positions of each cell, and the merging relationships between cells.

[0059] In some optional implementations, step S3 constructs a document semantic structure tree containing semantic relationships based on the parsing results, and assigns a globally unique anchor identifier to each node; extracts entities and relations from the text and table content in the structure tree to generate entity-relation triples, and constructs a document knowledge graph subgraph using the anchor identifier as an index, specifically including the following steps.

[0060] S3.1, construct the trunk of the structure tree based on the parsed title hierarchy, and attach the content units as leaf nodes.

[0061] Based on the heading hierarchy relationships in the parsed results, a main hierarchy of the document semantic structure tree is constructed. The main hierarchy includes a root node, multi-level heading nodes, and their subordinate relationships. Paragraphs, tables, images, formulas, and code blocks from the parsed results are treated as leaf nodes and attached to their nearest-lowest-ancestor heading node.

[0062] S3.2 assigns a globally unique anchor identifier to each node in the tree.

[0063] Each node in the document semantic structure tree is assigned a globally unique anchor ID. The rules for generating anchor IDs ensure their uniqueness and traceability within the scope of the document.

[0064] S3.3, Analyze the node content and establish reference relationships, terminology relationships, or caption relationships between nodes, including: detecting references to the target node in the source node text to establish reference relationships, detecting terminology relationship between terminology definition nodes and terminology mention nodes to establish terminology relationship, and detecting caption relationship between media nodes and adjacent caption text nodes.

[0065] Traverse the document's semantic structure tree, analyze the node content, and establish explicit semantic relationships between logically related nodes. These semantic relationships must include at least: Citation Link: When a reference description to another node (target node) is detected in the text content of a node (source node), a citation link is established between the source node and the target node; the citation description includes "as shown in Table X", "see Figure Y", and "as described in Chapter Z". GlossaryLink: When a definition of a term is detected in one node and a mention of the term is detected in another node, a glossary link is established between the defining node and all mentioning nodes. CaptionLink: Establishes a caption relationship between an image or table node and its directly adjacent text node that serves as its caption.

[0066] S3.4 uses a pre-trained natural language processing model to extract entities and relations from text and table content, generating triples.

[0067] Deep semantic analysis is performed on the text node content and table node content in the document semantic structure tree using a pre-trained natural language processing model. Entities and relationships between entities are identified and extracted from the content, forming triples represented as <entity, relation, entity> or <entity, relation, value>. A locally unique identifier is assigned to each extracted entity.

[0068] S3.5 Associate the extracted entities with the anchor points in the original text, record the mapping relationship between the entity and the anchor point of the node it belongs to, and form entity tracing information.

[0069] For each entity extracted in the previous step, associate it with the anchor point of the leaf node corresponding to its position in the original text, record the mapping relationship between the entity and the anchor point of the node it belongs to, and form entity tracing information.

[0070] S3.6 constructs a document knowledge graph subgraph using triples as edges and nodes, and entity anchor mapping information as entity node attributes.

[0071] The extracted entities are matched with entities in external knowledge graphs (such as Wikidata or domain knowledge bases). If a match is successful, the corresponding external knowledge graph entity identifier URI is recorded for that entity. A document knowledge graph subgraph is constructed using all generated triples as edges and nodes. The recorded entity anchor mapping information is stored as an attribute of the entity node in this subgraph, achieving a bidirectional link between the knowledge graph and the original text location. The obtained external entity identifier is stored as an additional attribute of the entity node.

[0072] The explicit semantic relationships established in step S3.3 can also be converted into a special triple (e.g., <node A, hasCitation, node B>) and added to the document knowledge graph subgraph. Thus, the document knowledge graph subgraph integrates implicit knowledge (entity relationships) extracted from the content and explicit relationships (citations, terms, etc.) extracted from the structure.

[0073] In some optional implementations, step S5 involves the front end parsing and loading extended structured data objects, rendering the document view in a component-based manner, and conducting user interaction based on the semantic relationships and document knowledge graph subgraphs, specifically including the following steps.

[0074] In S5.1, the front end performs deserialization and parsing of data objects, reconstructing a document semantic structure tree model and a document knowledge graph subgraph model.

[0075] The front end receives extended structured data objects from the back end through the data transmission interface; it deserializes and parses the received data objects to reconstruct the document semantic structure tree model and the document knowledge graph subgraph model, and loads them into the state management container in the front end's memory.

[0076] S5.2 Dynamically create the user interface view skeleton based on the document semantic structure tree model.

[0077] The view skeleton includes at least: The content rendering area is used to display document titles and content nodes in hierarchical order; The directory navigation bar component is generated based on the hierarchical relationship of the structure tree and provides node jump functionality; The knowledge graph visualization sidebar component container is initially hidden or collapsed.

[0078] S5.3 traverses the leaf nodes in the document semantic structure tree and dynamically loads and instantiates the corresponding dedicated rendering components according to the node's type attribute, injecting node data into the components to render the specific content.

[0079] The component management engine traverses the leaf nodes in the document semantic structure tree and dynamically loads and instantiates corresponding dedicated rendering components based on the node's type attribute. It then injects node data into the components to render the specific content. The dedicated rendering components include at least: Paragraph card component, used to render text paragraphs, and supports collapse / expand, text selection, and keyword highlighting functions; The table rendering component is used to render table data in an interactive table format and provides sorting and filtering functions; this component listens for user click events and displays the data in a pop-up window when triggered. The image rendering component is used to render images, listen for user click events, and activate the image zoom-in viewing mode when triggered. The formula rendering component is used to receive and parse LaTeX expressions and render them as mathematical formula graphics; A code rendering component used to render code snippets and provide syntax highlighting and code copying functions.

[0080] S5.4 binds event listeners to rendered document view elements to listen for click events on nodes in the table of contents navigation bar, click or hover events on referenced text in the body, click or hover events on identified entities in the body, click events on buttons triggered in the knowledge graph sidebar, and click events on buttons triggered in the question-and-answer dialog box.

[0081] S5.5 responds to user interaction events and performs semantically related navigation and prompting operations, or performs visualization and bidirectional navigation operations based on knowledge graph subgraphs.

[0082] When an interaction event based on semantic association is captured, the interaction control performs at least one of the following operations: Reference navigation responds to click events on referenced text, locates the referenced target node (such as a table or graph) based on pre-established reference relationships, automatically scrolls the view to the location of the node, and highlights the content of the node. The terminology tooltip responds to hover events for terms, retrieves their definitions based on pre-established term relationships, and displays them instantly as a tooltip; it also responds to click events for terms, navigating to the node containing the term's definition. Caption linkage: When a click event is triggered on an image or table, its caption text is highlighted simultaneously; conversely, when a click event is triggered on the caption text, its associated image or table is highlighted simultaneously.

[0083] When a knowledge graph interaction event is captured, the interaction control performs the following actions: In response to a user's click event on an entity in the main text, extract a subgraph centered on that entity from the document knowledge graph subgraph; Control the expansion of the knowledge graph visualization sidebar component and visualize the document knowledge graph subgraphs in the form of force-directed graphs or network diagrams; Provides interactive graph features, including: node expansion / collapse, relationship path highlighting, zooming and panning; In response to a user's click event on any graph node in the visualization sidebar, the system locates and jumps to all locations in the original text where the entity appears, based on the stored anchor point mapping information, and highlights them.

[0084] Additionally, when a question-and-answer interaction event is captured, the interaction control performs the following operations: activating the question-and-answer dialogue floating window component; receiving the natural language question input by the user; sending the question, context information of the current user's browsing location, and relevant knowledge graph subgraph information to the backend question-and-answer service; receiving the answer returned by the backend and rendering and displaying it in the dialogue floating window; in the answer, citing the conclusions from the original text, with the citations associated with anchor points in the original text; and responding to the user's click event on the citation citation, jumping to the corresponding anchor point position in the original text.

[0085] During the interaction, the interaction control maintains the global application state, ensuring that the state is synchronized between the directory, the main text, the knowledge graph view, and the question-and-answer dialog box; the state includes the currently highlighted node, the selected entity, the question-and-answer session history, etc.

[0086] The foregoing has described in detail an embodiment of a Word document display method based on structured semantic parsing. Based on the Word document display method based on structured semantic parsing described in the above embodiment, this invention also provides a Word document display system based on structured semantic parsing corresponding to the method.

[0087] Figure 2 This is a schematic block diagram of a Word document display system based on structured semantic parsing, provided as an embodiment of the present invention. In this embodiment, the Word document display system 200 based on structured semantic parsing can be divided into multiple functional modules according to the functions it performs. A module, as referred to in this invention, is a series of computer program segments that can be executed by at least one processor and perform a fixed function, and is stored in memory.

[0088] The dynamic rule priority generation module 210 is used to batch process each rule in the parsing rule set based on the historical document sample library, count the number of failures, sort the rules in descending order according to the number of failures, and generate a dynamic rule priority queue.

[0089] The document parsing module 220 is used to load the dynamic rule priority queue, apply parsing rules to the target Word document according to the priority order of the queue to perform structured semantic parsing and generate parsing results; for elements whose confidence evaluation after applying the rules is lower than a preset threshold, a failure procedure is triggered to terminate the current application and jump to the next priority rule or machine learning recognition to generate parsing results, wherein the machine learning recognition process is specific elements.

[0090] The structure graph generation module 230 is used to construct a document semantic structure tree containing semantic relationships based on the parsing results, and assign a globally unique anchor point identifier to each node; extract entities and relations from the text and table content in the structure tree, generate entity-relation triples, and construct a document knowledge graph subgraph using the anchor point identifier as an index.

[0091] The data object transmission module 240 is used to serialize the document semantic structure tree and the document knowledge graph subgraph into extended structured data objects, and incrementally transmit them to the front end through the data transmission interface.

[0092] The document view display module 250 is used for front-end parsing and loading extended structured data objects, rendering the document view in a component-based manner, and enabling user interaction based on the semantic relationships and document knowledge graph subgraphs.

[0093] The Word document display system based on structured semantic parsing in this embodiment is used to implement the aforementioned Word document display method based on structured semantic parsing. Therefore, the specific implementation of this system can be found in the embodiment section of the Word document display method based on structured semantic parsing mentioned above. Thus, the specific implementation can be referred to the description of the corresponding embodiments, and will not be elaborated here.

[0094] Furthermore, since the Word document display system based on structured semantic parsing in this embodiment is used to implement the aforementioned Word document display method based on structured semantic parsing, its function corresponds to the function of the above method, and will not be repeated here.

[0095] Figure 3 This is a schematic diagram of the structure of a terminal 300 provided in an embodiment of the present invention, including: a processor 310, a memory 320, and a communication unit 330. The processor 310 is used to implement the flow steps of the above-described embodiment of the Word document display method based on structured semantic parsing when implementing the Word document display program based on structured semantic parsing stored in the memory 320.

[0096] The terminal 300 includes a processor 310, a memory 320, and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation of the present invention. It can be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0097] The memory 320 can be used to store the execution instructions of the processor 310. The memory 320 can be implemented by any type of volatile or non-volatile memory terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 is able to perform some or all of the steps in the above method embodiments.

[0098] The processor 310 serves as the control center of the storage terminal, connecting various parts of the electronic terminal via various interfaces and lines. It executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 310 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.

[0099] The communication unit 330 is used to establish a communication channel, enabling the storage terminal to communicate with other terminals. It can receive user data sent by other terminals or send user data to other terminals.

[0100] The present invention also provides a computer storage medium, which may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.

[0101] The present invention also provides a computer storage medium, which may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.

[0102] The computer storage medium stores a Word document display program based on structured semantic parsing. When the Word document display program based on structured semantic parsing is executed by the processor, it implements the process steps of the above-described embodiment of the Word document display method based on structured semantic parsing.

[0103] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or other media capable of storing program code. It includes several instructions to cause a computer terminal (which may be a personal computer, server, or a second terminal, network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0104] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0105] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0106] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0107] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for presenting a Word document based on structured semantic parsing, characterized in that, The method comprises the following steps: Based on the historical document sample library, the rules in the parsing rule set are batch processed and the failure times are counted, and the rules are sorted in descending order according to the failure times to generate a dynamic rule priority queue; Load the dynamic rule priority queue, and apply the parsing rules to the target Word document according to the priority order of the queue to generate a parsing result; for elements with a confidence evaluation lower than a preset threshold after applying the rules, trigger a failure procedure to terminate the current application and jump to the next priority rule or machine learning recognition to generate a parsing result, and the machine learning recognition processes specific elements; Based on the parsing result, a document semantic structure tree containing semantic association relationships is constructed, and a globally unique anchor point identifier is assigned to each node; entity and relationship extraction is performed on the text and table content in the structure tree to generate entity-relation triples, and a document knowledge graph subgraph is constructed with the anchor point identifier as an index; The document semantic structure tree and the document knowledge graph subgraph are serialized into an extended structured data object, which is incrementally transmitted to the front end through a data transmission interface; The front end parses and loads the extended structured data object, renders the document view through a componentized manner, and interacts with the user based on the semantic association relationships and the document knowledge graph subgraph.

2. The method according to claim 1, wherein, Based on the historical document sample library, the rules in the parsing rule set are batch processed and the failure times are counted, and the rules are sorted in descending order according to the failure times to generate a dynamic rule priority queue, specifically including: Obtain historical Word documents to form a historical document sample library, and the documents in the sample library contain several formats, styles and structures; Construct an initial parsing rule set, which contains multiple heuristic rules for processing different document elements and triggering machine learning; Input each document in the historical document sample library into the parsing engine, and apply each rule in the parsing rule set in turn for parsing processing; in the processing, verify and evaluate the application result of each rule, and count the number of parsing failures; For each rule, accumulate the total number of failures in the process of processing the entire historical document sample library, and sort all rules in the parsing rule set in descending order of total failure times according to the total failure times, and generate a dynamic rule priority queue according to the descending order.

3. The method of claim 2, wherein the structured semantic parsing is based on a Word document presentation. The parsing rule set includes: The first type of rule is used to infer and reconstruct the structure of merged table cells, and the judgment basis includes the border style of the cell, the text alignment, and the distribution characteristics of the blank characters in the cell; The second type of rule is used to determine the title and its level, and the judgment basis includes font size, font bold attribute, paragraph spacing, indentation and numbering format; The third type of rule is used to trigger the machine learning model to identify specific elements.

4. The method of claim 1, wherein the method further comprises: Load the dynamic rule priority queue, and apply the parsing rules to the target Word document according to the priority order of the queue to generate a parsing result, specifically including: Load the pre-generated dynamic rule priority queue corresponding to the parsing request of the target Word document; The target Word document is preprocessed to parse the target Word document into multiple independent document elements, and the type of each document element is identified; According to the type of the current document element, the parsing rules suitable for the type of the element are filtered from the dynamic rule priority queue to form a current rule subset, and the parsing rules in the rule subset maintain the original priority order; According to the order of the parsing rules in the current rule subset, the parsing rules are extracted in turn to parse the current document element, and a confidence evaluation value is generated; The confidence evaluation is based on one or more of the matching degree of rule logic and element characteristics, the context rationality of the processing result and the historical success rate; If the confidence evaluation value is not less than the first preset threshold, it is determined that the current rule parsing is successful, the processing result of the current parsing rule is taken as the final parsing result of the current document element, and the next document element is processed; If the confidence evaluation value is less than the second preset threshold, a failure program is triggered to terminate the calculation of the current parsing on the document element, and the next parsing rule is extracted to parse the current document element; If all the parsing rules in the current rule subset do not produce a confidence evaluation value result not less than the first preset threshold, trigger the machine learning identification to process the current document element, and the processing result is taken as the final parsing result of the current document element.

5. The method of claim 4, wherein the structured semantic parsing is based on, Generate a confidence evaluation value, specifically including: Obtain the processing result of the current parsing rule on the current document element; According to the processing result, target evaluation features are extracted to obtain each target evaluation feature value; The target evaluation features include rule matching degree feature, result consistency feature and historical success rate feature; After normalizing each evaluation feature value, weighted sum is performed, and the weighted sum result is the confidence evaluation value.

6. The method of claim 1, wherein the method further comprises: Based on the parsing result, a document semantic structure tree containing semantic association relationship is constructed, and a global unique anchor point identifier is assigned to each node; The text and table content in the structure tree are entity and relationship extraction, entity-relation triplets are generated, and a document knowledge graph subgraph is constructed with the anchor point identifier as the index, specifically including: The structure tree trunk is constructed with the parsed title level, and the content unit is mounted as a leaf node; Each node in the tree is assigned a globally unique anchor point identifier; Analyze the node content, and establish reference relationship, term relationship or caption relationship between nodes, including: detecting the reference description of the source node text to the target node to establish the reference relationship, detecting the term definition node and the term mention node to establish the term relationship, and detecting the media node and the adjacent caption text node to establish the caption relationship; The pre-trained natural language processing model is used for entity and relationship extraction of text and table content to generate triplets; The extracted entity and the original text anchor point identifier are associated, the mapping relationship between the entity and the anchor point identifier of the node where the entity is located is recorded, and entity traceability information is formed; The triplets are taken as edges and nodes, and the entity anchor mapping information is taken as the entity node attribute to construct a document knowledge graph subgraph.

7. The method of claim 1, wherein the method further comprises: The front-end parses and loads the extended structured data object, renders the document view through the componentization method, and interacts with the user based on the semantic association relationship and the document knowledge graph subgraph, specifically including: The front end deserializes and parses the data object, reconstructs a document semantic structure tree model and a document knowledge graph subgraph model; According to the document semantic structure tree model, a user interface view skeleton is dynamically created; Leaf nodes in the document semantic structure tree are traversed, and according to the type attribute of the nodes, corresponding special rendering components are dynamically loaded and instantiated, and node data is injected into the components to render specific content; Event listeners are bound to the rendered document view elements, for listening to click events on nodes in the directory navigation bar, click or hover events on quoted texts in the main text, click or hover events on recognized entities in the main text, click events on knowledge graph sidebar trigger buttons, and click events on question and answer dialog trigger buttons; In response to user interaction events, semantic association-based jumping, prompting operations, or knowledge graph subgraph-based visualization and bidirectional jumping operations are performed.

8. A structured semantic parsing based Word document presentation system, characterized in that, It comprises: A dynamic rule priority generation module is used to process rules in the rule set in batches based on a historical document sample library and to count the number of failures of the rules, sort the rules in descending order according to the number of failures, and generate a dynamic rule priority queue; A document parsing module is used to load the dynamic rule priority queue, apply parsing rules to a target Word document according to the priority order of the queue, and perform structured semantic parsing to generate a parsing result; for elements with a confidence evaluation lower than a preset threshold after applying the rules, a failure program is triggered to terminate the current application and jump to the next priority rule or machine learning identification to generate a parsing result, and the machine learning identification processes specific elements; A structure graph generation module is used to construct a document semantic structure tree containing semantic association relationships based on the parsing result, and to assign a globally unique anchor point identifier to each node; entity and relationship extraction is performed on the text and table contents in the structure tree to generate entity-relation triples, and a document knowledge graph subgraph is constructed using the anchor point identifier as an index; A data object transmission module is used to serialize the document semantic structure tree and the document knowledge graph subgraph into an extended structured data object, and to incrementally transmit the data object to the front end through a data transmission interface; A document view display module is used to parse and load the extended structured data object in the front end, render the document view through a component-based approach, and perform user interaction based on the semantic association relationships and the document knowledge graph subgraph.

9. A terminal, characterized by comprising: It comprises: A memory is used to store a structured semantic parsing-based Word document display program; A processor is used to execute the structured semantic parsing-based Word document display program to implement the steps of the structured semantic parsing-based Word document display method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The readable storage medium stores a structured semantic parsing-based Word document display program, and the structured semantic parsing-based Word document display program is executed by the processor to implement the steps of the structured semantic parsing-based Word document display method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Document analysis method and system based on multi-dimensional feature fusion and heuristic reasoning

    CN121683763A