Financial format file processing method and device based on large language model

By integrating generation and proofreading capabilities through a large language model, the system achieves fully automated processing of financial documents, solving the problems of functional fragmentation and insufficient intelligence in existing systems, improving processing efficiency and standardization, and adapting to multiple output scenarios.

CN121525634APending Publication Date: 2026-02-13珠海盈米基金销售有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511569477.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing financial document processing systems suffer from fragmented functions, low intelligence, and narrow scenario adaptability, resulting in low operational efficiency. They cannot automate the entire process of generation, proofreading, and conversion, and cannot meet the personalized format specifications of different financial institutions.

Method used

It integrates generation and proofreading capabilities using a large language model, and achieves fully automated processing of financial documents through file format recognition, redundant information filtering, semantic-level proofreading, HTML intermediate representation, and template-driven methods, including uploading, generation, extraction, proofreading, and conversion, adapting to multiple output scenarios.

Benefits of technology

It improves processing efficiency by more than 30%, ensures that financial terminology, data formats and clause logic comply with industry standards, reduces compliance risks, adapts to output needs in multiple scenarios, and meets the personalized format standards of different financial institutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121525634A_ABST
    Figure CN121525634A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of financial science and technology and artificial intelligence cross fusion, in particular to a financial format file processing method and device based on a large language model, and the method comprises the steps: receiving a file uploading or generating instruction, responding to the uploading instruction, carrying out format recognition and integrity verification, storing, and generating a ready signal; and in response to the generation instruction, constructing a cue word containing financial scene parameters, calling a large language model to generate content and generating a signal. And extracting a text through an adaptive analyzer based on the signal, filtering redundancy, converting into a standard JSON format, and driving a large language model to proofreading in combination with a special prompt word in the financial field to generate a compliant text. And after converting into a structured HTML intermediate representation and checking, analyzing an HTML matching template, filling placeholders, mapping into a Word format of a financial specification, and outputting a file which conforms to the business specification through special checking. Full-process automation is achieved, efficiency is improved, compliance risks are reduced, and the method is suitable for multiple scenes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of the cross-fusion of financial technology and artificial intelligence, and in particular to a financial format file processing method and device based on a large language model. BACKGROUND

[0002] There are currently many related products in the field of financial document processing, but there are obvious limitations in technical application and function implementation. The specific status is as follows: 1. Fragmented functions, lack of full-process closed-loop capabilities: Beijing Hongyingfeng Software Co., Ltd. "Financial Industry Investment Report Automatic Generation System" can only generate fund management and clearing reports based on fixed templates and preset data, cannot generate new content in response to dynamic user instructions, and does not involve content proofreading and format conversion, which requires manual connection to other tools; Hehe information "TextIn intelligent document extraction platform" only focuses on extracting field information from existing documents (such as letters of credit and transaction contracts), has no content generation and professional format conversion capabilities; Tencent Writing Assistant (Financial Edition) only provides writing assistance and template recommendations, and the generated content needs to be manually proofread, and when converted to a financial standard Word file, the format needs to be manually adjusted, with at least 3 tool switches throughout the process, which is cumbersome to operate.

[0003] 2. Single technical application, limited intelligent degree: existing products mostly rely on rule engines or fixed templates, and do not deeply integrate the generative and semantic understanding capabilities of large language models. For example, the "1104 Report Application System" of Hengfeng Bank only realizes automatic generation and review for specific regulatory reports, relies on preset verification rules, and cannot handle complex tasks such as unstructured text generation (such as customized financing agreements) and semantic-level proofreading (such as correcting errors in financial terminology combinations). The content proofreading link mainly uses simple character matching, which can only identify basic spelling errors and cannot deeply optimize financial terminology logic (such as confusion between "annual yield" and "annual interest rate"), data expression standardization (such as missing capitalization of amounts), and clause compliance (such as missing "overdue penalty interest" clauses in loan contracts).

[0004] 3. Narrow scene adaptability, insufficient format conversion accuracy: Existing systems are mostly designed for a single scenario, such as the "1104 Report Application System" of Hengfeng Bank, which only serves regulatory reports and cannot adapt to investment banking reports, guarantee agreements, and other financial documents. The template of the financial industry investment report automatic generation system is fixed and cannot meet the individualized format specifications of different institutions such as securities companies, banks, and fund companies. At the same time, the format conversion function has obvious defects: the "Save as Word" function of ordinary document tools can easily cause header and footer disorder, formula layout errors, and table style distortion; information extraction techniques and other tools do not have the ability to convert content into financial-specific Word format, and manual and time-consuming adjustments of font, line spacing, and signature position are required, which does not meet the strict requirements of the financial industry on document format.

[0005] 4. User interaction is fragmented, and operation efficiency is low: Users need to repeatedly switch between generation tools, proofreading tools, and format conversion tools, manually import and export files, which can easily lead to data loss or format disorder. For example, after generating content using Tencent Writing Assistant, the content needs to be copied to the proofreading software for modification and then imported into the format tool for style adjustment. The whole process requires at least 3 times of tool switching, and the operation process is complicated. In summary, existing products have not formed an integrated solution of "generation-proofing-conversion", lack deep integration of large language models in technology, cannot cover the whole process of financial document processing in function, and are difficult to meet the core needs of the financial industry for efficient, accurate, and intelligent document processing. SUMMARY

[0006] The present application provides a financial format file processing method and device based on a large language model to solve the problem of traditional financial document processing relying on manual work, low efficiency, and insufficient accuracy in the prior art.

[0007] In a first aspect, the present application provides a financial format file processing method based on a large language model, comprising: receiving a user input financial file upload instruction or a financial file generation instruction; In response to the financial file upload instruction, after file format identification and integrity verification, storing to a temporary directory and generating a file ready signal; or, in response to the financial file generation instruction, constructing a generative prompt word containing financial scenario parameters, calling a first large language model to generate content, and temporarily storing the content in a pure text format to a cache area and generating a file ready signal; Based on the file ready signal, the original text content in the financial file is extracted through a parser adapted to the financial file format, and the extracted content is subjected to redundant information filtering to generate key information converted into a standard JSON format containing "content" field storing text content and "fields" field storing structured key-value pair data; The prompt words generated based on the plurality of financial field special prompt word modules are spliced with the "content" field in the JSON format to generate a second large language model input instruction, which drives the second large language model to perform semantic level proofreading on the text, and outputs the proofread text conforming to the industry standard; The proofread text is converted into a structured HTML intermediate representation independent of the output format, and the conversion process includes embedding machine-readable structure and style tags according to semantic and format characteristics, standardizing and converting non-text elements, and checking the legality of the tags and the integrity of the non-text elements; The HTML intermediate representation is parsed, a template in the preset financial format template library is matched, and the financial special placeholder is filled, the HTML format is mapped into the financial standard Word format, and after structure, style and data special checking are performed on the financial standard Word format, a Word file conforming to the business standard of the financial institution is output.

[0008] The financial format file processing method based on the large language model provided in the embodiments of the application realizes the full-process automation of "uploading / generating - extracting - proofreading - converting - outputting" of the financial file by integrating the large language model generation and proofreading capability, HTML intermediate representation conversion and template driven Word mapping. The problems of tool fragmentation and manual intervention in the traditional processing are solved, and the processing efficiency is improved by more than 30%; through semantic level proofreading and special checking, it is ensured that the financial terms, data format and clause logic conform to the industry standard, and the compliance risk is reduced; the HTML intermediate representation realizes format independence, adapts to multiple scene output requirements, meets the individualized format standards of different financial institutions, and balances efficiency and standardization.

[0009] In an optional embodiment, based on the file ready signal, the original text content in the financial file is extracted by a parser adapted to the financial file format, and the extracted content is subjected to redundant information filtering to generate key information converted into a standard JSON format containing a "content" field storing text content and a "fields" field storing structured key-value pair data, including: Based on the file ready signal, the corresponding parsing engine is called according to the file type to perform field scanning on the structured file, the form fields in the file are traversed, the field names and corresponding values are extracted and stored as key-value pairs; for unstructured files, the NLP word segmentation tool is used to segment the text, filter stop words, and extract noun phrases as key information, and the NLP word segmentation tool is Jieba financial word segmentation library; Redundant information filtering is performed by comparing a preset redundant keyword library to delete paragraphs containing redundant keywords, and merging repeatedly appearing same clauses; The extracted key information is converted into a standard JSON format containing a "content" field to store the text content and a "fields" field to store structured key-value pair data. The present application extracts key information from structured and unstructured financial documents with high accuracy by adapting different format parsing engines and redundancy filtering mechanisms, and unifies the key information into a standard JSON format. The combination of structured file field scanning and unstructured file word extraction improves the information extraction accuracy to more than 95%. Redundant information filtering removes invalid content and merges duplicate clauses to simplify the text volume. The standard JSON format provides a unified data interface for subsequent proofreading and format conversion, avoiding processing gaps caused by format differences, and enhancing process continuity and data consistency. In an optional embodiment, the plurality of financial field-specific prompt word modules includes at least: A grammar proofreading template whose prompt words are used to check the grammatical errors of financial text content and correct the collocation of financial terms. A financial term compliance module whose prompt words have a mapping table of correct usage of easily confused terms to drive the model to replace and unify the terms. A financial data standardization module whose prompt words specify that the amount must be output in both uppercase and lowercase formats, the interest rate must be clearly typed and the interest calculation basis, and the date must be converted to a pre-set standard format. A clause logic completeness module whose prompt words have a list of essential clauses for different types of financial documents to drive the model to check and prompt to supplement missing clauses.

[0010] The embodiments of the present application provide a plurality of parallel financial field-specific prompt word modules to solve the pain points of financial text proofreading: grammar correction to correct term collocation errors, financial term compliance module to unify easily confused terms, data standardization module to standardize amount, interest rate, and date expressions, and clause logic module to complete essential clauses. Compared with traditional rule checking, the coverage is more comprehensive, the semantic level proofreading accuracy is improved, and the text is ensured to comply with industry standards in terms of terminology, data, and logic, reducing the cost and risk of manual proofreading.

[0011] In an optional embodiment, after the step of driving the second large language model to perform semantic level proofreading on the text and output the proofread text that complies with industry standards, the method further includes: Recording each modification made by the second large language model to the text, marking the difference points through a pre-set string comparison algorithm, and generating a revision log containing the modification location, modification reason, and modification basis. The log is stored in an exportable text format, supporting user review of historical modification records. The output of the proofread text conforming to the industry standard is subjected to a secondary verification of financial compliance, including: calling an independent rule engine to check the completeness of the clauses, the accuracy of the terms and the standardization of the data based on relevant financial regulatory provisions, and updating the proofread content to the "content" field of the JSON after the verification, wherein the financial data content needs to be stored in a standard format. The embodiment of the application modifies details through a revision log record model, realizes traceability of the proofreading process, meets the requirements of the financial supervision "business trace", facilitates auditing and dispute tracing, and strengthens the compliance of the proofreading results by combining the provisions of the regulations with the secondary verification of the independent rule engine, so as to reduce the data error rate. The exportable log supports user review and model iteration optimization, and enhances the trust in automatic processing. The double mechanism not only guarantees the text standardization, but also improves the process transparency, and adapts to the strict compliance and auditing requirements of the financial industry.

[0012] In an optional implementation, the generation of the structured HTML intermediate representation includes: adding corresponding HTML tags to the structured content and paragraphs of the financial text according to types, retaining style information and logical structure and marking non-text element insertion positions; The non-text elements are subjected to standardized conversion processing, wherein the pictures / charts are converted into PNG pictures of a specified size and corresponding embedded tags are generated, and the formulas are converted into LaTeX format and then embedded or retained in the text form through a special tool. The HTML tags are checked for legality and the non-text element resources are checked for integrity, and errors are corrected to generate an HTML file conforming to the W3C standard. The HTML file and related resources are packaged and stored in a temporary path, and a ready signal is sent.

[0013] The embodiment of the application retains the text logic and style through semantic tags based on the structured HTML intermediate representation, and ensures cross-format compatibility through standardized processing of non-text elements (conversion of pictures to PNG and conversion of formulas to LaTeX). The integrity of the tags and resources is checked to avoid conversion errors, and a file conforming to the W3C standard is generated, laying a foundation for subsequent format mapping. Compared with direct format conversion, the intermediate representation reduces the difficulty of format adaptation, improves the mapping accuracy from HTML to Word, solves problems such as formula disorder and table distortion, and guarantees the rigor of the financial file format. In an optional implementation, the HTML intermediate representation is parsed, a template in a preset financial format template library is matched, and a financial special placeholder is filled to map the HTML format to a financial standard Word format, including: When the ready signal is detected, the HTML file is downloaded to the local directory of the plug-in, the character encoding and document title are extracted by parsing the header of the HTML file, the file size is calculated and compared with the declared size before downloading, and if they are consistent, it is determined that the reception is complete, otherwise a retransmission request is sent. loading the HTML file to the DOM parser, building the DOM tree structure, traversing the DOM tree, extracting the text content and format attributes, and establishing a content-format mapping table; reading a target Word template in a preset financial format template library, the template containing placeholders for mandatory elements in a financial scenario; parsing the placeholders in the template and matching them with structured fields extracted from the HTML intermediate representation, wherein key verification is performed on financial-specific fields, including: the amount field needs to match both the uppercase amount and the lowercase amount, and the interest rate field needs to match the interest rate type and the interest calculation basis; converting the format defined by the HTML tags into a Word format that conforms to the financial industry specifications, performing the following mapping operations, including: mapping specific HTML tags to predefined Word styles in the template that conform to the financial document format standards; adjusting the column width of HTML tables according to financial report specifications and automatically adding data verification formulas; uniformly converting date formats to the preset financial industry standard format; If there are financial mandatory placeholders that cannot be matched with the structured fields, an interactive prompt is generated to request the user to supplement the corresponding information, and the matching is completed after receiving the user input.

[0014] The present application realizes accurate mapping from HTML to financial standard Word through HTML parsing, template matching and placeholder verification. File integrity verification ensures reliable data transmission; DOM parsing and mapping table establishment realize accurate association of content and format; double verification of financial-specific fields (amount case, interest calculation basis) and user interaction supplement mechanism solve the problem of missing key information; tag and table format adaptation conforms to the financial document standard, reducing 90% of manual format adjustment work, and the output file directly meets the business use requirements.

[0015] In an optional embodiment, after the financial standard Word file is subjected to structure, style and data special verification, a Word file that conforms to the business specifications of financial institutions is output, including: loading the selected Word template, creating a new document object, and writing the content and format into the document according to the content-format mapping table, replacing the placeholders with actual content and applying the corresponding style; arranging the content in the order of paragraphs in the HTML, maintaining consistent logical structure, and performing financial format special verification, then receiving the user-specified storage path or default saving path, outputting a Word file that conforms to the business specifications of financial institutions, and clearing the cache files in the temporary directory; wherein the special verification includes: Structure verification: check whether the contract contains preset mandatory elements, or whether the financial statements contain preset essential items. If this verification fails, an exception message is corrected, and the cycle is repeated three times. After three times, manual intervention is required; style verification: confirm whether the font, signature area position, and page header and footer comply with the preset financial institution document format standard. If there is an exception, load the selected template to modify; data verification: verify whether the amount is consistent in upper and lower case, whether the interest rate is expressed correctly, and whether the table data cross-check relationship is established. If there is an exception, it is automatically corrected.

[0016] The special verification mechanism provided by the embodiment of the application guarantees the output quality from three aspects of structure, style, and data: the structure verification ensures that the mandatory elements are complete, the style verification unifies the financial document format (font, signature position, etc.), and the data verification corrects the amount, interest rate, and table cross-check relationship errors. Automatic correction combined with manual intervention improves the compliance rate of the file to 99%. The default storage path and cache cleaning mechanism optimize user experience and avoid redundant data occupying space. The final output Word file does not need to be edited again and directly meets the business and archiving requirements of financial institutions, improving the efficiency of terminal use.

[0017] In a second aspect, the application provides a financial format file processing device based on a large language model, which comprises: A user input receiving module for receiving user input financial file upload instructions or financial file generation instructions; A user input response module that, in response to the financial file upload instruction, performs file format identification and integrity verification, stores the file in a temporary directory, and generates a file ready signal; or, in response to the financial file generation instruction, constructs a generative prompt word containing financial scenario parameters, calls the first large language model to generate content, and stores the content in a cache area in pure text format and generates a file ready signal; A financial text content acquisition module for extracting the original text content in the financial file based on the file ready signal through an analyzer adapted to the financial file format and performing redundant information filtering on the extracted content to generate key information, and converting the key information into a standard JSON format containing a "content" field to store the text content and a "fields" field to store structured key-value pair data; A financial text content correction module that concatenates the prompt words generated by the plurality of financial field-specific prompt word modules with the "content" field in the JSON format to generate a second large language model input instruction, drives the second large language model to perform semantic-level correction on the text, and outputs the corrected text that complies with industry standards; The HTML conversion module is configured to convert the proofread text into a structured, output-format-independent HTML intermediate representation, and the conversion process includes embedding machine-readable structure and style tags according to semantic and format features, performing standardized conversion processing on non-text elements, and checking the legality of tags and the integrity of non-text elements. The Word file output module is configured to parse the HTML intermediate representation, match a template in a preset financial format template library, and complete financial exclusive placeholder filling, map the HTML format to a financial standard Word format, perform structure, style and data special checks on the financial standard Word format, and output a Word file that meets the business specifications of a financial institution.

[0018] In a third aspect, the present application provides an electronic device, comprising a memory and a processor, the memory and the processor being communicatively connected with each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the large language model-based financial format file processing method of the first aspect or any of the corresponding embodiments thereof.

[0019] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing computer instructions, the computer instructions being used to make a computer execute the large language model-based financial format file processing method of the first aspect or any of the corresponding embodiments thereof.

[0020] In a fifth aspect, the present application provides a computer program product, comprising computer instructions, the computer instructions being used to make a computer execute the large language model-based financial format file processing method of the first aspect or any of the corresponding embodiments thereof. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the drawings needed in the specific embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0022] Figure 1 FIG. 1 is a flow diagram of a large language model-based financial format file processing method according to an embodiment of the present application; Figure 2 FIG. 2 is a structural block diagram of a large language model-based financial format file processing device according to an embodiment of the present application; Figure 3 FIG. 3 is a hardware structure diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.

[0024] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0025] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0026] According to an embodiment of the present invention, a method for processing financial format documents based on a large language model is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here. Figure 1 This is a flowchart of a financial format file processing method based on a large language model according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S1: Receive the user's input of a financial document upload instruction or a financial document generation instruction.

[0027] Specifically, this embodiment of the invention starts a file receiving port, allowing users to select local files by clicking the "Upload File" button on the system interface, while simultaneously listening for large language model generation request commands. By supporting both "upload existing files" and "generate new files" commands, it covers the full-scenario needs of financial institutions for "standardized processing of existing files" and "intelligent generation of incremental files," solving the limitation of traditional systems that only support a single input method and improving the flexibility of business processing.

[0028] In an example, if the user selects "Upload File", the program calls the file reading interface to obtain the local file (supports.docx,.pdf,.txt, etc. formats), and loads the file content into the memory buffer, meeting the standardized processing needs of the financial institutions for existing files; if the user selects "Generate File", the program receives the user's natural language instruction (such as "Generate a 2024 quarterly financial analysis report"), and encapsulates the instruction into a request format recognizable by a large language model (such as Claude3.7 or GPT-4, etc.), this process dynamically generates new financial files based on user needs, without relying on existing files, suitable for the rapid creation of incremental files, and improves the generation efficiency of financial documents.

[0029] Step S2, in response to the financial file upload instruction, after file format recognition and integrity check, store to temporary directory and generate file ready signal; or, in response to the financial file generation instruction, construct a generative prompt word containing financial scenario parameters, call the first large language model to generate content, temporarily store in the cache area in plain text format and generate a file ready signal. Specifically, perform format recognition on the uploaded file (call format detection algorithm, recognize file suffix and binary header information), if it is a supported format (TXT, DOC, PDF, etc.), integrity check is performed; if it is a non-supported format, a pop-up window prompts "Only TXT, DOC, PDF format files are supported, please upload again". After the last successful file integrity check, the file is checked by comparing the file hash value with the check value when the user uploads it, if they are consistent, the file is determined to be complete, stored in the temporary directory (for example, the path is " / system / temp / file / ") and a file ready signal is generated; if they are not consistent, return the "file is damaged, please upload again" prompt.

[0030] When receiving a user generation request (such as the user inputting "Generate a loan contract for a 1 million loan"), extract the key parameters (amount, contract type) in the request, match the preset generation prompt word template (such as "Based on the amount [X], type [Y], generate a loan contract that meets the "Loan Regulations", including borrower information, repayment terms, and default liability"). Call the large language model API (such as the GPT-4 financial version interface), send the combined prompt word, set the timeout time to 30 seconds, if the response is not received within the timeout, retry 2 times and feedback "generation timeout, please try later". Receive the generated content returned by the large language model, temporarily store it in the cache area in plain text format (file name is "generated_timestamp.txt"), and generate a file ready signal. The embodiment of the application filters invalid files through format verification and integrity detection, reduces the abnormal processing pressure of subsequent process, and improves the system stability. The large language model is accurately called based on user demand, the financial field adaptability of the initial file content is guaranteed, and invalid content irrelevant to the financial scene is avoided.

[0031] Step S3, based on the file readiness signal, the original text content in the financial file is extracted by the parser adapted to the financial file format, and the extracted content is executed redundancy information filtering, to generate key information converted into a standard JSON format containing a "content" field storing text content and a "fields" field storing structured key-value pair data; specifically, the following steps are included: Step S31, based on the file readiness signal, the corresponding parsing engine is called according to the file type to perform field scanning on the structured file, the form fields in the file are traversed, the field name and the corresponding value are extracted, and are stored as a key-value pair; for example, the form fields in the file are traversed, the field name (such as "Party A name" "borrowing date") and the corresponding value are extracted, and are stored as a key-value pair (such as {"Party A name":"XX Company","borrowing date":"2024-05-20"}). For picture files, the original content is extracted by OCR, redundant format marks (such as watermarks, headers and footers in pdf) are removed, and core text information is retained.

[0032] Step S32, for unstructured files, NLP word segmentation tools are used to segment the text, stop words are filtered, and noun phrases are extracted as key information, the NLP word segmentation tool is Jieba financial word segmentation library; for example, the text is segmented by using Jieba financial word segmentation library, stop words (such as "of" "in") are filtered, and noun phrases (such as "loan interest rate" "guarantee method") are extracted as key information. Step S33, redundancy information filtering is performed, by comparing a preset redundancy keyword library (such as "Note: This is a draft" "temporary version"), paragraphs containing redundant keywords are deleted, and repeated identical clauses (such as repeated "dispute resolution method" clauses) are merged; Step S34, the extracted key information is converted into a standard JSON format containing a "content" field storing text content and a "fields" field storing structured key-value pair data. The embodiment of the application extracts core business information to provide "lightweight" data for subsequent proofreading and format conversion, and improves processing efficiency. Differentiated extraction strategies are adopted for structured and unstructured files to ensure that the extraction accuracy of key data (such as amount and term) in the financial field is above 99%. Through redundancy filtering, the interference of invalid information on the proofreading module is reduced, and the proofreading focuses on the core content.

[0033] Step S4, the prompt words generated based on the multiple financial field specific prompt word modules are spliced with the "content" field in JSON format to generate a second large language model input instruction, which drives the second large language model to perform semantic level proofreading on the text, and outputs the proofread text conforming to the industry standard.

[0034] Specifically, when receiving JSON data, first check the data format (check if it contains "content" and "fields" fields), if the format is incorrect, return "data format exception, please resend". If the format is correct, call the financial scenario exclusive template from the pre-set multiple financial field specific prompt word modules, at least including: 1. Syntax proofreading template, its prompt words are used to check the syntax errors of financial text content and correct the collocation of financial terms; for example, "lending loans" cannot be written as "lending loans", to ensure compliance with "Financial Term Usage Specification". 2. Financial term compliance module, its prompt words pre-set a correct usage mapping table of easily confused terms, used to drive the model to replace and unify the terms; for example, "identify easily confused financial words (such as 'rights' and 'power', 'deposit' and'subscription') in the text and correct them, where 'deposit' must comply with Article 586 of the Civil Code for guarantee nature, and'subscription' is only a prepayment expression". 3. Financial data standardization module, its prompt words clearly specify that the amount must be output in both uppercase and lowercase formats, the interest rate must be clearly specified as the type and basis for calculating interest, and the date must be converted to the pre-set standard format; for example, check the specification of amount, interest rate and date expression: the amount must contain uppercase (such as 'RMB 100 million') and lowercase (such as '¥1,000,000.00'); the interest rate must indicate the type (annual / monthly) and the basis for calculating interest (such as 'annual interest rate 5% (based on 330 days)'); the date is unified to 'YYYY year MM month DD day' format. 4. Clause logic completeness module, its prompt words have built-in lists of essential clauses for different types of financial documents, used to drive the model to check and prompt to supplement missing clauses; for example, a loan contract must have the clause "interest rate adjusted based on the same period LPR of the central bank", if missing, prompt to supplement.

[0035] Further, the content of the "content" field in JSON is spliced with the prompt words of each of the above modules to generate a large language model input instruction (such as "[data expression template prompt word] + [text content]"), and the model interface is called (the timeout is set to 30 seconds).

[0036] After the text is obtained in accordance with the industry standard, the embodiment of the application also records each modification made by the second large language model to the text, marks the difference points through a preset string comparison algorithm, and generates a revision log containing the modification position, modification reason and modification basis, the log is stored in an exportable text format, and supports user to check historical modification records. For example, find the difference points with the original content through the Levenshtein distance algorithm, and mark the financial exclusive correction items (such as “before correction: borrow 1 million yuan → after correction: borrow RMB 1 million yuan (¥1,000,000.00) ” “before correction: annual yield 5% → after correction: annual interest rate 5% (interest is calculated according to 330 days) ”), and the generated revision log is as follows: 1, generation time: 2024-10-20 15:30:00; Modification position: at the expression of the amount of borrowed money; Original content: ¥500,000.00; Modified content: RMB 50 million yuan (¥500,000.00); Modification reason: does not contain the amount in capital letters, does not comply with the financial data expression standard; Modification basis: Article 3.2.1 of “Standard for Financial Institution Document Format” (amount should be marked in both upper and lower case).

[0037] 2, generation time: 2024-10-20 15:31:00; Modification position: at the expression of interest rate; Original content: annual yield 5%; Modified content: annual interest rate 5% (interest is calculated according to 330 days); Modification reason: “annual yield” is a vague expression, which does not clearly indicate the basis for calculating interest; Modification basis: Article 6 of “Provisions on the Management of Renminbi Interest Rates” (interest rate should be marked with type and basis for calculating interest).

[0038] The application is Harry, by recording the modification position, reason and basis in detail, realizing the traceability of the whole process of financial text revision, meeting the requirements of “business trace” of financial supervision (such as the provisions of the China Banking and Insurance Regulatory Commission “Banking Financial Institutions Comprehensive Risk Management Guidelines” on the preservation of document modification records), the revision basis is directly related to financial regulations (such as “Civil Law” and “Provisions on the Management of Renminbi Interest Rates”) and industry standards, the compliance logic of each modification is clear, the user can check the historical modification records, understand the model optimization logic clearly, and enhance the trust in the results of automatic processing; In the multi-person cooperation scene (such as legal audit and business approval), the log can be used as a communication basis to reduce the cost of repeated explanation.

[0039] The embodiment of the application performs financial compliance secondary verification on the output of the proofread text conforming to the industry standard, including: calling an independent rule engine, checking the completeness of the relevant financial regulatory provisions, the accuracy of the terms, and the standardization of the data, and updating the proofread content to the "content" field of JSON after verification. The financial data class content needs to be stored in a standard format. Specifically: 1. Clause completeness: check if the required clauses of financial regulatory requirements are supplemented (such as loan contracts need to include "overdue penalty interest calculation method"); if there are non-compliance items, generate targeted prompts based on non-compliance items (such as "According to Article 20 of the People's Bank of China's Regulations on the Management of the Renminbi Interest Rate, change '2 points per month' to '2% per month'") and call the model again.

[0040] 2. Term accuracy: check if the corrected legal terms such as "mortgage" and "pledge" conform to the definition of the Property Rights Code of the Civil Code; 3. Data standardization: verify that the amount is consistent in upper and lower case, and the interest rate is consistent with the "Regulations on the Management of Interest Rates" (prohibit ambiguous expressions such as "annual yield").

[0041] The embodiment of the application accurately corrects the term confusion in financial documents (such as "discount" and "discount"), data format errors (such as missing amount in capital), and compliance clause omissions through financial exclusive prompt templates and secondary verification, far exceeding the scope of general text correction. Relying on financial regulatory rules (such as the Civil Code and the Regulations on the Management of Interest Rates) to build verification rules to avoid "hallucinations" of large language models that produce corrections that do not conform to industry standards (such as mistakenly changing "deposit" to "deposit" resulting in a change in legal nature). The output of the proofread content not only has standard grammar, but also contains data formats, essential clauses, and other elements that meet the requirements of the financial industry, laying the foundation for subsequent HTML conversion and final generation of compliant Word files.

[0042] Step S5, converting the proofread text into a structured, format-independent HTML intermediate representation, the conversion process including: embedding machine-readable structure and style tags according to semantic and format characteristics, and standardizing non-text element conversion processing, and checking label legality and non-text element integrity. Specifically, the following steps are included: Step 51: Add corresponding HTML tags to the structured content and paragraphs of financial text according to type, retain style information and logical structure, and mark non-text element insertion positions.

[0043] Specifically, the corrected JSON data is received, the content of the "content" field is extracted, and the content is divided into independent paragraphs according to the paragraph mark (" \n\n ") and stored as a list ["paragraph 1", "paragraph 2"...]. The paragraph list is traversed to identify format elements: if the paragraph starts with "Chapter X", it is determined to be a first-level title, and the content is wrapped <h1>Label; if starting with "1.X", determine as secondary title, wrap< / h1> <h2>tags; replace with text . Step 52: Standardize non-text elements, where pictures / charts are converted into PNG images of specified size and corresponding embedded tags are generated, and formulas are converted into LaTeX format and embedded or kept in text form through special tools.

[0044] Specifically, extract embedded pictures in the document, user-uploaded charts, or convert structured chart data into PNG images (standardize size ≤1024x768 using ImageMagick), and store them in images / . , and insert them into the text bit by bit; if failed, generate placeholder tags.

[0045] Convert text description formulas into LaTeX (call large language model), and directly clean LaTeX formulas; introduce MathJax, and \([LaTeX formula]\) embed, and display text formulas if not supported. Step 53: Check the legality of HTML tags and the integrity of non-text element resources and correct errors, generate HTML files that meet W3C standards, and store them in temporary paths after packaging with related resources, then send a ready signal.

[0046] Specifically, perform tag legality detection, check tag nesting (such as prohibiting Label nesting < / h2> <h1>), if errors exist, automatically correct (e.g., change < / h1> <h1>Title< / h1> to <h1>Title< / h1> ). An HTML file conforming to the W3C standard (DOCTYPE declaration is <!DOCTYPE html>) is generated, the storage path is " / system / temp / html / ", the file name is consistent with the original file (for example, "generated_timestamp.html"), and an "HTML ready" notification is sent.

[0047] The embodiment of the application converts pure text content into structured HTML format, defines the hierarchical relationship (title, paragraph) and style attribute (bold, table) of the content through tags, and provides a parseable format mark for subsequent Word format conversion. The syntax specification of the HTML file is ensured, the plug-in core module is prevented from failing to parse due to tag errors, and the success rate of format conversion is improved. By unifying the file output format, the plug-in core module does not need to adapt to multiple text formats, and the development complexity is reduced. Step S6, parse the HTML intermediate representation, match the template in the preset financial format template library, and complete the financial exclusive placeholder filling, map the HTML format to the financial standard Word format, and output the Word file conforming to the business specification of the financial institution after the financial standard Word format is subjected to structure, style and data special item verification.

[0048] Specifically, the HTML intermediate representation is parsed, the template in the preset financial format template library is matched, and the financial exclusive placeholder filling is completed, and the HTML format is mapped to the financial standard Word format, including the following steps: Step S61, when the ready signal is listened to, the HTML file is downloaded to the plug-in local directory, and the character encoding and document title are extracted by parsing the HTML file header, the file size is compared with the declared size before downloading, and if they are consistent, it is determined that the reception is complete, otherwise a retransmission request is sent; Specifically, when the ready notification is monitored, the embodiment of the application downloads the HTML file to the local directory of the plug-in (‘ / plugin / temp / ’) through the FTP protocol. Further, the header of the HTML file (meta information in the tag) is parsed to extract the character encoding (such as ‘UTF-8’) and the document title. If the encoding information is not found, the decoding is performed according to the default ‘UTF-8’. The file size is compared with the declared size before downloading. If they are consistent, it is determined that the receiving is complete. Otherwise, a ‘retransmission’ request is sent to the conversion module (with a maximum of 3 retries).

[0049] In step S62, the HTML file is loaded to the DOM parser to build a DOM tree structure, the DOM tree is traversed to extract the text content and format attribute, and a content-format mapping table is established. Specifically, the DOM tree structure (including tag nodes and text nodes) is built through the DOM parser, then the DOM tree is traversed to extract the text content: for the text node, the nodeValue is directly obtained; for the table node (‘table’), the table header (‘thead’) and table body (‘tbody’) are extracted, and the table header and table body are further parsed to extract the table header and table body rows (‘tr’), and the table header and table body cells (‘th’ and ‘td’). ), by row ( ) and single cells (e.g., a single cell of a single organism) ) Extract content and store as a two-dimensional array.

[0050] Further, extract format attributes: parse the style attribute (e.g., "font-weight:bold" corresponds to "bold") and class attribute (e.g., "title" corresponds to "Song Ti, No. 2 word") of the label, record the format information of each content block (e.g., "Paragraph 1: [Content: XXX, Format: Bold, Centered]"), establish a content-format mapping table (JSON format, key is content hash value, value is format description), and store it in the memory cache.

[0051] Step S63, read the target Word template in the preset financial format template library, which contains placeholders for financial scenario mandatory elements; Specifically, read the financial format template library in the preset path (e.g., path " / plugin / template / word / "), which includes "loan contract.dotx" "financial statement.dotx" "guarantee agreement.dotx" and other templates, containing financial scenario mandatory elements (e.g., loan contract template presets "interest rate based" "overdue interest penalty clause" placeholders, financial statement template presets "data reconciliation relationship verification area"); users can select the corresponding template through the system interface. Step S64, parse the placeholders in the template and match them with the structured fields extracted from the HTML intermediate representation, where key checks are performed on financial exclusive fields, including: amount fields need to match both uppercase and lowercase amounts, and interest rate fields need to match interest rate types and interest calculation bases; For example, parse the placeholders in the template (e.g., {Party A name} {loan amount} {annual interest rate}) and match them with the structured fields obtained by the content extraction unit (key-value pairs in "fields"), with key checks on financial exclusive fields: amount fields need to match both "uppercase amount" and "lowercase amount" (e.g., {{loan amount}} needs to correspond to "RMB 100,000.00" and "¥1,000,000.00"); interest rate fields need to match "interest rate type (annual / monthly)" and "interest calculation basis" (e.g., {{annual interest rate}} needs to correspond to "5% (interest calculation based on 330 days)").

[0052] Step S65, convert the format defined by HTML tags to Word format that conforms to financial industry standards, perform the following mapping operations, including: map specific HTML tags to pre-defined Word styles in the template that conform to financial document format standards; adjust column width of HTML tables according to financial report specifications and automatically add data verification formulas; uniformly convert date formats to preset financial industry standard formats; In particular, the tag mapping is: <h2>The label is mapped to the "secondary title" style in the template (bold, small, left-aligned, in line with the "Financial Institution Document Format Standard"); The label is mapped to the "financial focus" style (bold, SimSong GB2312, used to highlight key terms such as "default liability"); Table adaptation: HTML table column width is adjusted according to financial report specifications (e.g. "asset item" column width in balance sheet is fixed at 12 characters), and "data verification formula" is automatically added (e.g. "total line = sum of each detail line"); Date format: Convert to "YYYY Year MM Month DD" (e.g. "2024-05-20" in HTML to "2024 Year 05 Month 20 Day"), reject non-standard formats.

[0053] Step S66, if there is a financial mandatory placeholder that fails to match the structured field, an interactive prompt is generated to request the user to supplement the corresponding information, and the matching is completed after receiving the user input.

[0054] For example, if there is an unmatched financial mandatory placeholder (e.g. the template has {{guarantee method}} but there is no corresponding field in the content, or the amount is only in lowercase and does not match the uppercase), a pop-up prompt is given to the user "Please supplement the guarantee method information (such as 'joint and several liability guarantee') "Please complete the amount in uppercase", and the matching is completed after receiving the user input.

[0055] After the financial specification Word document is structured, styled and data-specifically verified, the output is a Word document that meets the business specifications of financial institutions, including: loading the selected Word template, creating a new document object, mapping content and format to the content-format mapping table, replacing placeholders with actual content, and applying corresponding styles; arrange the content in the order of paragraphs in HTML, maintain consistent logical structure, and perform financial format-specific verification, receive user-specified storage path or specify save path by default, output a Word document that meets the business specifications of financial institutions, and clear the cache files in the temporary directory; call python-docx, load the selected Word template, create a new document object.

[0056] For example, according to the mapping table, write content and format to the document: replace placeholders with actual content (e.g. replace {{overdue interest}} with "According to Article 25 of the "People's Bank of China Interest Rate Management Regulations", the overdue interest rate is 50% higher than the contract interest rate"), apply corresponding styles; arrange the content in the order of paragraphs in HTML, maintain consistent logical structure.

[0057] The financial format special verification in the embodiment of the application includes: 1. Structure verification: check whether the contract contains preset mandatory elements (for example, "signing place" and "effective conditions"), or whether the financial report contains preset essential items. If this verification does not pass, abnormal information correction is performed, and the process is repeated three times. After three times, manual intervention is required; 2. Style verification: confirm whether the text font, signature area position, and header and footer conform to the preset financial institution document format standard. If there is an exception, a selected template is loaded to correct it again; for example, confirm that the text is "Fangsong GB2312, No. 4", the signature area (legal representative and unit seal) is located at the left end of the document (2 cm away from the page margin), and the header is marked "confidential level" (such as "top secret"); 3. Data verification: verify whether the amount is consistent in upper and lower case, whether the interest rate expression is compliant (prohibit "annual yield" and other ambiguous expressions), and whether the table data cross-checking relationship is established (such as "total assets = liabilities + owner's equity" in the balance sheet). If there is an exception, it is automatically corrected (such as regenerating the page number "page X / total Y pages" and centering it).

[0058] After the financial format special verification, the embodiment of the application receives the storage path specified by the user (through the "save location" selection box). If no path is specified, the default storage path is " / user / documents / financial files / ". The file name is "template name_timestamp.docx", and a file preview image (PNG format, resolution 300 dpi) is generated and displayed to the user. After successful output, the message "file generated, path: XXX" is returned, and the cache file in the temporary directory of the plug-in is cleared.

[0059] The embodiment of the application relies on a preset financial template library and a special verification mechanism to ensure that the generated Word file fully adapts to the financial industry standards (such as contract essential provisions, report data verification, and signature area format), and can be directly used in bank lending, securities signing, and other practical scenarios without the need for secondary modification.

[0060] The financial format file processing method based on a large language model provided by the embodiment of the application greatly reduces the need for manual intervention and saves a lot of time and effort, thereby reducing the rework cost caused by human operation errors. In the financial field, a document error can cause serious consequences, such as a wrong amount that can cause huge economic losses. The present application greatly reduces the probability of such errors through accurate correction and format conversion, and reduces the human and time costs caused by rework.

[0061] With the powerful capability of the large language model, the application guarantees the high quality of the financial document in multiple links. In the content generation stage, the large language model can generate content in accordance with the financial professional logic according to the user requirements. For example, when generating an investment analysis report, the key blocks such as market analysis, risk assessment, and yield prediction can be accurately covered. The training data of the large language model covers all categories of financial texts, which can support diversified document generation requirements in different financial fields such as investment banking, asset management, and banking. For example, the application can cope with the prospectus required by investment banks, the product brochure required by asset management companies, and the loan contract required by banks. At the same time, the template library of the format conversion plug-in adopts an extensible architecture, and users can customize and add new financial format templates according to the requirements of their own institutions or specific businesses. For example, a research report template specific to a securities company can be imported into the plug-in, and the subsequent generated files can automatically match the format of the template, easily adapting to different business scenarios and solving the limitations of the prior art in scene adaptation.

[0062] From a commercial point of view, the application precisely meets the urgent needs of the financial industry for efficient document processing tools and has broad market prospects. Financial institutions (such as banks, securities companies, and fund companies) are willing to pay a premium for intelligent document tools to improve business efficiency, and the product can realize commercial monetization through authorized use, customized services, and other modes; in terms of social benefits, the application promotes the development of financial document processing towards standardization and standardization, reduces financial disputes caused by document errors (such as contract clause ambiguity and data errors leading to litigation), and maintains the stability of the financial market order. At the same time, by reducing the intensity of manual operation, the working pressure of financial practitioners is alleviated, and the overall work experience of the industry is improved. In addition, its technical solution provides an "artificial intelligence + professional scene" innovation paradigm for the financial technology field, promotes the deep application of large language models in vertical industries, accelerates the digital transformation of the financial industry, helps to build a more efficient, transparent, and trustworthy financial service system, and enhances the trust of society in financial institutions. In this embodiment, a large language model-based financial format file processing device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and contemplated.

[0063] The present embodiment provides a large language model-based financial format file processing device, which can be used as a plug-in tool for financial format files, such as Figure 2 As shown in the figure, it comprises: a user input receiving module 21 for receiving user input financial file upload instructions or financial file generation instructions; The user input response module 22, in response to the financial file uploading instruction, performs file format identification and integrity check, stores to a temporary directory and generates a file ready signal; or, in response to the financial file generation instruction, constructs a generative prompt word containing financial scene parameters, calls a first large language model to generate content, temporarily stores in a cache area in pure text format and generates a file ready signal; The financial text content acquisition module 23 is configured to, based on the file ready signal, extract original text content in the financial file through a parser adapted to the financial file format and perform redundancy information filtering on the extracted content, and generate key information to convert into a standard JSON format containing a "content" field storing text content and a "fields" field storing structured key-value pair data; The financial text content proofreading module 24 is configured to splice the prompt words generated by the plurality of financial field special prompt word modules with the "content" field in the JSON format, generate a second large language model input instruction, drive the second large language model to perform semantic level proofreading on the text, and output proofread text conforming to industry specifications; The HTML conversion module 25 is configured to convert the proofread text into structured HTML intermediate representation independent of the output format, and the conversion process includes: embedding machine-readable structure and style tags according to semantic and format characteristics, and performing standardized conversion processing on non-text elements, and verifying the legality of the tags and the integrity of the non-text elements; The Word file output module 26 is configured to parse the HTML intermediate representation, match a template in a preset financial format template library, and complete financial special placeholder filling, map the HTML format to a financial specification Word format, and perform structure, style and data special verification on the financial specification Word format, and output a Word file conforming to the business specifications of the financial institution.

[0064] The financial format file processing device based on the large language model provided by the embodiment of the application can execute the financial format file processing method based on the large language model provided by any embodiment of the application, and has the corresponding function modules and beneficial effects of the execution method. The further function description of each module and unit is the same as that of the corresponding embodiment, and will not be repeated here.

[0065] Figure 3 A structural schematic diagram of an electronic device provided by an embodiment of the application.

[0066] The following will be specifically described with reference to Figure 3 which shows a structural diagram suitable for use to implement an electronic device in embodiments of the present application. The electronic device can include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 302 or programs loaded from a memory 308 into a random access memory (RAM) 303. Various programs and data required for operation of the electronic device are also stored in the RAM 303. The processor 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0067] Generally, the following devices can be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a memory 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 can allow the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 The electronic device is shown with various devices, but it should be understood that all of the shown devices are not required, and more or fewer devices can alternatively be implemented.

[0068] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present application. For example, embodiments of the present application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication device 309, or installed from the memory 308, or installed from the ROM 302. When the computer program is executed by the processor 301, the above-described functions defined in the large language model-based financial format file processing method of embodiments of the present application are performed.

[0069] Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functions and scope of use of embodiments of the present application.

[0070] The embodiments of the present application further provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium through network, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk or a solid state disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that the computer, processor, microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, processor or hardware, the above-mentioned embodiments of the method for processing financial format files based on large language models are realized.

[0071] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be called or provided. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file, etc., accordingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.

[0072] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.< / h2>

Claims

1. A method for processing financial format documents based on a large language model, characterized in that, include: Receive user input of financial document upload instructions or financial document generation instructions; In response to the financial file upload instruction, after performing file format recognition and integrity verification, the file is stored in a temporary directory and a file ready signal is generated; or, in response to the financial file generation instruction, a generative prompt word containing financial scenario parameters is constructed, the first language model is called to generate content, which is temporarily stored in the cache in plain text format and a file ready signal is generated. Based on the file ready signal, the original text content in the financial file is extracted by a parser adapted to the financial file format and redundant information is filtered out from the extracted content. The key information is then converted into a standard JSON format containing a "content" field to store the text content and a "fields" field to store structured key-value pairs. The prompts generated by multiple financial field-specific prompt word modules are concatenated with the "content" field in the JSON format to generate input instructions for the second language model. This drives the second language model to perform semantic-level proofreading of the text and output proofread text that conforms to industry standards. The proofread text is converted into a structured, output format-independent HTML intermediate representation. The conversion process includes: embedding machine-readable structure and style tags according to semantic and format features, performing standardized conversion on non-text elements, and verifying the legality of tags and the integrity of non-text elements. The HTML intermediate representation is parsed, and templates in the preset financial format template library are matched and financial-specific placeholders are filled. The HTML format is mapped to the financial standard Word format. After performing special verification on the structure, style and data of the financial standard Word format, a Word file that conforms to the business specifications of financial institutions is output.

2. The method according to claim 1, characterized in that, The process, based on the file readiness signal, extracts the original text content from the financial file using a parser adapted to the financial file format. Redundancy filtering is then performed on the extracted content, generating key information that is converted into a standard JSON format containing a "content" field storing the text content and a "fields" field storing structured key-value pairs. This includes: Based on the file ready signal, the corresponding parsing engine is called according to the file type to perform field scanning on structured files, traverse the form fields in the file, extract the field names and corresponding values, and store them as key-value pairs; for unstructured files, an NLP word segmentation tool is used to segment the text, filter stop words, and extract noun phrases as key information. The NLP word segmentation tool is the Jieba financial word segmentation library. Perform redundant information filtering by comparing with a preset redundant keyword library, deleting paragraphs containing redundant keywords, and merging duplicate clauses. The extracted key information is converted into a standard JSON format containing a "content" field to store text content and a "fields" field to store structured key-value pairs.

3. The method according to claim 1 or 2, characterized in that, The aforementioned multiple financial sector-specific prompt word modules include at least: The grammar proofreading template uses prompts to check for grammatical errors in financial text and correct misuse of financial terminology. The financial terminology compliance module uses prompts to pre-set a mapping table of the correct usage of easily confused terms to drive the model to perform terminology replacement and standardization. The financial data standardization module uses prompts to explicitly stipulate that amounts must be output in both uppercase and lowercase formats, interest rates must clearly specify their type and interest calculation basis, and dates must be converted to a preset standard format. The clause logic completeness module uses prompts to include a list of essential clauses for different types of financial documents to drive the model to check for and prompt the addition of missing clauses.

4. The method according to claim 3, characterized in that, After driving the second-largest language model to perform semantic-level proofreading of text and output proofread text that conforms to industry standards, the following steps are also included: Record every modification made to the text by the second language model, mark the differences by a preset string comparison algorithm, and generate a revision log containing the modification location, reason for modification and basis for modification. The log is stored in an exportable text format and allows users to view historical modification records. The output text, after being proofread and conforming to industry standards, undergoes a second verification for financial compliance. This includes: calling an independent rule engine to verify the completeness of clauses, the accuracy of terminology, and the standardization of data based on relevant financial regulatory laws and regulations. After the verification is passed, the proofread content is updated to the "content" field of the JSON. Financial data content must be stored in a standardized format.

5. The method according to claim 1, characterized in that, The generation of the structured HTML intermediate representation includes: adding corresponding HTML tags to the structured content and paragraphs of the financial text according to their types, preserving style information and logical structure, and marking the insertion points of non-text elements; Non-text elements undergo standardized transformation, including converting images / charts into PNG images of a specified size and generating corresponding embedding tags, converting formulas into LaTeX format and embedding them using a dedicated tool or preserving their text form; validating the validity of HTML tags and the integrity of non-text element resources and correcting errors, generating an HTML file that conforms to W3C standards, packaging it with related resources and storing it in a temporary path before sending a ready signal.

6. The method according to claim 5, characterized in that, The process of parsing the HTML intermediate representation, matching it with templates from a preset financial format template library, filling in financial-specific placeholders, and mapping the HTML format to a financial standard Word format includes: When the ready signal is detected, the HTML file is downloaded to the plugin's local directory. The HTML file header is parsed to extract character encoding and document title. The file size is calculated and compared with the declared size before download. If they match, the reception is considered complete; otherwise, a retransmission request is sent. Load the HTML file into the DOM parser, build the DOM tree structure, traverse the DOM tree, extract the text content and formatting attributes, and establish a content-formatting mapping table; Read the target Word template from the preset financial format template library. The template contains placeholders for mandatory elements of the financial scenario. Parse the placeholders in the template and match them with the structured fields extracted from the HTML intermediate representation. Among them, financial-specific fields are subject to key validation, including: the amount field must match both uppercase and lowercase amounts, and the interest rate field must match the interest rate type and interest calculation basis. Convert the format defined by HTML tags to a Word format that conforms to financial industry standards. Perform the following mapping operations, including: mapping specific HTML tags to Word styles that conform to financial document format standards and predefined in the template; adjusting the column width of HTML tables according to financial reporting standards and automatically adding data validation formulas; and uniformly converting date formats to preset financial industry standard formats. If a financial mandatory placeholder is found that does not match the structured field, an interactive prompt is generated to request the user to supplement the corresponding information, and the matching is completed after receiving the user's input.

7. The method according to claim 1 or 6, characterized in that, After performing specific structure, style, and data verification on the financial regulatory Word document, a Word file conforming to the business specifications of financial institutions is output, including: Load the selected Word template, create a new document object, write the content and formatting to the document according to the content-formatting map, replace placeholders with actual content, and apply corresponding styles; arrange the content according to the paragraph order in HTML, maintain logical structure consistency, and perform special financial format verification. If a user-specified storage path is received or a specified save path is provided (or saved by default), a Word file conforming to the business specifications of financial institutions is output, and cached files in the temporary directory are cleared. The special verification includes: Structure verification: Checks whether the contract contains preset legal elements or whether the financial statements contain preset required items. If this verification fails, it performs anomaly information verification, repeating three times. After three rounds, manual intervention is required. Style verification: Confirms whether the body text font, signature area position, header and footer conform to the preset financial institution document format standards. If anomalies are found, the selected template is loaded and corrected. Data verification: Verifies whether the amount in words and figures is consistent, whether the interest rate statement is compliant, and whether the data in the table is consistent. If anomalies are found, they are automatically corrected.

8. A financial format file processing device based on a large language model, characterized in that, The device includes: The user input receiving module is used to receive user input of financial file upload instructions or financial file generation instructions; The user input response module, in response to the financial file upload instruction, performs file format recognition and integrity verification, stores the file in a temporary directory, and generates a file ready signal; or, in response to the financial file generation instruction, constructs generative prompt words containing financial scenario parameters, calls the first language model to generate content, temporarily stores it in plain text format in the cache area, and generates a file ready signal. The financial text content acquisition module is used to extract the original text content from financial files based on the file readiness signal, and to perform redundant information filtering on the extracted content. It generates key information and converts it into a standard JSON format containing a "content" field to store the text content and a "fields" field to store structured key-value pairs. The financial text content proofreading module concatenates prompt words generated by multiple financial field-specific prompt word modules with the "content" field in JSON format to generate input instructions for the second language model. This drives the second language model to perform semantic-level proofreading of the text and output proofread text that conforms to industry standards. The HTML conversion module is used to convert the proofread text into a structured, output format-independent HTML intermediate representation. The conversion process includes: embedding machine-readable structure and style tags according to semantic and format features, performing standardized conversion processing on non-text elements, and verifying the legality of tags and the integrity of non-text elements. The Word file output module is used to parse the HTML intermediate representation, match the templates in the preset financial format template library and complete the filling of financial-specific placeholders, map the HTML format to the financial standard Word format, and after performing special verification of the structure, style and data of the financial standard Word format, output a Word file that conforms to the business specifications of financial institutions.

9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the financial format file processing method based on any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the financial format file processing method based on a large language model as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Text content verification method and device, storage medium and equipment

    CN122154689A