A method, apparatus, and medium for extracting key information from a document and generating structured data

By employing multimodal document preprocessing, key topic positioning and scope definition, and content refinement and deconstruction steps, combined with visual-semantic fusion technology, the problem of information fragmentation in unstructured documents is solved, enabling efficient extraction and structured output of key information, and supporting direct invocation by downstream applications.

CN122197895APending Publication Date: 2026-06-12OXFORD INTELLIGENT (HANGZHOU) TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
OXFORD INTELLIGENT (HANGZHOU) TECHNOLOGY CO LTD
Filing Date
2026-03-23
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently extract key information from unstructured documents, especially in documents with complex layouts and multi-domain applications. They fail to achieve semantic aggregation and structured output of information, leading to information fragmentation and limitations on downstream applications.

Method used

By employing multimodal document preprocessing, key topic positioning and scope definition, and content refinement and deconstruction steps, combined with visual-semantic fusion technology, semantic parsing and structured encapsulation of text units are achieved, generating structured data.

Benefits of technology

It achieves complete extraction of key information and contextual coherence, supports fully automated processing, and meets the needs of direct invocation and in-depth mining by downstream business systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122197895A_ABST
    Figure CN122197895A_ABST
Patent Text Reader

Abstract

The application provides a method, device and medium for extracting key information from a document and generating structured data, the method comprising: performing text extraction and layout analysis on an input unstructured document to obtain a sequence of text units and visual features and logical structure features of each text unit; locating anchor text units representing key topics in the sequence of text units, and dynamically defining a complete text action range of each key topic corresponding to each anchor text unit based on the visual features and logical structure features; performing semantic analysis on text content in each complete text action range to extract structured topic subunits; and encapsulating the topic subunits according to a preset data format to generate and output structured data. The application realizes accurate definition of the action range of key topics through visual-semantic fusion, solves the problem of information fragmentation, and outputs structured data that can be directly reused.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and natural language processing, and in particular to a method, apparatus, and medium for extracting key information from documents and generating structured data. Background Technology

[0002] In knowledge-intensive fields such as finance, consulting, scientific research, and law, technical documents, analytical reports, and due diligence documents are important carriers of unstructured information. These documents typically exist in formats such as PDF, scanned images, and Word documents, with complex content structures including summaries, chapters, charts, lists, and other information organization methods. The information is scattered and the format is inconsistent, making them typical examples of unstructured data. Currently, the analysis of these documents mainly relies on manual reading, extraction, and organization, which is inefficient and difficult to scale, hindering the efficient extraction of information and the accumulation of knowledge.

[0003] Existing automated processing methods have the following technical shortcomings: Semantic gaps in full-text OCR and text extraction: Traditional OCR or full-text text extraction methods can only obtain the text flow of a document and cannot distinguish different types of information units (such as risk descriptions, method descriptions, conclusions and recommendations). Furthermore, they cannot semantically aggregate multiple paragraphs, list items, or cross-page content belonging to the same topic. As a result, the extraction results can only obtain continuous text content, making it difficult to distinguish different types of information units and lacking semantic structure.

[0004] The fragmentation of information in keyword matching: Keyword-based search methods can only return sentences or fragments containing keywords. They cannot intelligently identify and define the complete scope of a topic (such as policy risk), often losing contextual information and disrupting the coherence of the topic's internal logic, making it difficult to support in-depth analysis and knowledge construction.

[0005] Lack of structured output capability: Existing tools cannot organize the extracted information according to a predefined or adaptive logical structure, and cannot output structured formats (such as JSON and XML) that can be directly called by risk management systems, investment decision-making systems or knowledge graphs, thus limiting the secondary use and value mining of data.

[0006] Poor domain adaptability and insufficient robustness to layout: Existing methods are mostly geared towards specific domains or fixed layout designs, lacking the ability to quickly migrate to different vertical domains (such as finance, healthcare, and technology), and also unable to effectively handle the boundary ambiguity caused by complex layouts (such as multi-column layouts, nested lists, and cross-page titles), resulting in a significant decrease in the accuracy of extraction on complex documents. Summary of the Invention

[0007] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows: According to a first aspect of the present invention, a method for extracting key information from a document and generating structured data is provided, comprising the following steps: Multimodal document preprocessing steps: extract text and analyze layout of the input unstructured document to obtain the text unit sequence and the visual and logical structural features of each text unit.

[0008] Key topic location and scope definition steps: Locate anchor text units representing key topics in the text unit sequence, and dynamically define the complete text scope of the key topic corresponding to each anchor text unit based on the visual features and logical structure features. The complete text scope includes the starting and ending text unit indices.

[0009] Content refinement and deconstruction steps: Semantic analysis is performed on the text content within the scope of each complete text to extract structured topic sub-units.

[0010] Structured encapsulation step: The topic sub-units are encapsulated according to a preset data format to generate structured data and output it.

[0011] According to a second aspect of the present invention, an electronic device is provided, including a processor and a memory; the processor executes the steps of the method described in the first aspect of the present invention by invoking a program or instructions stored in the memory.

[0012] According to a third aspect of the present invention, a computer-readable storage medium is provided that stores a program or instructions that cause a computer to perform the steps of the method described in the first aspect of the present invention.

[0013] The present invention provides a method for extracting key information from documents and generating structured data, which has at least the following beneficial effects: Solving the problem of information fragmentation: By defining the boundaries of visual-semantic fusion, we can accurately extract the complete scope of the key topic, ensure the contextual integrity and semantic consistency of information, and break through the limitation of traditional keyword matching that can only return scattered text fragments.

[0014] Achieve end-to-end automation: From document preprocessing, topic positioning, and scope definition to content deconstruction and structured encapsulation, achieve end-to-end automated processing, improve the efficiency of key information extraction, and reduce labor costs.

[0015] Meets downstream business needs: Through standardized encapsulation, it outputs structured data that can be directly called by downstream business systems (such as risk management systems, investment decision-making systems, and knowledge bases), enabling direct reuse and in-depth mining of information.

[0016] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

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

[0018] Figure 1 A flowchart illustrating a method for extracting key information from a document and generating structured data, provided in an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0021] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. A process can be terminated when its operation is complete, but it may also have additional steps not included in the figures. A process can correspond to a method, function, procedure, subroutine, subroutine, etc.

[0022] Example 1 This invention provides a method for extracting key information from documents and generating structured data, such as... Figure 1 As shown, it includes the following steps: S100, Multimodal document preprocessing steps: Extract text and analyze layout of the input unstructured document to obtain the text unit sequence and the visual and logical structural features of each text unit.

[0023] This step aims to transform the input unstructured documents in various formats into a unified sequence of text units rich in visual and logical features, laying the foundation for subsequent key topic positioning and boundary definition.

[0024] (1) Document Receipt and Scope of Application This step begins processing user-uploaded or specified unstructured documents. It should be noted that the unstructured documents mentioned in this invention specifically refer to electronic files containing structured or semi-structured content, such as, but not limited to: technical reports, feasibility analysis reports, due diligence reports, research papers, prospectuses, legal opinions, and other documents with clear thematic divisions and logical hierarchies. While purely free text lacking a clear thematic structure (such as chat logs or short notes) can theoretically be processed, it is difficult to demonstrate the technical advantages of this invention in defining thematic boundaries; therefore, it is not the preferred processing target of this invention.

[0025] (2) Document format recognition and processing path selection Upon receiving a document, the system first identifies its specific format by its file extension (e.g., .pdf, .jpg, .png, .txt, .doc, .docx) or MIME type. Document formats include, but are not limited to, PDF, scanned images (JPG / PNG), plain text (TXT), and Word documents (DOC / DOCX). Based on the identified format type, the system automatically selects the appropriate processing path. For image-based documents (including scanned PDFs): An Optical Character Recognition (OCR) engine (such as PaddleOCR or Tesseract) is used to recognize text on each page. The OCR engine not only outputs the recognized text content but also returns the precise location information of each character, word, or line of text on the page, i.e., the coordinate boxes (top-left corner coordinates (x1, y1) and bottom-right corner coordinates (x2, y2), and records the page number to which the text unit belongs. To improve the accuracy of subsequent processing, the OCR results can be corrected, such as by using a dictionary or language model to correct recognition errors.

[0026] For editable text documents (such as plain text, Word documents, and native PDFs): directly extract the text content from the document. Simultaneously, use document parsing tools (such as python-docx for parsing Word documents and PyPDF2 for parsing native PDFs) to obtain the document's formatting and structural information, including paragraph styles, heading levels (by style name or outline level), indentation (left indent, first-line indent), bullet points, or numbered list identifiers. For plain text files, due to the lack of explicit style information, the logical structure can be preliminarily inferred through heuristic rules (such as blank lines separating paragraphs, leading-line numbers, or symbol detection lists).

[0027] (3) Text unit segmentation and feature integration In this step, the extracted text content is divided into basic text units based on semantic and visual integrity. Text units can be words, lines of text, paragraphs, or list items; the specific granularity can be dynamically adjusted according to document complexity, typically using paragraphs or list items as the basic unit to preserve complete semantics. Each text unit is assigned a globally unique index number (e.g., T1, T2, ..., T...). N (N is the number of text units), and arranged in the natural reading order of the document (from top to bottom, from left to right) to form an ordered sequence.

[0028] For each text unit, the following feature information is integrated: Text content: The original string, retaining the original formatting symbols (such as newline characters and tabs, which can be retained or removed as needed).

[0029] Visual features: Features obtained from layout analysis, including at least: Coordinate frame information: The bounding box of the area where the text unit is located, used for subsequent calculations of visual cues such as indentation and alignment.

[0030] Page numbering: Facilitates handling cross-page content and identifies page boundaries.

[0031] Heading levels: The levels are automatically determined by analyzing font size, bold, style name, or document outline (e.g., H1 is a first-level heading, H2 is a second-level heading, and body text is marked with H∞).

[0032] Indentation: The left indentation value (usually in points pt) calculated based on the left boundary of the coordinate frame or paragraph format, used to distinguish the hierarchical relationship between body text, sub-paragraphs, or list items.

[0033] List item identifier: Marks whether the text unit is a list item (ordered or unordered). If so, it can also record the list nesting level.

[0034] Logical structure features: Features obtained from document structure parsing, including at least: Heading levels: These can corroborate or complement the heading hierarchy in visual features, such as the levels defined by Word styles.

[0035] Indentation: It can be consistent with the indentation in visual features, but logical indentation emphasizes semantic hierarchy, such as the indentation hierarchy of list items.

[0036] (4) Feature normalization and sequence generation To facilitate subsequent calculations, all numerical features (such as indentation) are normalized (e.g., scaled to the 0-1 range), and non-numerical features (such as list item identifiers) are one-hot encoded or mapped to numerical values. Ultimately, each text unit corresponds to a feature vector containing text content, visual features, logical structure features, and a global index. The entire document is represented as an ordered sequence of text units T1, T2, ..., T... N This sequence fully preserves the reading order and internal structure of the document, providing a rich information foundation for subsequent steps.

[0037] Through the above preprocessing, regardless of whether the input document is a scanned image or an editable file, a text unit sequence with a unified format and both visual layout and semantic logic can be obtained, thereby supporting the subsequent definition of key topic boundaries based on visual-semantic fusion.

[0038] S200, Key Topic Location and Scope Definition Steps: Locate anchor text units representing key topics in the text unit sequence, and dynamically define the complete text scope of the key topic corresponding to each anchor text unit based on the visual features and logical structure features. The complete text scope includes the starting and ending text unit indices.

[0039] This step aims to accurately locate key topics in the document based on the text unit sequence with visual and logical features output in step S100, and intelligently define the complete text range covered by each topic, so as to provide high-quality semantic units for subsequent structured deconstruction.

[0040] Anchor points are typically text blocks that summarize or identify the core content of a topic, including but not limited to chapter titles, paragraph topic sentences, and the first sentence of a list item. Anchor point positioning is achieved collaboratively using the following two methods: Thematic thesaurus-based matching and localization: A multi-domain thesaurus is pre-built (e.g., "risk," "opportunity," and "valuation" in finance, and "method," "experiment," and "conclusion" in technology). Text unit content is compared with the thesaurus through string matching or semantic similarity calculation; text units matching the keywords are marked as candidate anchors. Thematic thesaurus-based matching and localization can employ, but is not limited to, the following two methods: a. Exact Match Mode: After segmenting the text unit content into words, perform a string-by-string match with the entries in the thesaurus. A complete match is considered a hit. b. Semantic matching mode: The text unit content and the topic thesaurus entries are encoded into semantic vectors using a pre-trained language model. The cosine similarity between the vectors is calculated. If the similarity exceeds a preset threshold (e.g., 0.7), it is considered a semantic match.

[0041] The two modes can be flexibly selected or used in combination depending on the application scenario.

[0042] Model-based keyword extraction: For domains or documents without a pre-built thesaurus, unsupervised keyword extraction models (such as TextRank and KeyBERT) are used to automatically identify key words or phrases in the document. The text units containing the extracted keywords (such as titles or the first sentence of paragraphs containing the word) are used as candidate anchor points.

[0043] To improve the accuracy of anchor point positioning, candidate anchor points can be sorted and filtered based on the visual features of the text units (such as heading level and bold font), prioritizing visually prominent text units (such as H1 / H2 level headings) as the final anchor points. Let the index of the anchor text unit obtained by positioning be k, and its corresponding topic tag be L. k (For example, "risk"), and the scope of action will be defined based on this anchor point.

[0044] Furthermore, in the key topic positioning and scope definition steps, dynamically defining the scope of the complete text specifically includes: S201, calculate the visual boundary confidence between adjacent text units based on the visual features, and calculate the semantic boundary confidence between adjacent text units based on the text semantics.

[0045] Visual boundary confidence reflects the degree of break in layout between adjacent text units. A higher value indicates a higher probability of a thematic boundary appearing in the visual features. This invention comprehensively considers four key visual features and obtains the visual boundary confidence V(i) at the i-th position (where i ranges from 1 to N-1) through dynamic weighted summation. The calculation formula is as follows: V(i)=w1×△level(i)+w2×△indent(i)+w3×page_break(i)+w4×list_end(i).

[0046] The definitions and quantization rules for each parameter are as follows: Heading level variation coefficient Δlevel(i): Reflects the degree of difference in heading level between adjacent text units. Heading level L i Obtained via S100, values ​​include H0 (document title), H1 (first-level chapter title), H2 (second-level subheading), H3 and below (subheadings), and H∞ (body text). The quantification rules are as follows: If |L i -L i+1 If |≥1 (different levels), then △level(i)=1; if |L i -L i+1 |=0 and L iIf H2 ≤ H2 (same level and core heading), then △level(i) = 0.5; if |L i -L i+1 |=0 and L i If H2 is at the same level and is either a body text or a subheading, then △level(i) = 0.

[0047] Indentation variation coefficient Δindent(i): reflects the magnitude of change in left indentation between adjacent text units. Indentation amount I i The indentation is obtained from the left boundary of the text cell's coordinate frame or document format information, with the unit being points (pt). A threshold I0 for indentation variation is set (base value is 20pt, which can be dynamically adjusted according to document type), and the indentation difference ΔI(i) = |I i -I i+1 |, The quantification rule is: If △I(i)≥I0 (significant change in indentation), △indent(i)=1; if pt≤△I(i)<I0 (slight change in indentation), △indent(i)=0.3; if △I(i)<5×pt (no significant change in indentation), △indent(i)=0.

[0048] Page break factor (page_break(i)): Reflects whether adjacent text units are located on different pages. Page number P i The quantification rule is obtained through step S100: If P i ≠P i+1 (Spanning multiple pages), page_break(i) = 0; if P i =P i+1 (On the same page), page_break(i)=1.

[0049] List item end coefficient list_end(i): Reflects whether the current text unit is the end item of the list item sequence. The type of the text unit (List item / Non-List) is obtained through step S100, and the quantification rule is as follows: If T i Let T be a List i+1 For a Non-List (end of list items), list_end(i) = 1; otherwise (list items not yet finished or not a list item): list_end(i) = 0. Other cases include: if T i Let T be a List i+1 Also a List; T i For a List, regardless of T i+1Is it a List or a Non-List (the current text unit does not belong to the list); i=N, that is, the current is the last text unit, and there are no subsequent text units. In this case, V(i) is not calculated, so it does not need to be considered.

[0050] When T i When a list item is a list item and its next text unit is no longer a list item, it indicates that the list item sequence ends here. This visual layout change often foreshadows the completion of the substructure within the topic, and therefore is given a high feature value of 1.

[0051] All other cases that do not meet the above conditions are considered as having no list item end signal, and the feature value is 0. These cases include: list items are continuous (list not ended), the current text unit is not a list item, and there are no subsequent text units at the boundary position (the latter has been automatically excluded from the calculation range, since the value of i ranges from 1 to N-1).

[0052] Dynamic weight coefficients w1, w2, w3, and w4w: These correspond to the contribution weights of the four visual features mentioned above, satisfying w1 + w2 + w3 + w4 = 1. The weights are not fixed values ​​but are dynamically adjusted based on the document layout complexity coefficient K (K ∈ [0,1], calculated from factors such as the number of text blocks, heading level depth, list item ratio, and number of charts). The specific setting rules are as follows: w1 = 0.45 + 0.05 × K, with a value range of [0.4, 0.5]. w2 = 0.15 + 0.05 × (1 - K), with a value range of [0.15, 0.2]. w3 = 0.3 - 0.05 × (1 - K), with a value range of [0.25, 0.3]. w4 = 0.1 - 0.05 × K, with a value range of [0.05, 0.1].

[0053] Initially, for documents of medium complexity (K=0.5), the weights are w1=0.45, w2=0.15, w3=0.3, and w4=0.1. These weights can be continuously optimized iteratively through the model training module in conjunction with user feedback.

[0054] The above formula can be used to dynamically calculate the visual boundary confidence at each adjacent position based on the actual layout features of the document, providing accurate visual basis for subsequent visual-semantic fusion boundary determination.

[0055] In this invention, the semantic boundary confidence S(i) is used to quantize adjacent text units T. i With T i+1 The degree of semantic shift or the likelihood of a topic change between T and T. A higher value indicates a greater likelihood of a shift in thematic focus. i To T i+1The weaker the semantic coherence, the higher the probability of a topic boundary; conversely, the smaller the value, the stronger the semantic coherence, and the more likely the two belong to the same topic range.

[0056] This invention uses a pre-trained language model to calculate the semantic similarity of adjacent text units, and combines it with a turning point detection model to obtain the semantic boundary confidence score. S(i) = λ × (1 - cos(e) i e i+1 ))+(1-λ)×Smodel(i).

[0057] in: cos(e i e i+1 ) is a text unit T i With T i+1 The cosine similarity of semantic vectors is used to measure the degree of proximity between two semantic vectors. The value of cosine similarity ranges from [-1, 1], but in text semantic similarity calculation, it is usually taken as [0, 1]. The closer the value is to 1, the more similar the semantics are.

[0058] Each text unit is encoded into a semantic vector e of fixed dimension d using a pre-trained language model (such as BERT, RoBERTa, Sentence-BERT, etc.). i ∈R d This vector can capture deep semantic information of text units, including contextual meaning and topic orientation.

[0059] Smodel(i) is the boundary probability output by the pre-trained turning point detection model, used to identify whether there is a chapter-level structural transition between text units (such as topic switching, change of argument direction, from example to summary, etc.). Smodel(i)∈[0,1], and the larger the value, the higher the probability that the model believes there is a topic transition at that position.

[0060] Turning point detection models can employ BERT-based sequence labeling models or document analysis models (such as Transformer models incorporating attention mechanisms), and be fine-tuned on datasets annotated with document structure. The turning point detection model uses text unit sequences T1, T2, ..., T... N As input, output a boundary probability p for each neighboring position i. i ∈[0,1] indicates the possibility of a thematic shift at that position. The input to the shift point detection model can be a sequence of semantic vectors of text units, the original text sequence, or a fusion vector that combines visual features.

[0061] λ is a dynamic balancing parameter, ranging from 0.4 to 0.6, used to balance the weighting coefficients of semantic similarity and the contribution of the inflection point detection model. The dynamic adjustment rule for λ is as follows: When the document has strong semantic coherence (such as professional technical discussions and academic papers): the semantic similarity itself changes slowly, and the chapter structure analysis of the turning point detection model is more valuable. Therefore, the value of λ is biased towards 0.4, which reduces the weight of the semantic similarity term and increases the contribution of Smodel(i).

[0062] When document semantics are clearly fragmented (such as reviews or question-and-answer records with multiple topics mixed together), fluctuations in semantic similarity can better reflect topic switching. Therefore, the value of λ is biased towards 0.6 to increase the weight of semantic difference and decrease the weight of the turning point detection model.

[0063] In the moderate case: the default initial value is set to λ=0.5, and the contributions of the two are balanced.

[0064] The value of λ can be continuously optimized through the model training module, combined with user feedback and multi-domain sample data, to adapt to the semantic characteristics of different types of documents.

[0065] Due to 1-cos(e i e i+1 Since λ ∈ [0,1], Smodel(i) ∈ [0,1], and λ ∈ [0.4,0.6], therefore S(i) ∈ [0,1]. When the value of S(i) approaches 0, it indicates that the semantics of adjacent text units are highly coherent, and the turning point detection model does not identify a turning point, indicating that the two are very likely to belong to the same topic range. When the value of S(i) approaches 1, it indicates that the semantics of adjacent text units are significantly different, or the turning point detection model identifies a strong turning point signal, indicating that there is a very high probability that there is a topic boundary here. The intermediate value needs to be combined with the visual boundary confidence V(i) for comprehensive judgment.

[0066] Semantic boundary confidence can effectively capture the signal of topic switching at the semantic level, providing key semantic basis for subsequent visual-semantic fusion boundary determination, and ensuring the accuracy and robustness of topic scope definition.

[0067] S202, the visual boundary confidence score and the semantic boundary confidence score are combined to obtain a comprehensive boundary score.

[0068] The visual boundary confidence score V(i) and the semantic boundary confidence score S(i) are weighted and fused to obtain the comprehensive boundary score B(i): B(i)=α×V(i)+β×S(i), α+β=1.

[0069] Where α and β are dynamic fusion weights, which are dynamically adjusted according to document type features: If the document layout features are prominent (such as scanned PDF, multi-column layout, complex table), then α should be 0.6 to 0.7 to increase the weight of visual features; If the document is plain text or has a simple layout (such as TXT or Markdown), then β should be set to 0.6-0.7 to increase the weight of semantic features.

[0070] The initial values ​​of α and β are both set to 0.5, and can be continuously optimized through model training module combined with user feedback.

[0071] S203, based on the relationship between the comprehensive boundary score and the dynamic boundary determination threshold, determine whether there is a topic boundary between adjacent text units.

[0072] A dynamic boundary determination threshold θ is set to transform the fused boundary score B(i) into a binary boundary determination result. The value of θ ranges from 0.6 to 0.7, and the specific value is dynamically adjusted according to the complexity of the document layout. When the layout is complex (K>0.6), θ is lowered to 0.6 to reduce the threshold for boundary judgment and avoid missing the theme boundary in cross-page or complex nested structures; When the layout is simple (K < 0.4), θ is increased to 0.7 to raise the judgment standard and reduce false boundary misjudgments; For medium complexity (0.4≤K≤0.6), θ takes the median value of 0.65.

[0073] The boundary determination rule is: if B(i) ≥ θ, then determine position i (i.e., T). i With T i+1 (Between) there must be a topic boundary; otherwise, it is considered as having no boundary. i With T i+1 They belong to the same topic and scope.

[0074] To improve the accuracy of the judgment, the system can introduce a title level constraint as an auxiliary judgment condition: if T i+1 If the heading level is significantly lower than the heading level of the current topic (e.g., from H1 to body text), even if B(i) is slightly below the threshold, it can still be determined as a boundary based on the context. Conversely, if the heading level does not decrease significantly, even if B(i) is slightly above the threshold, the boundary determination can be temporarily suspended to avoid misjudging the separation within a list item or between sub-paragraphs as a topic boundary.

[0075] In this invention, the main functions of the model training module are as follows: Data collection: Automatically collects user feedback data on the output results during use, including but not limited to: Users rate the extracted results (e.g., "correct", "incorrect", "partially correct").

[0076] User-defined manual adjustments to topic boundaries (such as adjusting the start / end point of the scope).

[0077] Users can supplement or modify structured fields (such as adding missing entities or correcting incorrect relationships).

[0078] Model optimization: Based on the collected feedback data, multiple models are retrained or fine-tuned, including: The character recognition model of the OCR engine (improving the recognition rate for specific fonts or layouts).

[0079] Pre-trained language models (such as BERT) and inflection point detection models are used in semantic boundary confidence calculation.

[0080] Named Entity Recognition (NER) model (improves the accuracy of domain entity extraction).

[0081] Dynamic weight parameters include w1-w4 in visual boundary confidence, λ in semantic boundary confidence, fusion weights α and β, and dynamic boundary determination threshold θ. These parameters are not static but are iteratively tuned on feedback data using built-in optimization algorithms (such as Bayesian optimization, reinforcement learning, or gradient-based parameter search) to gradually bring the overall system performance closer to the optimal level.

[0082] Iterative Process: Forming a closed loop of "processing → feedback → training → update". For example, after a user repeatedly corrects the topic boundaries of a certain type of document, the module will identify the pattern and automatically adjust the default values ​​of α and β or dynamically adjust the rules, thereby obtaining more accurate boundary determination when processing similar documents in the next time.

[0083] S204, using the anchor text unit as a reference, and combining it with the topic boundary, determine the complete text scope of the key topic.

[0084] The anchor text unit T located in step S201 k Based on this, and combined with the topic boundary position determined in step S203, the complete text scope [start, end] of the key topic corresponding to this anchor point is determined, according to the following rules: Starting boundary determination: Search left (forward) from anchor point index k to find the first position b that is determined to be the topic boundary. left (i.e. B(b)) left )≥θ and b left If <k), then the topic starting index start=b left +1. If there is no left margin, then start=1 (document start position).

[0085] End boundary determination: Starting from anchor index k, search to the right (backwards) to find the first position b that is determined to be the topic boundary.right (i.e. B(b)) right )≥θ and b right If k ≥ k, then the topic end index end=b right If there is no right margin, then end = N (end position of the document).

[0086] To prevent boundary judgment errors from causing the scope of application to be too wide or too narrow, a heading level constraint can be introduced for correction: if the heading level of the text unit corresponding to the start position is significantly lower than the anchor point level (e.g., the anchor point is H1 and the start is H3), then the scope is extended forward to the previous sibling heading as the starting point; if the heading level of the next text unit corresponding to the end position is the same as the anchor point (e.g., both are H1), then the end is explicitly defined as before the appearance of that sibling heading.

[0087] Finally, step S200 outputs a set of {topic tags:[T start T start+1 ,…,T en The mapping set of d]}, where each topic corresponds to a continuous and semantically complete sequence of text units, provides high-quality input for subsequent content refinement and deconstruction.

[0088] By using the aforementioned visual-semantic fusion boundary definition method, this invention overcomes the shortcomings of traditional keyword matching in failing to perceive the complete scope of the topic, and achieves accurate and complete extraction of key topics in documents, ensuring the contextual coherence and semantic consistency of information.

[0089] S300, Content Refinement and Deconstruction Steps: Semantic analysis is performed on the text content within the scope of each complete text to extract structured topic sub-units.

[0090] This step aims to perform refined analysis of the text content within the key topic scope identified in step S200, transforming it into structured topic sub-units. To achieve rapid adaptation and accurate parsing of documents from different domains, this step first performs domain-adaptive template matching, then deconstructs the content based on the matched template, and dynamically adjusts the template parsing rules according to document layout characteristics. Specifically, it includes the following sub-steps: S301, Domain-Adaptive Template Matching Before refining and deconstructing the content, it is necessary to match the most suitable domain template for the current document to ensure that the parsing rules match the document's topic type.

[0091] (1) Template library construction A pre-built, multi-domain general-purpose template library is provided, and each template contains the following core elements: Domain identifiers: such as finance, healthcare, technology, law, etc.

[0092] Dedicated keyword set: Key keywords that frequently appear in documents in this field, such as "risk," "opportunity," "valuation," and "mitigation measures" in the financial field; and "indications," "adverse reactions," and "clinical trials" in the medical field.

[0093] Parsing rules: Predefined field mapping and extraction rules for each topic. For example: The "Risk" topic requires extracting entities such as "Risk Type", "Description", "Manifestation", and "Severity". The topic "Experimental Methods" requires the extraction of entities such as "Equipment", "Parameters", "Process", and "Conclusions". The "Legal Clauses" topic requires extracting entities such as "Clause Number," "Content," and "Effective Date."

[0094] Default parameters: Initial thresholds for each parsing rule, such as entity recognition threshold (default 0.7), list splitting threshold (default 0.5), etc.

[0095] Domain weight: Reflects the maturity and credibility of the domain corresponding to the template. The value range is 0.6 to 1.0. It can be preset according to actual application experience. For example, the template weight in the financial domain is set to 0.9, and the template weight in the medical domain is set to 0.85.

[0096] The template library allows users to add new templates or modify existing templates to adapt to ever-changing business needs.

[0097] (2) Document domain recognition and template matching Based on the text unit sequence obtained after preprocessing in step S100, document domain identification and optimal template matching are performed. The specific process is as follows: a. Constructing a document keyword feature vector: Extract global keywords from the document and calculate the weight of each keyword using the TF-IDF algorithm. Let the total number of keywords be m, and construct a document keyword feature vector F = [F1, F2, ..., F...]. j , ..., F m ], where F j Let be the TF-IDF value of the j-th keyword, where j ranges from 1 to m.

[0098] b. Construct template feature vectors: Traverse all domain templates in the template library. For each template p, construct a template feature vector T corresponding to the document keywords based on its exclusive keyword set. p =[t1, t2, ..., t j , ..., t m ], where t j Indicates whether the j-th keyword in the document belongs to the topic term set of this template: if it does, then t j =1, otherwise t j =0.

[0099] c. Calculate template matching degree: Calculate the matching degree M(p) between the document and each domain template by using cosine similarity and multiplying it by the domain weight: M(p) = (F·T) p T ) / (||F||·||T p ||)×w p .

[0100] Among them, w p For the neighborhood weights of template p, F·T p T Let ||F|| and ||T|| be the dot product of the document keyword feature vector and the template feature vector. p || represents the magnitudes of the two vectors.

[0101] d. Select the best template: Select the template with the highest matching degree as the candidate template. Let the highest matching degree be Mmax, and the preset matching threshold μ=0.5 (which can be dynamically adjusted according to actual application). If Mmax≥μ, then the template for that domain is matched; otherwise, it is considered that the document domain is not within the preset template range, a general template is used, and the process proceeds to the subsequent dynamic template adjustment stage.

[0102] S302: Template Dynamic Adjustment To adapt to the specific document layout characteristics, the parameters of the matched template parsing rules are dynamically adjusted to improve parsing accuracy.

[0103] (1) Extract document layout features Based on the text unit information obtained in step S100, the layout feature vector L = [L1, L2, L3, L4] is calculated, and each component is defined as follows: L1: Normalized value for the number of text blocks, reflecting the size of the document. The calculation formula is L1=Q / Qmax, where Q is the actual number of text blocks, Qmax is the preset maximum reference value (e.g., 1000), and if Q>Qmax, then L1=1.

[0104] L2: Heading level depth, which is the maximum number of heading levels (e.g., H1~H3) in the document, reflecting the complexity of the document structure. For example, if the document contains three levels of headings, H1, H2, and H3, then L2=3.

[0105] L3: List item percentage, which is the proportion of list item text blocks to the total number of text blocks. The formula is L3=Q list / Q, where Q list This represents the number of text blocks for each list item.

[0106] L4: Normalized value of the number of charts. The calculation formula is L4=C / Cmax, where C is the actual number of charts and Cmax is the preset maximum reference value (e.g., 20). If C>Cmax, then L4=1.

[0107] (2) Calculate the template adjustment coefficient The template adjustment coefficient η is calculated using a linear weighting method: η=k1+k2×(L1×a1+L2×a2+L3×a3+L4×a4).

[0108] in: η: Template adjustment coefficient, used to dynamically adjust the strictness of the parsing rules, with a value range of [k1, k1+k2]; k1: Basic offset coefficient, ensuring the minimum value of η; k2: Scaling factor, which controls the extent to which layout features affect η; a1, a2, a3, a4a: Weight coefficients corresponding to each layout feature, satisfying a1+a2+a3+a4=1, used to reflect the importance of different layout features to the adjustment of parsing rules.

[0109] In one illustrative embodiment, the coefficients are set as follows: The basic offset coefficient k1 = 0.8; Scaling factor k2 = 0.2; The layout feature weight coefficients are a1=0.3 (corresponding to the number of text blocks), a2=0.4 (corresponding to the depth of the heading level), a3=0.2 (corresponding to the proportion of list items), and a4=0.1 (corresponding to the number of charts).

[0110] With this coefficient setting, the value range of η is [0.8, 1.0]. Specifically: When the document layout is extremely simple (such as short text, no heading levels, no lists or charts), L1-L4 all approach 0, and η≈0.8; When the document layout is extremely complex (such as long documents, multi-level headings, and a large number of lists and charts), L1-L4 all approach 1, at which point η≈1.0; Generally, η increases linearly in the range [0.8, 1.0] as the layout complexity increases.

[0111] The physical meaning of η: The larger η is, the more complex the document layout (such as long length, deep heading levels, and many lists and charts). In this case, the text structure may be more loose or nested, so the parsing rules should be appropriately relaxed (such as lowering the entity recognition threshold and increasing the sensitivity of list splitting) to improve the recall rate. The smaller η is, the simpler the document layout and the clearer and more regular the text structure. In this case, the parsing rules should be more stringent (such as increasing the entity recognition threshold and lowering the sensitivity of list splitting) to improve the accuracy and reduce false recognition.

[0112] The above coefficients can be adjusted according to the actual application scenarios and domain characteristics, or they can be iteratively optimized based on user feedback data to make the calculation of η more in line with the actual needs of specific document types.

[0113] (3) Dynamically adjust the parsing rule parameters Based on the adjustment coefficient η, the preset parsing rule parameters in the template are dynamically corrected: Entity recognition threshold: New threshold = base threshold × η (base threshold defaults to 0.7). Increasing the threshold can reduce false recognition, while decreasing the threshold can increase recall. List splitting threshold: New threshold = base threshold ÷ η (base threshold defaults to 0.5). Threshold adjustment is used to control the sensitivity of list item splitting. Lowering the threshold can make the splitting more granular. Other adjustable parameters, such as the confidence threshold of the NER model and sentence segmentation parameters, can be adjusted according to η using similar rules.

[0114] The adjusted parameters will be applied to the subsequent content parsing process. If a specific domain template is not matched in step S301 and a general template is enabled, the parsing rule parameters of the general template will also be adjusted in the same way as described above.

[0115] S303: Content Refinement and Deconstruction For the scope text of each key topic obtained in step S200, the matching and adjusted template parsing rules are applied to perform refined parsing and form structured topic sub-units.

[0116] (1) Entity extraction The system invokes a Named Entity Recognition (NER) model to extract core entities from the target text based on the entity types defined in the template. The NER model can be a pre-trained general model (such as BERT-based NER) or a domain-specific fine-tuned model. During extraction, the system filters low-confidence recognition results based on an adjusted entity recognition threshold. The extracted results include entity text and its type label. For example, for the topic of "risk," entities such as "policy risk" (risk type) and "high" (severity) might be extracted.

[0117] (2) List item splitting If the scoped text contains a list structure, the text is split into independent list items based on the list item identifiers (such as bullet points or numbers) or indentation features obtained in step S100. Each item is treated as an independent semantic unit, which can be extracted as an entity separately later. For example, in the list items following "The main features include:", each list item (such as "subsidy reduction") will be split into an independent unit.

[0118] (3) Semantic completion and information integration For entities that are predefined in the template but not directly extracted, they are completed or inferred through contextual semantic analysis. For example, if the "severity" field is missing, but keywords such as "significant impact" or "minor" appear in the text, the value of this field can be supplemented through rules or a pre-trained semantic inference model. The extracted entities and split list items are organized according to the fields defined in the template to form structured topic sub-units.

[0119] (4) Entity integrity verification To ensure that the extraction results are complete and error-free, calculate the entity integrity check value C: C=N extracted / N standard ×100%.

[0120] in: N extracted The actual number of entities extracted (statistics based on the required fields defined in the template); N standard The number of entities to be extracted for this theme as preset for the template (number of required fields).

[0121] If C is greater than or equal to a preset value, such as 90%, the extraction result is considered acceptable; if C is less than the preset value, the following optimization process is triggered: Readjust the parsing rule parameters (e.g., further reduce the entity recognition threshold); Alternatively, the NER model can be called again for secondary extraction.

[0122] Through the steps described above, the scope text for each key topic is decomposed into structured topic sub-units, each containing a set of predefined fields and their corresponding values. For example, for the topic "risk," the structure might look like this: { "topic_label": "risk" “content_units”: [ { "risk_category": "Policy risk" "description": "The policy risks are mainly manifested as subsidy reduction and increased access thresholds.", "manifestations": ["Subsidy reduction: It is estimated that the subsidy will be reduced by 30% in 2025", "Increased access thresholds: The new national standard requires a battery energy density of ≥180 Wh / kg"], "severity": "High" } { "risk_category": "Market risk", "description": "Market risks stem from demand fluctuations and price competition.", "manifestations": ["Demand fluctuations: Affected by the economic cycle", "Price competition: Leading enterprises reduce prices to squeeze profits"], "severity": "Medium" } }

[0123] All the theme sub-units form the input for the subsequent step S400 (Cross-topic entity relationship association and structured encapsulation), laying the foundation for the final generation of directly reusable structured data.

[0124] S400, Structured encapsulation step: Encapsulate the theme sub-units according to a preset data format, generate structured data and output.

[0125] The purpose of this step is to identify cross-topic relationships for each theme sub-unit deconstructed in step S300, and perform standardized encapsulation on the results, outputting structured data that can be directly called by downstream business systems (such as risk management systems, investment decision-making systems, knowledge bases). It specifically includes the following sub-steps: S401: Cross-topic entity relationship identification To explore the internal associations between different themes in the document, it is necessary to identify the logical relationships existing between theme sub-units (such as the corresponding relationship between "risks" and "mitigation measures", the causal relationship between "experimental methods" and "experimental conclusions", the subordinate relationship between "legal provisions" and "exceptional situations", etc.). The specific implementation process is as follows: (1) Theme sub-unit identification and entity extraction First, assign a unique association identifier ID = [id1, id2,..., id z , where z is the total number of theme sub-units. Each theme sub-unit contains its theme label, scope of action, and the extracted structured fields.

[0126] ​Then, extract the core entities from each thematic sub-unit and construct the entity set E=[e1, e2, ..., e u ], where u is the total number of entities. Core entities are typically entities that can represent key information of the sub-unit of the topic, for example: For the "Risk" sub-unit, the core entities include risk types (such as "policy risk") and affected objects (such as "project benefits"); For the sub-unit "Mitigation Measures", the core entities include the type of measure (such as "Policy Risk Mitigation Measures") and the corresponding risks (such as "Policy Risk").

[0127] Entity extraction can be performed by directly using the output of the NER model in step S303, or by extracting based on the core fields preset in the template.

[0128] (2) Entity semantic vectorization Each entity is transformed into a fixed-dimensional semantic vector using a pre-trained language model (such as Sentence-BERT). This vector captures the deep semantic information of the entity, laying the foundation for subsequent similarity calculations.

[0129] (3) Cross-topic entity semantic similarity calculation For any two different thematic sub-units, entity e a and e b Cosine similarity is used to measure their semantic closeness S(e). a e b The similarity value ranges from [0, 1], with a larger value indicating a more similar semantic relationship.

[0130] (4) Determination of association Set the association threshold γ (default value is 0.7, which can be dynamically adjusted according to domain characteristics or user feedback). If S(e a e b If ) ≥ γ, then entity e is determined. a and e b There are potential connections between them, which leads to the determination that there are connections between the thematic sub-units to which they belong.

[0131] To improve the accuracy of association determination, the following auxiliary strategies can be combined: Contextual semantic verification: Input the complete text of two topic sub-units into a pre-trained semantic matching model, calculate the overall semantic similarity, and use it as an auxiliary judgment criterion to eliminate false associations caused by coincidental entity similarity; Rule constraints: Based on domain knowledge, preset association types (such as "corresponding mitigation", "causal association", "subordinate association") and establish association rules (for example, the association between the "risk" topic and the "mitigation measures" topic usually requires similar risk type names) to filter the initially determined associations; Same-reference resolution: The entity is resolved by referencing the same entity, ensuring that "policy risk" and "the risk" refer to the same entity.

[0132] (5) Constructing cross-topic relationship networks Record all valid association relationships to form an association record containing the following information: Source topic sub-unit identifier id src ; Target topic sub-unit identifier id tgt ; Association type (e.g., "corresponding mitigation", "causal association", "dependent association"); Association strength (optional, can be represented by similarity values).

[0133] Integrate all relationships to build a cross-topic relationship network, providing relationship data for subsequent structured encapsulation.

[0134] S402: Data Cleaning and Normalization To ensure the consistency and usability of the output data, the content of the topic sub-units obtained in step S300 and the correlation relationships identified in step S401 are cleaned and normalized: Standardized format: Dates should be standardized to a standard format (e.g., YYYY-MM-DD), numbers should retain a specified number of decimal places, and units should be standardized to international standard units or preset commonly used units; Invalid information removal: Remove redundant spaces and special characters from the text, and filter out obviously erroneous entity recognition results (such as non-entities that are too short or too long). Numerical normalization: For numerical fields requiring quantitative analysis, the min-max normalization method is used to map them to the [0, 1] interval. x norm =(xx min ) / (x max -x min ).

[0135] Where x is the original value, x min and x max These are the minimum and maximum values ​​(or preset global reference values) of this type of value in the document. The normalized values ​​facilitate cross-document comparative analysis by downstream systems.

[0136] S403: Structured Package The cleaned thematic sub-units and their relationships are encapsulated according to a preset data format to generate the final structured data.

[0137] (1) Define the encapsulation format The system supports multiple standardized data formats, including JSON, XML, and CSV, which users can choose or customize according to their needs. Taking JSON format as an example, the encapsulation structure includes the following four main modules: Basic report information includes metadata such as document title, processing timestamp, and unique document identifier; Extract the topic set: List all identified key topics and their scope; Subject Sub-cell Details: Structured fields and their values ​​for each subject sub-cell, organized by subject group; Cross-topic relationships: The relationship network constructed in step S401 is presented in list form.

[0138] (2) Data assembly Following the above format, fill in the topic sub-units and relationships item by item. For example, for the new energy project report in Example 1, the encapsulated JSON structure contains two sub-units of the "Risk" topic (policy risk, market risk), two sub-units of the "Risk Mitigation Measures" topic (policy risk mitigation measures, market risk mitigation measures), and the "corresponding mitigation" relationships between them.

[0139] (3) Integrity verification To ensure that there are no missing modules in the packaged data, calculate the package integrity check value B: B=M complete / M total ×100%.

[0140] in: M complete This represents the actual number of modules that are fully populated. M total The preset total number of modules (such as four major modules: basic report information, topic collection, topic sub-unit details, and relationship, each of which contains several required fields).

[0141] The requirement is that B=100%, meaning all preset modules and required fields are fully filled. If B<100%, the completion process is triggered: missing modules are checked, default values ​​are added, or data is retrieved again from steps S300 / S401 until the completeness requirement is met.

[0142] S404: Structured Data Output The data output interface allows you to generate files (such as .json, .xml, .csv) from the encapsulated structured data in a specified format or write them directly to the target database. The output data also includes metadata such as timestamps, document identifiers, and system version numbers for easy tracking and management.

[0143] The final structured data output can be directly used by downstream business systems, enabling rapid information reuse and in-depth data mining. For example, the risk management system can directly read the severity field of the "risk" topic to generate a risk dashboard, and the investment decision-making system can use the correlation of "risk mitigation measures" to conduct scenario analysis.

[0144] This embodiment uses a PDF technical analysis report on "Investment in a New Energy Project" as the processing object. It employs the method of this invention to extract key thematic information such as "risks" and "mitigation measures," and generates structured data. The specific steps are as follows: Step 1: Multimodal document preprocessing and feature extraction The input PDF report undergoes OCR recognition (using the PaddleOCR engine) and layout analysis. The text content and feature information of all text units (including paragraphs, headings, and list items) are extracted, including: Text content: raw string; Visual features: coordinate frame, page number, indentation, list item identifier; Logical structure features: heading level (inferred from font size and style).

[0145] All text units are globally numbered according to the normal reading order of the document, generating an index sequence T1, T2, ..., T... 30 The key text units include: T 10 Title: "III. Potential Risk Analysis", heading level H1; T 11 Risk overview paragraph, main text; T 12 Subheading "3.1 Policy Risks", H2 level; T13-T 15 Policy risks are listed under sub-items (such as "subsidy reduction" and "increased entry barriers"). T 16 Subheading "3.2 Market Risks", H2 level; T 17 -T 19 Market risk is a sub-item in the list; T 20 Title: "IV. Risk Mitigation Measures", H1 level; T21 -T 29 Subordinate paragraphs and list items.

[0146] Each text unit contains the original string, coordinate information, logical structure information, and a global index i.

[0147] Step 2: Key Theme Identification and Dynamic Definition of Scope The KeyBERT algorithm is used to extract key keywords from documents, and combined with a financial thesaurus (containing terms such as "risk," "opportunity," and "mitigation measures"), anchor text units for two core themes are located: "Risk" theme anchor: T 10 (Title: "III. Potential Risk Analysis") "Risk Mitigation Measures" Theme Anchor: T 20 (Title: "IV. Risk Mitigation Measures")

[0148] The visual-semantic fusion boundary delineation method proposed in this invention is used to determine the complete text scope corresponding to each anchor point: First, the visual boundary confidence (integrating four features: title level change, indentation change, page boundary, and list item end) and semantic boundary confidence (based on semantic similarity and inflection point detection model using a pre-trained language model) are calculated between adjacent text units; then, a comprehensive boundary score is obtained by fusion and compared with a dynamic threshold to determine the boundary position. Anchor point T is used as an example. 10 Based on this, expanding left and right, the scope of the "risk" topic is [10, 19], which includes T. 10 To T 19 All text units (covering a complete discussion of policy risks and market risks); anchored by T 20 Based on this, the scope of the "risk mitigation measures" topic is [20, 29], which includes T. 20 To T 29 All text units.

[0149] Step 3: Domain-Adaptive Template Matching and Content Refinement Deconstruction 3.1 Template Library Call It includes a pre-set template library covering multiple fields, with financial templates containing specific keywords (such as "risk," "mitigation measures," and "valuation") and corresponding parsing rules. For example: The rules for analyzing the "risk" topic are as follows: entities such as "risk type", "description", "manifestation form" and "severity" must be extracted; The "Risk Mitigation Measures" topic analysis rules require extracting entities such as "Measure Type," "Corresponding Risk," and "Implementation Path." The domain weight for this template is preset to 0.9.

[0150] 3.2 Document Domain Recognition and Template Matching Global keywords (such as "new energy projects," "investment," "risk," and "subsidy phase-out") are extracted from the preprocessed document. The TF-IDF value of each keyword is calculated to construct a document keyword feature vector. A set of specific topic terms for the financial domain template is extracted to construct a template feature vector. The matching degree between the document and the template is calculated by multiplying the cosine similarity by the domain weight. Substituting the numerical value, the matching degree is 0.85, which is greater than the preset threshold of 0.5. Therefore, the document matches the financial domain template.

[0151] 3.3 Dynamic Template Adjustment Extract the document's layout features: 30 text blocks, 3 heading levels, approximately 23.3% list items, and 2 charts. The adjustment coefficient η = 0.88 was calculated using the template adjustment coefficient formula. Based on η, the parsing rule parameters were adjusted: the entity recognition threshold was adjusted to the original base threshold multiplied by 0.88, and the list splitting threshold was adjusted to the original base threshold divided by 0.88, to adapt to the document's layout characteristics.

[0152] 3.4 Content Refinement, Deconstruction, and Verification The adjusted template parsing rules are applied to parse the text within the scope [10,19] of the "risk" theme: the NER model is called to extract risk types such as "policy risk" and "market risk," and their corresponding manifestations such as "subsidy reduction" and "increased entry barriers," and the severity is inferred from the context as "high" and "medium," respectively. The list items are then split, with each item treated as an independent sub-unit.

[0153] Similar analysis was performed on the text within the scope of the theme "Risk Mitigation Measures" [20,29], extracting the types of measures such as "Policy Risk Mitigation Measures" and "Market Risk Mitigation Measures", the corresponding implementation paths such as "Closely Monitor Policy Dynamics", and establishing a corresponding relationship with the corresponding risks.

[0154] Calculated using the entity integrity verification formula, the entity extraction integrity of both topics reaches 100% (all fields that should be extracted are pre-defined), meeting the requirement of greater than or equal to 90%, thus forming a structured topic sub-unit.

[0155] Step 4: Cross-topic entity relationship association and structured encapsulation 4.1 Cross-topic relationship identification Assign unique IDs to the four thematic sub-units: id1: Policy risk; id2: Market risk; ID3: Policy risk mitigation measures; id4: Market risk mitigation measures.

[0156] Extract the core entities of each sub-unit (e.g., "policy risk" and "policy risk mitigation measures"), and convert each entity into a semantic vector using a pre-trained language model. Calculate the cross-topic entity semantic similarity (cosine similarity). For example, the entity similarity between "policy risk" and "policy risk mitigation measures" is 0.82, which is greater than the preset association threshold of 0.7, indicating a relationship between them, classified as "corresponding mitigation." Similarly, the similarity between "market risk" and "market risk mitigation measures" is 0.78, also classified as "corresponding mitigation." Construct a cross-topic relationship network to record the above relationships.

[0157] 4.2 Data Cleaning and Normalization The numerical information was processed uniformly: the 30% reduction in subsidies was extracted to the value 0.3, and the 180 in battery energy density ≥180Wh / kg was extracted to the value. Then, minimum-maximum normalization was performed according to the range of these values. This standardized format ensured data consistency.

[0158] 4.3 Structured Packaging and Verification The data is encapsulated according to a preset JSON format, comprising four main modules: basic report information, extracted topic sets, topic sub-unit details, and cross-topic relationships. Calculations using the encapsulation integrity verification formula show that all modules are fully populated, achieving 100% integrity, and the encapsulation is deemed successful.

[0159] Step 5: Structured Data Output The final output is structured data in JSON format, part of which is shown below: { "report_title": "Investment Analysis Report for a New Energy Project" “extracted_topics”: [ { "topic_label": "Risk", "scope": [10, 19], “content_units”: [ { "risk_category": "Policy risk" “Description”: “Policy risks mainly manifest as subsidy reduction and increased entry barriers.” "manifestations": ["Subsidy reduction: Subsidies are expected to decrease by 30% by 2025", "Higher entry threshold: New national standard requires battery energy density ≥180Wh / kg"] “severity”: “high” }, { "risk_category": "Market risk", "description": "Market risk stems from demand fluctuations and price competition.", "manifestations": ["Demand fluctuations: affected by the economic cycle", "Price competition: leading companies lower prices to squeeze profits"], "severity": "Medium" } }, { "topic_label": "Risk mitigation measures", "scope": [20, 29], "content_units": { "measure_category": "Policy risk mitigation measures", "corresponding_risk": "Policy risk", "implementation_path": ["Closely monitor policy dynamics and adjust project plans in a timely manner", "Strengthen communication with industry regulatory authorities and seek policy support"] }, { "measure_category": "Market risk mitigation measures", "corresponding_risk": "Market risk", "implementation_path": ["Expand diversified sales channels to reduce the impact of demand fluctuations", "Optimize product costs and enhance market competitiveness"] } } , "topic_relations": { "source_topic": "Policy risk", "target_topic": "Policy risk mitigation measures", "relation_type": "Corresponding mitigation" }, { "source_topic": "Market risk",​​ “target_topic”: “Market risk mitigation measures” "relation_type": "Corresponding mitigation" } ] }

[0160] This embodiment fully demonstrates the application of the method of the present invention in technical reports in the financial field. Through multimodal preprocessing, visual-semantic fusion boundary definition, domain-adaptive template parsing, cross-topic relationship association, and structured encapsulation, the system successfully extracts complete discourse content on the two key topics of "risk" and "risk mitigation measures" from unstructured PDF reports and transforms them into JSON structured data rich in semantic tags and relationships. This data can be directly used by downstream business systems such as risk management systems and investment decision-making systems, verifying the technical effectiveness of the present invention in solving information fragmentation, improving domain adaptability, and achieving full-process automation.

[0161] In summary, the present invention has at least the following beneficial effects: 1. Improve the problem of information fragmentation By employing a visual-semantic fusion boundary definition method, this invention achieves the extraction of the complete scope of discussion on key themes. Taking the new energy project investment analysis report in Example 1 as an example, traditional keyword matching methods can only return scattered sentences related to "risk," making it difficult to aggregate the complete discussion of "policy risk" (including definition, manifestation, and severity). This invention, by integrating visual features such as title hierarchy, indentation variations, and page boundaries with semantic coherence analysis, defines the scope of the "risk" theme as text block indices 10 to 19, fully encompassing all relevant content such as the overview of policy risk and market risk, subheadings, and list items, ensuring the contextual integrity and semantic consistency of the information. This method aggregates the complete scope of discussion on the "risk" theme, avoiding the fragmented problem of traditional keyword matching methods that can only return scattered sentences.

[0162] 2. Improve domain adaptability By employing a domain-adaptive template matching and dynamic adjustment mechanism, this invention can adapt to the technical document processing needs of different vertical fields without requiring extensive manual rule customization. In Example 1, by matching the TF-IDF keyword feature vector with a financial domain template, the document's domain is identified as financial, with a matching degree of 0.85. The parsing rules of the financial domain template are then automatically invoked (e.g., for the "risk" topic, entities such as "risk type," "description," "manifestation," and "severity" are extracted). Simultaneously, based on the document's layout features (30 text blocks, 3 heading levels, 25% list items, and 2 charts), an adjustment coefficient η=0.88 is dynamically calculated to adapt the entity recognition threshold, ensuring the strictness of the parsing rules matches the document's layout features. This dynamic adaptability allows the invention to be transferred to other fields such as medicine, law, and technology, improving its generalization ability compared to traditional fixed-rule methods.

[0163] 3. Achieve end-to-end automation This invention constructs a complete automated processing chain, from document preprocessing, topic localization, and scope definition to content deconstruction, relationship association, and structured encapsulation. In Example 1, after receiving the original report in PDF format, a series of processes can be automatically completed without human intervention, including OCR recognition, layout analysis, key topic localization, visual-semantic fusion boundary definition, domain template matching, entity extraction, list splitting, and cross-topic relationship recognition, ultimately generating directly usable JSON structured data. The entire process automates the conversion from unstructured raw documents to structured data, improving the efficiency of key information extraction and reducing the cost and time consumption of manual reading, extracting, and organizing.

[0164] 4. Meet the needs of downstream businesses. Through cross-topic entity relationship association and standardized encapsulation, the structured data output by this invention can be directly called by downstream business systems. In Example 1, not only are two risk sub-units, "policy risk" and "market risk," extracted, but the "corresponding mitigation" relationships between "policy risk" and "policy risk mitigation measures," and between "market risk" and "market risk mitigation measures," are also automatically identified through entity semantic similarity calculation (similarity 0.82). The final output JSON data contains complete basic report information, a set of topics, details of topic sub-units (including structured fields such as risk type, description, manifestation, and severity), and cross-topic relationships. This structured data, rich in semantic tags and relationship networks, can be used by risk management systems to generate risk dashboards, by investment decision-making systems for scenario analysis, or by knowledge bases for knowledge graph construction, realizing direct reuse and in-depth mining of information.

[0165] In summary, this invention can systematically improve the problems of low efficiency in extracting unstructured document information, fragmented information, inability to generate structured data, and poor domain adaptability in the prior art, and has technological progress and practical value.

[0166] Example 2 To further improve the accuracy of defining the scope of a topic in complex documents (such as technical reports containing numerous charts, formulas, and tables), in another embodiment of the present invention, the dynamic definition of the scope of the complete text further includes the following optimization steps: (1) Multimodal unit inclusion and feature extraction Based on step S100, the definition of the text unit sequence is expanded to include non-text elements in the document (such as charts, tables, and formulas) within the processing scope. Specifically: Chart Unit: For visual elements such as images and flowcharts in the document, text descriptions are generated using image description models (such as BLIP and GPT-4V), and their layout position information is extracted and added to the sequence as a special "chart text unit"; Table Unit: The table structure is extracted using a table recognition model, and the table header, row and column content are converted into structured text representations while preserving the overall visual boundaries of the table. This is then added to the sequence as a "table unit". Formula Unit: Mathematical formulas are converted into LaTeX representations or natural language descriptions through formula recognition models (such as LaTeX-OCR) and added to the sequence as a "formula unit".

[0167] The aforementioned multimodal units, together with ordinary text units, constitute the extended text unit sequence T11, T12, ..., T1 N Each unit contains text content, visual location information, and type identifiers (text / chart / table / formula).

[0168] (2) Long-distance semantic similarity calculation Considering that thematic arguments may span multiple units (e.g., a passage quoting the conclusions of a chart from a previous text), this invention introduces long-distance semantic similarity as a correction term for semantic boundary confidence. For each anchor text unit T k Calculate its relationship with subsequent non-adjacent units T. r The semantic similarity (r > k+1, where r ranges from 1 to N) is calculated, and the long-distance semantic similarity Slong(k, r) is defined, taking into account the text span length between the two pairs: Slong(k, r) = cos(e k e r ) / (1+log(rk)).

[0169] Wherein, cos(ek e r The cosine similarity is denoted as rk, and the denominator 1 + log(rk) is used to attenuate the distance; the greater the distance, the smaller the contribution. If there are multiple highly similar non-adjacent units, it indicates that the topic may extend far, and the tendency to determine the boundary at intermediate positions should be reduced.

[0170] By incorporating long-distance semantic similarity into the calculation of semantic boundary confidence S(i), the modified formula is as follows: SC(i)=λ×(1-cos(e i e i+1 ))+(1-λ)×Smodel(i)+b×(1-max{Slong(i,r) r>(i+1)}).

[0171] Where b is the long-distance correction weight (default 0.1), and the last term indicates: if T i If there is a strong semantic association with subsequent distant units, then position i should not be judged as a boundary, i.e., SC(i) should be reduced.

[0172] (3) Multimodal visual correlation fusion When calculating the fusion boundary score B(i), the visual correlation coefficient γ(i) of multimodal features is simultaneously incorporated. This coefficient reflects the correlation strength between adjacent units at the multimodal level. For example: If T i For chart units and T i+1 For explanatory text, γ(i) takes a higher value (e.g., 0.8); If T i For table cells and T i+1 To continue the table, γ(i) takes a medium value (e.g., 0.5). If there is no special multimodal correlation, then γ(i) = 0.

[0173] The formula for the fused boundary score is: BC(i)=α×V(i)+β×SC(i)+γ×γ(i).

[0174] Wherein, γ is the preset maximum value of the multimodal association weight (default 0.1), and the initial values ​​of α, β, and γ can be set to 0.45, 0.45, and 0.1, and can be dynamically adjusted through the model optimization module.

[0175] To further improve the accuracy of cross-topic entity relationship recognition, in another embodiment of the present invention, the calculation of semantic similarity between core entities in different topic sub-units further includes the following optimization steps: (1) Extraction of core entities of multimodal units For the multimodal units (graphs, tables, formulas) included in step S200, core entity extraction is also performed. Specifically: Chart Unit: Extract key entities (such as "bar chart", "growth rate", "2025") from text generated by image descriptions; Table cells: Extract entities (such as "Year", "Sales Revenue", "Year-on-Year Growth Rate") from the table header and key data rows; Formula unit: Extracts entities such as variable names and constant values ​​from the formula description (e.g., "E=mc"). 2 The “E”, “m”, and “c” in the text.

[0176] The extracted multimodal entities are merged with the text entities to form an extended entity set ET=[e1, e2, ..., ek].

[0177] (2) Generation of global semantic vectors for multimodal entities For each multimodal entity, a semantic vector is generated not only based on its textual description features, but also by fusing its visual features (such as chart type, table structure, and formula complexity) to construct a global semantic vector for the multimodal entity. Take a chart entity as an example: v chart =β1×v text +β2×v visual .

[0178] Among them, v text v is a semantic vector describing the text. visual The vector represents the visual feature vector (extracted by an image encoder), and β1 and β2 are the fusion weights (default 0.6, 0.4). Tables and formula cells are processed similarly.

[0179] (3) Weighted fusion of cross-topic entity semantic similarity calculation When calculating the semantic similarity between entities in different topic sub-units, the global semantic vectors of multimodal entities are incorporated as weighting terms in the calculation. For two entities e... a and e b The fused semantic vectors are vc a and VC b The similarity calculation formula is: SC(e a ,e b )=d×cos(vc a VC b )+(1-d)×sim type (e a e b ).

[0180] in: cos(vc aVC b The cosine similarity is the result of the fused semantic vectors. sim type (e a e b The entity type matching score is 0.5 if both are "risk type", 0.3 if both are "numerical entity", and 0 if the types are different. d is the semantic similarity weight (default 0.8).

[0181] (4) Cross-modal correlation verification For potential relationships involving multimodal entities, cross-modal consistency verification is added. For example, if the text entity "subsidy reduction" and the chart entity "subsidy trend chart" are determined to be related, the chart description is further checked to see if it actually contains subsidy-related data. Only after verification is the relationship finally established. This verification can be implemented through a multimodal large model or rule engine, and can eliminate false associations.

[0182] Through the optimization of multimodal feature fusion and long-distance semantic perception described above, this invention is further enhanced in the following aspects: (1) Enhanced adaptability to complex layouts: By incorporating charts, tables, and formulas into a unified processing framework, it can handle technical documents containing rich non-text elements, such as research papers and engineering design reports. (2) Long-range dependency perception: By introducing long-range semantic similarity, it is possible to identify continuous arguments that span multiple pages and avoid thematic fragmentation caused by page separation; (3) Cross-modal relationship mining: Through multimodal entity semantic fusion, deep association recognition between text content and charts and tables can be achieved. For example, "risk description" can be automatically associated with the corresponding "risk trend chart" to provide richer information dimensions for downstream systems. (4) Enhanced association accuracy: The cross-modal consistency verification mechanism effectively reduces the false association rate and improves the reliability of structured data.

[0183] Example 3 Based on the same inventive concept, embodiments of the present invention provide a system for extracting key information from documents and generating structured data, comprising: The input module is used to receive unstructured documents; The preprocessing module is used to extract text and analyze the layout of the unstructured document to obtain the text unit sequence and the visual and logical structural features of each text unit. The topic positioning and scope definition module is used to locate anchor text units representing key topics in the text unit sequence, and dynamically define the complete text scope of the key topic corresponding to each anchor text unit based on the visual features and logical structure features. The content deconstruction module is used to perform semantic analysis on the text content within the scope of each complete text and extract structured topic sub-units; The structured encapsulation module is used to encapsulate the topic sub-units according to a preset data format to generate structured data; The output module is used to output the structured data.

[0184] The topic positioning and scope definition module is specifically used for: The visual boundary confidence between adjacent text units is calculated based on the visual features, and the semantic boundary confidence between adjacent text units is calculated based on the text semantics. The visual boundary confidence score and the semantic boundary confidence score are combined to obtain a comprehensive boundary score. Based on the relationship between the comprehensive boundary score and the dynamic boundary determination threshold, it is determined whether there is a topic boundary between adjacent text units; Based on the anchor text unit, the complete text scope of the key topic is determined in conjunction with the topic boundary.

[0185] This system embodiment is based on the same inventive concept as the aforementioned method embodiment. Therefore, the technical features, implementation details, and achievable technical effects described in the method embodiment are also applicable to this system embodiment. The specific implementation of each functional module can be hardware, software, firmware, or any combination thereof. When implemented in software, the system may further include a memory storing a computer program, which, when executed by a processor, performs the operations described above.

[0186] Those skilled in the art will understand that the above module division is only a logical functional division. In actual implementation, the modules can be merged, split, or different implementation methods can be adopted, as long as the corresponding functions can be achieved.

[0187] This invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the method described in this invention.

[0188] This invention also provides a computer-readable storage medium storing computer-executable instructions for performing the methods described in this invention.

[0189] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this is not limited herein.

[0190] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for extracting key information from documents and generating structured data, characterized in that, Includes the following steps: Multimodal document preprocessing steps: extract text and analyze layout of the input unstructured document to obtain text unit sequences and visual and logical structural features of each text unit; Key topic location and scope definition steps: Locate the anchor text unit representing the key topic in the text unit sequence, and dynamically define the complete text scope of the key topic corresponding to each anchor text unit based on the visual features and logical structure features. The complete text scope includes the starting and ending text unit indices. Content refinement and deconstruction steps: Semantic analysis is performed on the text content within the scope of each complete text to extract structured thematic sub-units; Structured encapsulation step: The topic sub-units are encapsulated according to a preset data format to generate structured data and output it.

2. The method according to claim 1, characterized in that, In the key topic positioning and scope definition steps, dynamically defining the scope of the complete text specifically includes: The visual boundary confidence between adjacent text units is calculated based on the visual features, and the semantic boundary confidence between adjacent text units is calculated based on the text semantics. The visual boundary confidence score and the semantic boundary confidence score are combined to obtain a comprehensive boundary score. Based on the relationship between the comprehensive boundary score and the dynamic boundary determination threshold, it is determined whether there is a topic boundary between adjacent text units; Based on the anchor text unit, the complete text scope of the key topic is determined in conjunction with the topic boundary.

3. The method according to claim 2, characterized in that, The confidence score of the visual boundary is calculated by quantizing the visual features and assigning dynamic weights, and then summing the quantized visual feature values ​​by weight.

4. The method according to claim 2, characterized in that, The semantic boundary confidence is obtained by calculating the semantic coherence between adjacent text units using a pre-trained language model and combining it with the output of the inflection point detection model.

5. The method according to claim 1, characterized in that, The content refinement and deconstruction step is preceded by a domain-adaptive template matching step: Identify the domain to which the unstructured document belongs, and match the corresponding domain template from a preset template library; The content refinement and deconstruction steps further include: extracting entities and splitting lists of text content within the scope of the complete text according to the preset parsing rules in the domain template to form the structured topic sub-units.

6. The method according to claim 5, characterized in that, The domain-adaptive template matching step also includes a template dynamic adjustment sub-step: Extract the layout features of the unstructured document; The adjustment coefficient is calculated based on the layout features, and the parsing rule parameters of the domain template are dynamically adjusted using the adjustment coefficient.

7. The method according to claim 1, characterized in that, The structured encapsulation step is preceded by a cross-topic entity relationship association step: Identify the core entities contained within the thematic sub-units of different key topics; Calculate the semantic similarity between core entities in different topic sub-units; If the semantic similarity exceeds a preset association threshold, then an association relationship is established between the different topic sub-units; The structured encapsulation step further includes: encapsulating the association relationship together with the topic sub-unit into the structured data.

8. The method according to claim 2, characterized in that, The dynamic definition of the scope of the complete text also includes: The multimodal units in the document are incorporated into the text unit sequence, wherein the multimodal units include at least one of chart units, table units, and formula units; Calculate the long-distance semantic similarity between the anchor text unit and subsequent non-adjacent text units, and incorporate the long-distance semantic similarity as a correction term into the calculation of the semantic boundary confidence. When fusing the visual boundary confidence and the semantic boundary confidence to obtain the comprehensive boundary score, the visual correlation coefficient of multimodal features is simultaneously incorporated.

9. The method according to claim 7, characterized in that, The calculation of semantic similarity between core entities in different topic sub-units also includes: Extract the core entities from the multimodal unit, wherein the multimodal unit includes at least one of the graph unit, table unit, and formula unit; The textual description features and visual features of the core entity of the multimodal unit are fused to generate a global semantic vector of the multimodal entity; Based on the global semantic vector of the multimodal entity, the semantic similarity of cross-topic entities is calculated, and cross-modal consistency verification is performed on cross-topic entities that are determined to be related.

10. The method according to claim 1, characterized in that, The visual features include at least one or more of the following: heading level, indentation, page number, and list item identifier; the logical structure features include heading level and indentation.

11. An electronic device, characterized in that, Including processor and memory; The processor executes the steps of the method as described in any one of claims 1 to 10 by invoking programs or instructions stored in the memory.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a program or instructions that cause a computer to perform the steps of the method as described in any one of claims 1 to 10.