Financial document editing method, system, medium and electronic device based on large language model

By modeling financial documents as semantic document object models and constructing multi-agent collaborative workflows, the challenges of data consistency and compliance in financial documents are solved, enabling efficient and automated document editing and maintenance.

CN121031610BActive Publication Date: 2026-02-13TAIHO INTELLIGENT TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511154816.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2026-02-13
Estimated Expiration
2045-08-18

AI Technical Summary

Technical Problem

Existing technologies lack a deep semantic understanding of the internal structure of long, complex, and highly compliant financial documents. Their retrieval enhancement generation methods are insufficient, and the data and text linking mechanisms are fragile. The system cannot proactively manage the integrity and consistency of documents, making it difficult to guarantee data consistency and compliance.

Method used

Financial documents are parsed into a Semantic Document Object Model (SDOM), using tree-structured semantic controls. Constraints are defined through a declarative logic compiler, and structured knowledge queries and verifications are performed using a financial knowledge graph. This builds a multi-agent collaborative workflow to achieve document self-maintenance and compliance management.

Benefits of technology

It significantly improves the data integrity and logical consistency of financial documents, reduces the internal data inconsistency rate, enhances the compliance and verifiability of documents, and improves editing and maintenance efficiency, enabling the completion of work that would take days using traditional methods in just a few hours.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121031610B_ABST
    Figure CN121031610B_ABST
Patent Text Reader

Abstract

The application provides a financial document editing method, system, medium and electronic equipment based on a large language model, which is based on a semantic document engine, a declarative logic compiler, a workflow orchestrator, an interactive intelligent agent, a knowledge retrieval intelligent agent, a content generation intelligent agent, a data and compliance verification intelligent agent and a financial knowledge graph, realizes parsing of a financial document, extraction of constraint conditions between semantic controls, and editing of corresponding semantic controls and associated semantic controls based on editing instructions and constraint conditions, and verification of updated semantic controls and corresponding semantic controls based on structured financial knowledge. The financial document editing method, system, medium and electronic equipment based on the large language model realize intelligent editing and maintenance of the financial document.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of document editing, and particularly relates to a financial document editing method and system based on a large language model, a medium and an electronic device. BACKGROUND

[0002] In the financial field, the generation, maintenance and update of long-length professional documents are indispensable in core business activities. Such documents, such as annual reports of banks, securities research reports, fund prospectuses, insurance actuarial reports and various regulatory compliance files, require not only high professionalism in the writing process, but also the processing of massive dynamic data and the compliance with strict compliance standards. The traditional working mode seriously depends on the manual operation of experts in the field of financial analysts, lawyers and auditors. This process usually involves multiple rounds of data collection, content writing, cross-checking and review and revision, which not only has a long cycle and high cost, but also is prone to human errors in data reference, logical consistency and compliance.

[0003] With the development of information technology, the carrier of documents has evolved from physical paper to digital format, but the essence has not changed fundamentally. Existing digital documents, such as general word processing files or portable document format files, are still essentially static records of information. These document formats are tightly coupled with the specific application programs that create them, making the data and logic within the document difficult to be effectively parsed and interoperated by other systems, forming an information island. There is a lack of robust and automated linking mechanism between the values, statements and conclusions in the document and the external data sources it relies on, such as real-time stock quotes, macroeconomic databases and enterprise financial statements. Once the source data changes, the update of the document content completely depends on manual discovery and manual modification, which is inefficient and risky.

[0004] In recent years, natural language generation technology represented by large language models (LLM) has begun to be applied to the automatic generation of document drafts. However, most of these attempts treat documents as a linear, unstructured text stream. This method can improve the speed of drafting the first draft to some extent, but it cannot solve the core problems of financial documents: how to ensure the data consistency, logical coherence and accurate mapping of external facts between the internal components of the document as a whole. The existing technology treats documents as a passive "processing object" rather than an "active system" with inherent logic and self-maintenance capabilities, which fundamentally limits the level of automation and intelligence.

[0005] The defects of the prior art in processing long, complex, and highly compliant financial documents are not only the lack of specific technical indicators such as context window size or retrieval accuracy, but also the fundamental lack of underlying architecture and core paradigm.

[0006] Firstly, the prior art generally lacks deep semantic understanding of the internal structure of the document. Whether it is a traditional natural language generation tool or a generation system based on a large language model, it usually treats the document as a one-dimensional character sequence when processing the document. The system cannot understand the semantic equivalence and logical correlation between different elements within the document. For example, the system cannot recognize that the "net profit growth rate" value mentioned in the first chapter of the report is the same semantic concept as the value in a certain cell of the financial statement annex table in the fifth chapter, and the data point represented in the chart. The lack of such structural semantics makes any modification of the document isolated and one-sided, which easily destroys the global consistency of the document. When the data needs to be updated, all related text, tables, and charts must be manually located and modified synchronously, and it is impossible to achieve automatic maintenance of "one modification, everywhere synchronization".

[0007] Secondly, the application mode of Retrieval-Augmented Generation (RAG) in the prior art is superficial and cannot meet the stringent requirements of financial knowledge precision and structure. The standard RAG process usually retrieves relevant text fragments from an unstructured text library as context and provides them to a large language model. This approach may be effective for open-domain question answering, but it has serious shortcomings in the context of financial document editing. Financial knowledge not only includes text descriptions, but more importantly, it includes a large amount of structured data, rules, and relationships. For example, a regulatory clause is not just a piece of text, it contains structured attributes such as scope of application, effective date, and exemption conditions. The traditional RAG system returns a "snapshot" of the text containing these information when retrieving, rather than the structured knowledge object itself. This causes the large language model to "re-analyze" the structured information from the noisy text when generating content, which is prone to misinterpretation and factual errors, known as "hallucinations", which are unacceptable in the financial compliance field.

[0008] Thirdly, the linking mechanism between data and text in the prior art is fragile or even missing. The core value of a financial document lies in its content accurately reflecting real-world data and facts. In the existing workflow, the combination of data and text is one-way and "frozen" at the moment of generation. Analysts copy and paste data from spreadsheets or databases into the document and write analysis paragraphs around it. Once the underlying data is updated, this manual and fragile link is broken, the document content is immediately "outdated", and the system has no way of knowing. The lack of an automated and verifiable data binding and update transmission mechanism is the fundamental reason why the existing technology cannot achieve continuous fidelity and dynamic maintenance of document content.

[0009] Finally, existing tools are essentially passive and non-intelligent. They execute user instructions such as "generate a summary" or "rewrite this sentence", but they do not have the ability to actively manage document integrity and consistency. The system lacks an internal "goal" or "constraint" and cannot actively and continuously monitor the status of the entire document, find potential inconsistencies, plan correction steps, and autonomously call tools (such as data verification, compliance checks, and text rewriting) to solve these problems. This passive interaction mode determines that existing tools can only serve as auxiliary "pens" and cannot become "intelligent housekeepers" that manage documents throughout their life cycle. SUMMARY

[0010] In view of the above-mentioned shortcomings of the prior art, the purpose of the present application is to provide a financial document editing method, system, medium and electronic equipment based on a large language model, which converts static and passive financial documents into dynamic and self-maintaining semantic document object models, and realizes intelligent editing and maintenance of financial documents based on a large language model.

[0011] In a first aspect, the present application provides a financial document editing method based on a large language model, the method comprising the following steps: parsing a financial document into a semantic document object model; the semantic document object model adopts a tree structure, each node of the tree structure being a semantic control with financial semantics; extracting constraint conditions between semantic controls of the financial document; obtaining an editing instruction of the financial document; updating a corresponding semantic control in the semantic document object based on the editing instruction to generate an updated semantic control; obtaining associated semantic controls corresponding to the updated semantic control based on the constraint conditions; updating the associated semantic controls based on the updated semantic control; querying structured financial knowledge corresponding to the updated semantic control and the associated semantic controls based on a financial knowledge graph; verifying the updated semantic control and the associated semantic controls based on the structured financial knowledge to complete editing of the financial document after verification.

[0012] In an implementation form of the first aspect, the semantic control comprises a structure layer, a semantic layer and a logic and state layer.

[0013] The structure layer is configured to describe a semantic control ID, a semantic control relationship, a semantic control document location and a semantic control type of the semantic control.

[0014] The semantic layer is configured to describe a semantic concept in a financial ontology, an entity mention, relationship metadata, a data source and formatting and presentation information of the semantic control.

[0015] The logic and state layer is configured to describe a dependency list, a calculation / verification rule, a current verification state and a version and history record of the semantic control.

[0016] In an implementation form of the first aspect, the associated semantic control is generated based on a large language model.

[0017] In an implementation form of the first aspect, the method further comprises constructing the financial knowledge graph, and the constructing the financial knowledge graph comprises the following steps:

[0018] defining entity types and relationship types contained in a financial report ontology;

[0019] extracting financial knowledge containing the entity types and the relationship types from different types of data sources and converting the financial knowledge into RDF triples;

[0020] verifying and fusing the RDF triples based on an existing financial knowledge graph;

[0021] adding time sequence information and traceability information to financial knowledge in the existing financial knowledge graph.

[0022] In an implementation form of the first aspect, the querying the structured financial knowledge corresponding to the update semantic control and the associated semantic control based on the financial knowledge graph comprises the following steps:

[0023] obtaining financial knowledge query information corresponding to the update semantic control and the associated semantic control;

[0024] converting the financial knowledge query into structured query information;

[0025] querying the structured financial knowledge corresponding to the structured query information in the financial knowledge graph based on a graph retrieval enhanced generation interface.

[0026] In an implementation form of the first aspect, the verifying the update semantic control and the associated semantic control based on the structured financial knowledge comprises the following steps:

[0027] determine whether the update semantic control and the associated semantic control are consistent with the structured financial knowledge;

[0028] if yes, mark the update semantic control and the associated semantic control as valid in the semantic document object model;

[0029] if no, mark the update semantic control and the associated semantic control as invalid in the semantic document object model, and indicate the reason for the check identification.

[0030] In an implementation form of the first aspect, further comprising, when the check fails, correcting the financial document by adding disclosure information in the financial document.

[0031] In a second aspect, the present application provides a financial document editing system based on a large language model, the system comprising a semantic document engine, a declarative logic compiler, a workflow orchestrator, an interactive agent, a knowledge retrieval agent, a content generation agent, a data and compliance check agent, and a financial knowledge graph.

[0032] The semantic document engine is configured to parse a financial document into a semantic document object model; the semantic document object model adopts a tree structure, and each node of the tree structure is a semantic control with financial semantics.

[0033] The declarative logic compiler is configured to extract constraint conditions between semantic controls of the financial document.

[0034] The interactive agent is configured to obtain an editing instruction of the financial document, so that the semantic document engine updates a corresponding semantic control in the semantic document object based on the editing instruction under the control of the workflow orchestrator, to generate an update semantic control.

[0035] The workflow orchestrator is configured to obtain, in the declarative logic compiler, an associated semantic control corresponding to the update semantic control based on the constraint conditions.

[0036] The content generation agent is configured to update the associated semantic control based on the update semantic control under the control of the workflow orchestrator.

[0037] The financial knowledge graph is configured to store structured financial knowledge.

[0038] The knowledge retrieval agent is configured to query structured financial knowledge corresponding to the update semantic control and the associated semantic control based on the financial knowledge graph.

[0039] The data and compliance verification agent is configured to verify the update semantic control and the association semantic control based on the structured financial knowledge, to complete the editing of the financial document after verification.

[0040] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory;

[0041] The memory is configured to store a computer program;

[0042] The processor is configured to execute the computer program stored in the memory, so that the electronic device executes the above-mentioned financial document editing method based on a large language model.

[0043] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by an electronic device to implement the above-mentioned financial document editing method based on a large language model.

[0044] As described above, the financial document editing method, system, medium and electronic device based on a large language model have the following beneficial effects:

[0045] (1) The present application greatly improves the data integrity and logical consistency of the financial document. By modeling the document as a computable object constrained by declarative rules, the update of data can be automatically managed and conducted, fundamentally eliminating problems such as data inconsistency, reference errors and calculation omissions caused by manual operation. Experimental data show that compared with traditional manual or semi-automatic financial document editing methods, the financial document editing method based on a large language model of the present application reduces the internal data contradiction rate by more than ninety percent.

[0046] (2) The present application significantly enhances the compliance and verifiability of the document. The built-in data and compliance verification agent, combined with the high-precision graph retrieval augmented generation (GraphRAG) mechanism, forms a powerful closed-loop verification system. This system can compare the document content with the structured regulatory knowledge base in real time, automatically find and prompt even repair potential compliance risks. This not only reduces the compliance cost of enterprises, but also provides a high-efficiency and reliable examination means for regulatory agencies.

[0047] (3) The present application brings the efficiency of document editing and maintenance. The present application integrates a series of tedious work such as writing, data checking, cross-reference checking, compliance review, etc. which needs to be completed by expert team for several days or even weeks, into an efficient intelligent agent workflow. For a typical tens of thousands of words of financial annual report, the present application can complete the whole process from the first draft to multiple rounds of checking and revision within a few hours, shortening the document preparation period by more than an order of magnitude.

[0048] (4) The technical architecture of the present application has high scalability and wide application prospect. Although the present application takes financial documents as the main implementation scene, the core semantic document model, declarative logic control, intelligent agent workflow and structured knowledge retrieval architecture idea are universal in the field. This architecture can be successfully transplanted to other fields that also need to process high complexity, strong rules, high risk and long-length documents, such as automatic review and management of legal contracts, writing of research and development reports and registration and filing documents in the biomedicine field, and dynamic maintenance of technical specifications and safety manuals of complex engineering projects, etc., which has broad market value and far-reaching industry influence. BRIEF DESCRIPTION OF DRAWINGS

[0049] Figure 1 A flowchart showing the method for editing financial documents based on a large language model according to the present application in an embodiment;

[0050] Figure 2 A flowchart showing the construction of the financial knowledge graph according to the present application in an embodiment;

[0051] Figure 3 A flowchart showing the query of structured financial knowledge according to the present application in an embodiment;

[0052] Figure 4 A flowchart showing the checking and updating of semantic controls and associated semantic controls according to the present application in an embodiment;

[0053] Figure 5 An architecture schematic diagram of the method for editing financial documents based on a large language model according to the present application in an embodiment;

[0054] Figure 6 A structure schematic diagram of the system for editing financial documents based on a large language model according to the present application in an embodiment;

[0055] Figure 7 A structure schematic diagram of the electronic device according to the present application in an embodiment. DETAILED DESCRIPTION

[0056] Following make the embodiments of the present application more clear through specific, concrete examples, and other advantages and effects of the present application can be easily understood by those skilled in the art from the disclosure of the present application. The present application can also be implemented or applied through other different embodiments, and various modifications or changes can be made to the details in the present specification based on different views and applications without departing from the spirit of the present application. It should be noted that the following examples and features in the examples can be combined with each other without conflict.

[0057] It should be noted that the diagrams provided in the following examples only illustrate the basic concepts of the present application in a schematic manner, and only the components related to the present application are shown in the diagrams, not the number, shape and size of the components when actually implemented. The shapes, numbers and proportions of the components when actually implemented can be arbitrarily changed, and the layout pattern of the components can also be more complex.

[0058] The financial document editing method, system, medium and electronic device based on a large language model provided by the present application introduce a new technical paradigm, and represent a static and passive financial document as a model composed of a plurality of semanticized and queryable structured objects. On this model, a declarative logical language is used to define and describe the dependency relationship, calculation rule and compliance constraint between the objects in the document. Further, through an autonomous and multi-agent collaborative workflow, the integrity, consistency and accuracy of the document model are actively and continuously managed and maintained. The workflow can intelligently arrange a series of complex tasks such as content generation, knowledge retrieval, data verification and compliance review, realize a closed loop of "writing and checking, checking and correcting", and thus can significantly improve the editing efficiency of the financial document, guarantee the absolute accuracy of the data and compliance, and adapt to the complex and changing business demands in the future.

[0059] The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application.

[0060] As shown in FIG. 1, in an embodiment, the financial document editing method based on a large language model of the present application includes steps S1-S8. Figure 1 Step S1, parse the financial document into a semantic document object model; the semantic document object model adopts a tree structure, and each node of the tree structure is a semantic control with financial semantics.

[0061]

[0062] ​Specifically, instead of treating the financial document as plain text, the present application parses the financial document into a hierarchical tree-structured Semantic Document Object Model (SDOM) by a semantic document engine. In the SDOM, a node is not a simple formatting tag, but a semantic control with rich financial semantics. Each semantic control, whether it is a section, a paragraph, a table, a cell, or even a standalone value or date, is treated as a unique, addressable resource. Each semantic control has a globally unique identifier and is attached with a rich set of metadata and semantic tags. The semantic tags are derived from a predefined, extensible Financial Ontology, such as the XBRL (eXtensible Business Reporting Language) standard extended with financial reporting specific concepts. For example, a number "1.58" in a financial document can be represented as a semantic control in the SDOM with a structured description: the semantic control is of type "financial metric", has a value of "1.58", corresponds to an accounting principle concept of "basic earnings per share", is sourced from "financial statement note X", and is displayed with a format of "two decimal places". This representation makes the entire financial document fully machine-understandable and queryable, laying a foundation for subsequent automated logic processing and consistency maintenance.

[0063] In an embodiment, the semantic control comprises a structural layer, a semantic layer, and a logic and state layer. The three layers together define the attributes and behaviors of the semantic control.

[0064] The structural layer is used to describe the semantic control ID, semantic control relationship, semantic control document location, and semantic control type of the semantic control. Specifically, the structural layer is responsible for describing the physical existence and hierarchical relationship of the semantic control in the document, and is the skeleton of the entire semantic document object model, ensuring the parseability and addressability of the document structure. It maps the document content into a hierarchical tree, similar to the Document Object Model (DOM) generated by a web browser when parsing HTML.

[0065] wherein the semantic control ID represents a globally unique, URI-compliant identifier, ensuring that each minimal unit in the semantic DOM can be precisely referenced and located. The semantic control relationship adopts a hierarchical pointer, representing a pointer to other control IDs, used to explicitly define the control's position in the document tree structure, such as its parent node, child node sequence, etc. The semantic control document position represents the precise physical location of the control in the original document, for example, for text, it can be the starting and ending character span; for table cells, it can be their row and column coordinates. The semantic control control type adopts a base control type, which is derived from a type definition of a base document structure ontology, such as sdm:Section, sdm:Paragraph, sdm:Table, sdm:NumericValue, etc., describing its basic structural function.

[0066] The semantic layer is used to describe the semantic concept, entity mention, relationship metadata, data source, and formatting and presentation information of the semantic control in the financial ontology. Specifically, the semantic layer is the core of realizing the "intelligence" of the document, which injects rich, machine-understandable financial field professional knowledge into the physical control of the structural layer. It associates unformatted text and numbers with a formal financial knowledge system, so that data is no longer isolated, but becomes part of the knowledge network.

[0067] Among them, the semantic concept link (Semantic Concept Link) is used to link the control content to one or more concepts in the formal financial ontology. For example, a numerical value can be linked to the fro: Basic Earnings Per Share (fro: Basic Earnings Per Share) concept in the Financial Reporting Ontology (FRO) based on XBRL (Extensible Business Reporting Language) extension. Entity mentions (Entity Mentions) are used to identify and extract named entities mentioned in the control content, such as company names, names, dates, currency amounts, etc., and store them in a structured manner. Relational metadata (Relational Metadata) is used to define the semantic relationship between the control and other controls, such as "is calculated from" (calculated from), "provides evidence for" (provides evidence for), "is part of" (is part of) and the like. Data source and provenance (Data Source and Provenance) is used to record the source information of the data in the control, for example, it may come from a specific database query, a specific part of another document, or be calculated by an analysis model. Formatting and presentation information (Formatting and Presentation Info) is used to define the display method of the data, such as the number of decimal places of the numerical value, the currency symbol, the date format, etc., to separate the content from the form.

[0068] The logic and state layer (Logic and State Layer) is used to describe the dependency list, calculation / verification rules, current verification state and version and history record of the semantic control. Specifically, the logic and state layer gives the document the ability to dynamically calculate and self-verify, making the document change from a static record carrier to a "living" and calculable system. It defines the behavior, dependencies and lifecycle state of the control.

[0069] Dependency List represents an explicit list of all other controls that the current control depends on, either numerically or logically. When any control in the list changes, the current control is automatically triggered for re-computation or re-validation. Computation / Validation Rule represents the declarative logical expression that the control is bound to. For example, a cell's computation rule can be SUM(column_A); a compliance validation rule can be self.value > 0. These rules are interpreted and executed by the system's compiler. Current State describes the control's state in the current workflow, such as "valid", "invalid", "pending_update", "requires_review", etc. Version and History are used to record the history of the control's content changes, including the time of modification, the operator, and a pointer to the previous version, which is crucial for auditing and tracking, and its design is inspired by the document change ontology.

[0070] Suppose there is a sentence in a page of financial report: "The basic earnings per share of our company in the reporting period is 1.58, which is derived from the consolidated income statement." This sentence will be parsed into multiple semantic controls. The core data point "1.58" will be modeled as an independent semantic control of type sdm:NumericValue. Tables 1-2 are examples of the specific parameters of this semantic control in the three-layer structure of SDOM.

[0071] Table 1, parameters of the structure layer

[0072]

[0073] Table 2, parameters of the semantic layer

[0074]

[0075] Table 3, parameters of the logic and state layer

[0076]

[0077] Step S2, extract the constraints between the semantic controls of the financial document.

[0078] Specifically, in order to manage the complex relationship between various semantic controls in the semantic document object model, the present application introduces a declarative logic compiler. The business logic, data dependency, update propagation rule and compliance constraint within the document no longer exist through hard coding or manual maintenance, but are defined through a declarative domain-specific language (DSL) designed for documents, which is high-level and Turing-complete. For example, a declarative rule can be used to define that the key performance indicator (KPI) value in a summary paragraph must be consistent with the corresponding cell value in the main table of the financial statement, and is automatically updated. Another rule can define that when the value of the "total assets" control exceeds a certain threshold, a specific risk disclosure text must be automatically inserted in the "risk warning" section. This declarative approach completely separates "what to do" (business logic) from "how to do it" (execution process), greatly improving the flexibility and maintainability of the system. The declarative logic compiler is responsible for parsing these rules and compiling them into a plan for agent workflow execution or a series of real-time monitored constraint conditions. This allows the document to change from a passive record carrier to an "active document" that can adjust and update itself according to the preset logic.

[0079] Step S3, obtaining the editing instruction of the financial document.

[0080] Specifically, the present application obtains the editing instruction of the financial document through an interactive agent. The interactive agent receives and parses the editing instruction and converts it into a trigger instruction for the internal workflow.

[0081] Step S4, updating the corresponding semantic control in the semantic document object based on the editing instruction to generate an updated semantic control.

[0082] Specifically, in the present application, a workflow orchestrator is provided to uniformly schedule and execute document editing. The workflow orchestrator updates the corresponding semantic control in the semantic document object based on the editing instruction to generate an updated semantic control.

[0083] Step S5, obtaining the associated semantic control corresponding to the updated semantic control based on the constraint condition.

[0084] Specifically, the workflow orchestrator obtains the associated semantic control corresponding to the updated semantic control based on the constraint condition between the semantic controls in the declarative logic compiler.

[0085] Step S6, updating the associated semantic control based on the updated semantic control.

[0086] Specifically, in the present application, a content generation agent is provided, which updates the associated semantic control based on the update semantic control under the control of the workflow orchestrator. Among them, the content generation agent generates or modifies the corresponding content in the associated semantic control based on the update semantic control and the editing instruction based on a large language model.

[0087] Step S7, querying the structured financial knowledge corresponding to the update semantic control and the associated semantic control based on the financial knowledge graph.

[0088] Specifically, in the present application, a financial knowledge graph (FKG) is provided in advance. The financial knowledge graph stores structured financial knowledge. Unlike the unstructured text database used by the traditional retrieval-augmented generation (RAG) system, the financial knowledge graph of the present application is a structured knowledge base constructed based on graph database technology. The nodes in the financial knowledge graph represent various financial entities, such as companies, individuals, regulatory agencies, laws and regulations, and financial products, and the edges represent various relationships between these entities. For example, the financial knowledge graph can clearly indicate that a listed company has issued an annual report, the annual report complies with a certain accounting standard, and is signed by a certain senior executive. The structure of the financial knowledge graph is strictly defined by the aforementioned financial ontology.

[0089] As shown in Figure 2 In an embodiment, constructing the financial knowledge graph includes the following steps.

[0090] a) Define the entity types and relationship types contained in the financial reporting ontology.

[0091] First, a strict financial reporting ontology (FRO) is defined. This ontology is based on the internationally accepted XBRL (Extensible Business Reporting Language) classification standard and is formally described using OWL (Web Ontology Language). It predefines all possible entity types (such as fro:Company, fro:Executive, fro:FinancialReport, fro:Regulation) and relationship types (such as fro:hasCEO, fro:publishesReport, fro:isRegulatedBy) in the financial knowledge graph. This step provides a strong, logically consistent "skeleton" for the entire financial knowledge graph, ensuring that all subsequent knowledge added follows a unified, unambiguous semantic standard

[0092] b) Extracting financial knowledge containing the entity type and relationship type for different types of data sources and converting it into RDF triples.

[0093] Among them, raw data is obtained from multiple sources, including listed companies' PDF annual reports, structured financial databases, regulatory announcements and authoritative financial news. Different extraction strategies are adopted for different types of data sources. For large blocks of unstructured text in PDF documents, large language models are used for named entity recognition (NER) and relation extraction (RE), but the extraction behavior is strictly constrained by the FRO ontology, i.e. only extracting the entity and relationship types defined in the ontology. For table data in the document, a special table understanding module is used to parse it into structured triples. All extracted financial knowledge (entities and relationships) will be converted into Resource Description Framework (RDF) triples that meet the FRO specification.

[0094] c) Based on the existing financial knowledge graph, the RDF triples are verified and merged.

[0095] Among them, newly extracted RDF triples are not immediately incorporated into the existing financial knowledge graph, but enter a "staging area". In this area, large language models are used for entity verification and linking, i.e. aligning newly extracted entities (such as "XX Company") with existing entities in the graph (fro:Company_XX). At the same time, the system will perform logical consistency checks, such as checking whether a company has two different CEOs. This process is iterative, i.e. using the already constructed financial knowledge graph as context to help large language models more accurately parse new documents, forming a "extraction-verification-merging" self-enhancing closed loop.

[0096] d) Adding time series information and traceability information to the financial knowledge in the existing financial knowledge graph.

[0097] Among them, financial knowledge has strong time sensitivity. Therefore, in the process of constructing the financial knowledge graph, a timestamp and source information are attached to each relationship (edge). For example, when representing the relationship "X is the CEO", the tenure start and end time and information source (such as the link to a certain company announcement) are attached to ensure the traceability and timeliness of the knowledge.

[0098] Through the above financial knowledge graph construction method, not only the breadth of multi-source information is covered, but also the depth and accuracy far exceed traditional methods, providing a solid and reliable foundation for subsequent GraphRAG applications.

[0099] In addition, the knowledge retrieval agent is arranged in the application, which interacts with the financial knowledge graph by using an advanced graph retrieval enhanced generation mechanism to obtain structured financial knowledge required by the query. When the query is performed, the knowledge retrieval agent does not perform a fuzzy vector similarity search, but converts the financial knowledge requirement into a structured query (such as a Cypher or SPARQL query) for a graph database. The query directly returns an accurate and structured subgraph or a set of entities and their attributes, rather than a piece of text that may contain noise. For example, when the compliance of a transaction needs to be verified, the system directly retrieves the relevant regulation nodes and their defined applicable condition attributes, rather than searching web pages or documents containing the regulation name. This structured retrieval method fundamentally eliminates the uncertainty of the information analysis link of the traditional RAG, and provides a solid and unambiguous fact basis for the generation and verification tasks of the large language model.

[0100] As shown in Figure 3 In an embodiment, querying the structured financial knowledge corresponding to the update semantic control and the association semantic control based on the financial knowledge graph includes the following steps:

[0101] A) Obtain the financial knowledge query information corresponding to the update semantic control and the association semantic control.

[0102] The financial knowledge query information is autonomously constructed internally according to the current task and context. For example, when a certain key data (such as revenue) in a document is modified, it is necessary to verify whether this modification meets all the relevant compliance constraints. According to the rules it needs to perform, the information it needs is identified. For example, to verify “major information disclosure”, it needs to know “what is the major change standard of operating income?”. This information requirement is passed to the knowledge retrieval agent.

[0103] B) Convert the financial knowledge query into structured query information.

[0104] The knowledge retrieval agent converts this natural language form of requirement into an accurate and structured query language (such as the commonly used Cypher query of graph database) for the financial knowledge graph.

[0105] C) Query the structured financial knowledge corresponding to the structured query information in the financial knowledge graph based on the graph retrieval enhanced generation interface.

[0106] Step S8, verifying the update semantic control and the association semantic control based on the structured financial knowledge, to complete the editing of the financial document after passing the verification.

[0107] Specifically, in the present application, a data and compliance verification intelligent agent is provided for verifying the update semantic control and the associated semantic control based on the structured financial knowledge. As shown in Figure 4 When verification is performed, first, a logical self-consistency check within the financial document is performed. For example, check whether the balance sheet is balanced (total assets = total liabilities and owner's equity), or check whether the total of each item in the cash flow statement is equal to the net amount. These are based on preset calculation rules within the document. Then, a compliance check with external regulations and facts is started. The data and compliance verification intelligent agent determines whether the update semantic control and the associated semantic control are consistent with authoritative, comparable baseline data or rule-defined structured financial knowledge. That is, the baseline facts (such as regulatory thresholds, legal names, effective dates, etc.) obtained from the financial knowledge graph are compared and logically judged with the current values of the corresponding controls in the financial document. If the judgment is consistent, the update semantic control and the associated semantic control are marked as valid in the semantic document object model. If the judgment is inconsistent, the update semantic control and the associated semantic control are marked as invalid in the semantic document object model, and the verification identification reason is indicated (for example, "revenue change exceeds 10%, but no corresponding disclosure statement is found in the risk warning section"). In addition, when the verification fails, the financial document is modified, and disclosure information is added in the financial document. When the verification fails, the workflow orchestrator immediately starts a correction sub-process, for example, the content generation intelligent agent supplements the necessary disclosure information at the appropriate position of the document according to the reason for the verification failure. This process is repeated until all semantic control states are valid. This continuously running, autonomous verification and correction cycle constitutes a "computational immune system" for the financial document, which can actively resist and repair inconsistencies introduced by editing or data updates, thereby ensuring the continuous healthy state of the financial document. Therefore, the present application constructs a closed-loop, autonomous intelligent agent workflow for realizing intelligent editing and continuous verification of the document, which is not a passive response to instructions, but actively and cyclically performs content generation, data verification, compliance review and self-correction tasks through a collaborative team composed of multiple professional intelligent agents. This design integrates the traditionally separate "writing" and "checking" processes into one, realizing real-time monitoring and autonomous maintenance of the document state.

[0108] The financial document editing method based on a large language model of the present application will be further described below through specific embodiments.

[0109] As shown in Figure 2 (a) and Figure 2(b) As shown in this embodiment, the financial document editing method based on large language model of the present application adopts a single execution subject. The semantic document engine, the declarative logic compiler, the workflow orchestrator, the interactive agent, the knowledge retrieval agent, the content generation agent, the data and compliance verification agent, and the financial knowledge graph are all functional modules therein. Suppose an editing instruction is received, which corresponds to the user's operation of modifying the value of a certain table cell in the financial report from "120 million RMB" to "150 million RMB". First, the interactive agent receives the input signal and parses its intent as: updating the value of the semantic control with ID "table1-cell-A1" to "1.5e8" and the currency unit to "RMB". The interactive agent then triggers the workflow orchestrator to start a "document state update and consistency verification" workflow. The workflow orchestrator controls the semantic document engine to update the state of the corresponding semantic control in the SDOM. Then, the dependency graph compiled by the declarative logic compiler is activated, which can identify all semantic controls that directly or indirectly depend on "table1-cell-A1". These dependencies may include: another table cell used to calculate the total, a sentence in the summary chapter that references the data, and a data visualization chart. The workflow orchestrator assigns tasks to different agents according to these dependencies. It instructs the content generation agent: "rewrite the content of the semantic control with ID'summary-paragraph-2' based on the updated value, ensuring that the text smoothly reflects the change from 120 million RMB to 150 million RMB". At the same time, it may instruct the chart rendering module in the content generation agent to update the chart. After all the dependent semantic control contents are updated, the data and compliance verification agent is automatically activated. It starts to perform all constraint checks related to the modified semantic control. For example, it may check whether the new revenue data triggers the provisions of a certain regulatory law on significant information disclosure. To do this, it queries the structured definition of the relevant regulations from the financial knowledge graph through the knowledge retrieval agent. If all checks pass, the workflow ends normally, presenting the updated and fully consistent document state to the outside. If a check fails, for example, it is found that additional information disclosure is required, the workflow orchestrator will start a correction sub-process, and the content generation agent will add the necessary disclosure statement in the financial document, thereby forming a complete, automated editing-verification-correction closed loop.

[0110] The protection scope of the financial document editing method based on large language model according to the embodiments of the present application is not limited to the execution order of the steps listed in the embodiments. Any scheme achieved by adding, replacing or replacing steps of the prior art according to the principles of the present application is included in the protection scope of the present application.

[0111] The embodiment of the present application also provides a large language model-based financial document editing system, which can implement the large language model-based financial document editing method of the present application. However, the implementation device of the large language model-based financial document editing system of the present application includes but is not limited to the structure of the large language model-based financial document editing system listed in the present embodiment. Any modification and replacement of the existing technology according to the principle of the present application are included in the protection scope of the present application.

[0112] As shown in Figure 6 In an embodiment, the large language model-based financial document editing system of the present application includes a semantic document engine 61, a declarative logic compiler 62, a workflow orchestrator 63, an interactive agent 64, a knowledge retrieval agent 65, a content generation agent 66, a data and compliance verification agent 67, and a financial knowledge graph 68.

[0113] The semantic document engine 61 is used to parse a financial document into a semantic document object model. The semantic document object model adopts a tree structure, and each node of the tree structure is a semantic control with financial semantics.

[0114] The declarative logic compiler 62 is used to extract constraint conditions between semantic controls of the financial document.

[0115] The interactive agent 64 is used to obtain an editing instruction of the financial document, so that the semantic document engine 61 updates a corresponding semantic control in the semantic document object based on the editing instruction under the control of the workflow orchestrator 63, to generate an updated semantic control.

[0116] The workflow orchestrator 63 is used to obtain, in the declarative logic compiler 62, an associated semantic control corresponding to the updated semantic control based on the constraint condition.

[0117] The content generation agent 66 is used to update the associated semantic control based on the updated semantic control under the control of the workflow orchestrator 63.

[0118] The financial knowledge graph 68 is used to store structured financial knowledge.

[0119] The knowledge retrieval agent 65 is used to query the structured financial knowledge corresponding to the updated semantic control and the associated semantic control based on the financial knowledge graph.

[0120] The data and compliance verification agent 67 is used to verify the updated semantic control and the associated semantic control based on the structured financial knowledge, so as to complete the editing of the financial document after passing the verification.

[0121] Among them, the structure and principle of the semantic document engine 61, the declarative logic compiler 62, the workflow arranger 63, the interactive intelligent agent 64, the knowledge retrieval intelligent agent 65, the content generation intelligent agent 66, the data and compliance verification intelligent agent 67 and the financial knowledge graph 68 are consistent with the function modules in the above-mentioned financial document editing method based on a large language model, and therefore will not be described here.

[0122] In several embodiments provided by the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules / units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be indirect coupling or communication connection through some interface, device or module or unit, which can be electrical, mechanical or other forms.

[0123] The modules / units described as separate components can or can not be physically separated, and the components shown as modules / units can or can not be physical modules, i.e., they can be located in one place or distributed on multiple network units. Some or all of the modules / units can be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in each embodiment of the present application can be integrated in one processing module, or each module / unit can be physically separated, or two or more modules / units can be integrated in one module / unit.

[0124] Those of ordinary skill in the art should further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, each example has been described in the above description in terms of its general functionality. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0125] The embodiments of the present application further provide a computer readable storage medium. A person skilled in the art can understand that all or part of the steps of the method described above can be instructed by a program to complete the processor, and the program can be stored in a computer readable storage medium. The storage medium is a non-transitory medium, for example, a random access memory, a read-only memory, a flash memory, a hard disk, a solid state disk, a magnetic tape, a floppy disk, an optical disc and any combination thereof. The storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center and the like, which includes one or more available medium sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc (DVD)) or a semiconductor medium (for example, a solid state disk (SSD)) and the like.

[0126] The embodiments of the present application further provide an electronic device. The electronic device comprises a processor and a memory.

[0127] The memory is used to store a computer program.

[0128] The memory comprises a ROM, a RAM, a disk, a U disk, a memory card or an optical disc and the like various medium which can store program codes.

[0129] The processor is connected with the memory, and is used to execute the computer program stored in the memory, so that the electronic device executes the financial document editing method based on the large language model described above.

[0130] Preferably, the processor can be a general processor, including a central processing unit (CPU), a network processor (NP) and the like; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0131] As Figure 7As shown, the electronic device of the present invention is embodied in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: one or more processors or processing units 71, a memory 72, and a bus 73 connecting different system components (including the memory 72 and the processing unit 71).

[0132] Bus 73 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0133] Electronic devices typically include a variety of computer-readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, and removable and non-removable media.

[0134] Memory 72 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 721 and / or cache memory 722. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 723 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 7 Not shown; usually referred to as a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 73 via one or more data media interfaces. Memory 72 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.

[0135] A program / utility 724 having a set (at least one) of program modules 7241 may be stored, for example, in memory 72. Such program modules 7241 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 7241 typically perform the functions and / or methods described in the embodiments of the present invention.

[0136] The electronic device can also communicate with one or more external devices such as a keyboard or a pointing device, displays, etc.; other devices that enable a user to interact with the electronic device; and / or any devices (e.g., network card, modem, etc.) that enable the electronic device to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface 74. Still yet, the electronic device can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet through network adapter 75. As Figure 7 illustrated, network adapter 75 communicates with other modules of the electronic device through bus 73. It should be appreciated that other hardware and / or software modules can be used in conjunction with the electronic device. For example, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc. can be used with the electronic device.

[0137] The above-described embodiments are merely illustrative of the principles of the present application and its efficacy, and are not intended to limit the present application. Any modification or variation of the above-described embodiments, which falls within the spirit and scope of the present application, is intended to be included. Accordingly, all such modifications and variations are intended to be included herein as aspects of the present application as defined by the appended claims.

Claims

1. A method for editing a financial document based on a large language model, characterized in that, The method comprises the following steps: parsing a financial document into a semantic document object model; the semantic document object model adopts a tree structure, and each node of the tree structure is a semantic control with financial semantics; extracting constraint conditions between semantic controls of the financial document; obtaining an editing instruction of the financial document; updating a corresponding semantic control in the semantic document object based on the editing instruction to generate an updated semantic control; obtaining a corresponding associated semantic control of the updated semantic control based on the constraint condition; updating the associated semantic control based on the updated semantic control; querying structured financial knowledge corresponding to the updated semantic control and the associated semantic control based on a financial knowledge graph; verifying the updated semantic control and the associated semantic control based on the structured financial knowledge to complete the editing of the financial document after passing the verification.

2. The large language model-based financial document editing method according to claim 1, characterized in that: The semantic control comprises a structure layer, a semantic layer and a logic and state layer; The structure layer is used to describe the semantic control ID, semantic control relationship, semantic control document position and semantic control type of the semantic control; The semantic layer is used to describe the semantic concept, entity reference, relationship metadata, data source and formatting and presentation information of the semantic control in the financial ontology; The logic and state layer is used to describe the dependency list, calculation / verification rule, current verification state and version and history record of the semantic control.

3. The large language model-based financial document editing method of claim 1, wherein: The associated semantic control is generated based on a large language model.

4. The large language model-based financial document editing method of claim 1, wherein: It also includes constructing the financial knowledge graph; constructing the financial knowledge graph comprises the following steps: defining entity types and relationship types contained in a financial report ontology; extracting financial knowledge containing the entity types and relationship types from different types of data sources and converting them into RDF triples; verifying and fusing the RDF triples based on an existing financial knowledge graph; adding time sequence information and traceability information to the financial knowledge in the existing financial knowledge graph.

5. The large language model-based financial document editing method according to claim 1, characterized in that: Querying the structured financial knowledge corresponding to the updated semantic control and the associated semantic control based on the financial knowledge graph comprises the following steps: obtaining financial knowledge query information corresponding to the updated semantic control and the associated semantic control; converting the financial knowledge query into structured query information; querying the structured financial knowledge corresponding to the structured query information in the financial knowledge graph based on a graph retrieval enhanced generation interface.

6. The large language model-based financial document editing method according to claim 1, characterized in that: Verifying the updated semantic control and the associated semantic control based on the structured financial knowledge comprises the following steps: determining whether the updated semantic control and the associated semantic control are consistent with the structured financial knowledge; if yes, marking the updated semantic control and the associated semantic control as valid in the semantic document object model; if not, marking the updated semantic control and the associated semantic control as invalid in the semantic document object model and indicating the verification identification reason.

7. The large language model-based financial document editing method according to claim 1, characterized in that: It also includes correcting the financial document when the verification fails and adding disclosure information in the financial document. 8.A financial document editing system based on a large language model, characterized by, The system comprises a semantic document engine, a declarative logic compiler, a workflow orchestrator, an interactive agent, a knowledge retrieval agent, a content generation agent, a data and compliance verification agent, and a financial knowledge graph; The semantic document engine is configured to parse a financial document into a semantic document object model; the semantic document object model adopts a tree structure, and each node of the tree structure is a semantic control with financial semantics; The declarative logic compiler is configured to extract constraint conditions between semantic controls of the financial document; The interactive agent is configured to obtain an editing instruction of the financial document, so that the semantic document engine updates corresponding semantic controls in the semantic document object based on the editing instruction under the control of the workflow orchestrator, to generate updated semantic controls; The workflow orchestrator is configured to obtain, in the declarative logic compiler, associated semantic controls corresponding to the updated semantic controls based on the constraint conditions; The content generation agent is configured to update the associated semantic controls based on the updated semantic controls under the control of the workflow orchestrator; The financial knowledge graph is configured to store structured financial knowledge; The knowledge retrieval agent is configured to query structured financial knowledge corresponding to the updated semantic controls and the associated semantic controls based on the financial knowledge graph; The data and compliance verification agent is configured to verify the updated semantic controls and the associated semantic controls based on the structured financial knowledge, to complete editing of the financial document after passing the verification.

9. An electronic device, comprising: The electronic device comprises a processor and a memory; The memory is configured to store a computer program; The processor is configured to execute the computer program stored in the memory, so that the electronic device executes the financial document editing method based on a large language model according to any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the electronic device to implement the financial document editing method based on a large language model according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Financial text checking system based on knowledge base

    CN113887199A

  • End-to-end agent financial model method suitable for multi-modal financial analysis task

    CN118394894A