Enterprise Financial Intelligent Analysis System and Method Based on Structured Prompt Keywords
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-23
- Publication Date
- 2026-08-14
AI Technical Summary
然而,现有方法仍存在显著不足:Jiang(2020)等早期研究虽提出基于数据挖掘的智能财务系统,但多停留在理论层面,未实现实际落地;王师节等(2022)和叶日发等(2023)提出的管理系统虽提升了效率,但应用场景受限,且未充分实现对多源数据的智能化整合与结构化输出
本发明通过结构化提示词驱动大语言模型,能够全面、标准地分析企业财务状况,显著提升分析的客观性与一致性,避免人工疏漏;系统自动识别盈利、偿债、运营、发展及现金流等维度的风险,并给出趋势解读与风险等级,为投资者提供直观的决策支持;同时,通过与年报原始数据的交叉验证,提高了输出结果的准确性;报告形式清晰友好,支持多格式展示与邮件提醒,增强了用户体验;此外,系统具备良好的扩展性与持续学习能力,可适应不同用户需求及政策导向,在金融机构、监管部门和企业内部审计中具有广泛的应用前景。
Smart Images

Figure CN122570633A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and financial analysis technology, specifically to a corporate financial intelligent analysis system and method based on structured prompt words, used for automated and standardized financial risk analysis of listed companies' annual reports. Background Technology
[0002] Traditional financial analysis mainly relies on manual reading of annual reports and summarizing and analyzing their contents. This method is limited in efficiency and the results are easily influenced by subjective judgment.
[0003] As a core financial data source, listed companies' annual reports exhibit multi-dimensional and diverse presentation formats (e.g., text descriptions, management discussions, tabular data, numerical indicators), large scale, and intricate relationships, posing significant challenges to automated analysis. Traditional risk control and analysis systems have low levels of intelligence, with large amounts of information stored in scattered formats such as text and tables, requiring manual identification. For large enterprise groups or batch analysis across multiple listed companies, the problems of objective distance, numerous grassroots personnel, and the dispersed and difficult-to-integrate multi-source heterogeneous data (from different systems, regions, and business operations) are particularly prominent, leading to difficulties in data quality control and limitations on horizontal comparison and comprehensive analysis.
[0004] Big data, cloud computing, and artificial intelligence, as key drivers of a new round of technological revolution and industrial transformation, are profoundly changing the paradigm of financial analysis. The deep integration of big data and financial management has become an inevitable trend, further promoting the construction of intelligent and forward-looking financial data systems. However, existing methods still have significant shortcomings: while early studies such as Jiang (2020) proposed intelligent financial systems based on data mining, these remained largely theoretical and failed to achieve practical implementation; the management systems proposed by Wang Shijie et al. (2022) and Ye Rifeng et al. (2023), although improving efficiency, had limited application scenarios and did not fully realize the intelligent integration and structured output of multi-source data.
[0005] In recent years, the development of Natural Language Processing (NLP) and Large Language Modeling (LLM) technologies has made automated financial analysis possible, but general-purpose LLM still faces some challenges in the financial field: First, the timeliness of knowledge is insufficient, mainly manifested in the difficulty of keeping up with the latest regulatory developments and changes in financial standards.
[0006] Second, there is a lack of depth in professional knowledge, such as a lack of professional knowledge in dealing with financial terminology, complex report relationships, and time-series reasoning.
[0007] III. The consistency and comprehensiveness of LLM outputs are difficult to guarantee (Chen Ling 2025).
[0008] This study clearly points out that general-purpose LLM suffers from "knowledge cut-off" and "specialized knowledge under-representation" problems in vertical fields such as finance, requiring domain-specific technologies. Financial annual reports are mostly in PDF format, containing a large number of structured tables and unstructured text, which plain text LLM cannot process directly, urgently requiring multimodal capabilities to support document parsing and table understanding. The research (Shukang Yin 2024) emphasizes the extension of MLLM in document understanding (such as mPLUG-DocOwl, TextMonkey), enabling OCR-free structured information extraction, suitable for complex documents such as annual reports.
[0009] By using instruction tuning and structured prompts to drive LLM, annual report text can be transformed into a systematic, multi-dimensional analytical output, encompassing five dimensions: profitability, risk control, asset management, sustainable development, and cash flow. This improves performance in terms of the comprehensiveness, consistency, and interpretability of the model's analysis. Research (Shengyu Zhang 2026) indicates that instruction tuning can bridge the next-word prediction goal of LLM with the user's need for structured instructions, making it particularly suitable for tasks requiring fixed output formats, such as financial statements. Market data shows that AI applications in the banking, financial services, and insurance (BFSI) sector are growing rapidly: the global AI in BFSI market is projected to grow from $24.31 billion in 2025 to $60.09 billion in 2031, representing a CAGR of 16.28%. McKinsey's 2025 Global AI Survey shows that AI use cases in corporate strategy and corporate finance have already brought significant revenue growth, while high-performing companies simultaneously pursue efficiency, innovation, and growth goals. PwC 2026 AI Predictions further indicate that the application of academia AI in financial functions, such as invoice processing, reconciliations, and anomaly detection, will become mainstream, helping practitioners focus on high-value decisions.
[0010] Therefore, there is an urgent need for a method that can automatically, accurately, and structurally analyze corporate financial conditions. This method should use structured prompts to drive a large language model, enabling multi-dimensional risk assessment and intelligent output of listed companies' annual reports. This would compensate for the systematic shortcomings of existing technologies and promote the development of financial analysis towards efficiency, objectivity, and scalability. Summary of the Invention
[0011] This invention provides a corporate financial intelligent analysis system and method based on structured prompts. The system automatically downloads and parses listed companies' annual reports through a data acquisition and preprocessing module, extracting text and tabular information. It then constructs structured prompt templates covering five major analysis modules: profit return, risk control, asset operation, sustainable development, and cash flow. Each module clearly defines roles, analysis tasks, specific indicator lists, output format requirements, and example guidance, and includes constraints based solely on the original annual report text. The system calls a large language model to combine the prompts with the annual report content to generate analysis tables for each module. These tables are then compared and calibrated against the original annual report data by a result verification module. Finally, a structured financial analysis report is output in HTML or PDF format, while also supporting iterative model optimization based on user feedback. The entire process achieves fully automated generation from annual report input to multi-dimensional risk assessment reports.
[0012] To achieve the objective of this invention, the technical solution adopted is as follows: An enterprise financial intelligent analysis system based on structured prompt words is disclosed. The system includes an input layer, a core processing layer, and an output and optimization layer. The input layer includes a data acquisition and preprocessing module. The core processing layer includes a structured prompt word construction module, a large language model invocation and generation module, and a result verification and structured processing module. The output and optimization layer includes a report generation and output module and a model iteration and optimization module.
[0013] The data acquisition and preprocessing module takes the PDF version of the annual report as input from an external data source, performs PDF parsing, plain text cleaning, and extraction of three main tables internally, and sends the cleaned plain text as output to the structured prompt word construction module. The structured prompt word construction module internally performs prompt word framework generation, output format specification, and constraint condition formation, and sends the prompt word template as output to the large language model calling and generation module.
[0014] The large language model calling and generation module performs model API calls, model parameter settings, and model output processing and verification operations. It also calculates the "industry average" and feeds it back to the data acquisition and preprocessing module. The Markdown table is then sent as output to the result verification and structured processing module. The result verification and structured processing module performs module indicator completion, numerical error comparison, and risk level determination operations. If the numerical error exceeds 5%, the Markdown table is fed back to the large language model calling and generation module for secondary adjustment. The verified data is then sent as output to the report generation and output module.
[0015] The report generation and output module performs HTML template rendering, PDF report export, risk email warnings and alerts, and provides the PDF report and HTML template to investors. It also sends manually reviewed error cases to the model iteration and optimization module. The model iteration and optimization module performs model iteration and optimization, error case fine-tuning dataset construction, model instruction fine-tuning, and capability dynamic optimization, and feeds back the error case fine-tuning data to the large language model.
[0016] A method for intelligent enterprise financial analysis based on structured prompts includes the following steps: S1. Data Acquisition and Preprocessing: The system connects to the annual report database of listed companies through Python scripts, downloads the full text of the PDF annual report using API or web crawler technology, and obtains key financial indicators of companies in the same industry from public data sources and calculates the industry average, storing them in structured JSON format for later use. The PDF plumber library was used to convert the PDF version of the annual report into plain text, preserving the table of contents structure. The text was cleaned, and regular expressions were used to extract key chapters from the annual report. If a chapter was missing, the full text was extracted. The cleaned text was then segmented into paragraphs and indexed. At the same time, the original values of the three main tables in the financial report were extracted to form auxiliary data files. S2. Structured Prompt Term Construction: The system has a built-in financial analysis knowledge base and automatically generates an initial prompt term framework based on five preset analysis modules. On this basic framework, the system automatically expands the output format according to the analysis objectives. The model adds two columns, "Industry Average" and "Comparative Analysis," to the table. The system defines a unified table output format for each module and automatically generates example guidance to help the model understand the expected output style. The system integrates the prompt terms, output format specifications, constraints, and examples of the five analysis modules into a complete prompt term template for subsequent model use. S3. Model Call and Generation: The system calls the large language model API to set model parameters, and configures backup models and timeout retry mechanisms. The system packages the constructed prompt words, the cleaned text of the annual report, and the industry average data in JSON format obtained from the outside as input and sends them to the model. The system receives the text returned by the model and checks whether it contains a complete table structure. If the model output does not conform to the expected format, the post-processing correction module is triggered. The system uses regular expressions to extract key values and attempts to rebuild the table. If it fails, the problem sample is stored in the log for manual review. S4. Results Structuring and Validation: Parse the Markdown table output by the model into a Pandas Data Frame, check whether the indicators of each module are complete, if there are missing indicators, try to extract the values directly from the original annual report text through keyword matching to complete them, compare the extracted data with the extracted financial statement values, if the error exceeds 5%, trigger a second analysis, adjust the prompt words and call the model again, if the model does not directly provide a certain indicator, the system can calculate it automatically based on net profit and net assets, and fill it into the table along with the industry average; The system automatically generates a “Comparative Analysis” column text description based on the model’s output data for this year and the preset industry average. At the same time, the system can call the natural language generation module to convert the comparison results into concise text descriptions. The system summarizes the analysis results of each module and generates a “Comprehensive Conclusion” section according to a preset template. The risk level is automatically determined by the system based on indicator thresholds and industry comparisons. S5. Output and Display: The system merges the tables and comprehensive conclusions of each module after verification and fills them into the preset HTML template. The report homepage includes basic company information, analysis timestamp, model version number and risk level summary chart. At the same time, a PDF version of the report is generated for investors to download. If a major risk is found during the analysis, the system will automatically send an email reminder to the subscriber. Even if there is no major warning, the system will still indicate the negative free cash flow risk that is common in the industry in the comprehensive conclusion. S6. Model Iteration and Optimization: The system regularly collects error cases after manual review to build a fine-tuning dataset, fine-tunes the large language model instructions, improves the understanding of financial terms and table generation capabilities, and automatically adjusts the priority and interpretation depth of indicators in the prompts based on user feedback and analysis results.
[0017] As a preferred approach, the specific steps in S1 of the enterprise financial intelligent analysis method are as follows: S1.1 Annual Report Download and Analysis: The system connects to the annual report database of listed companies through Python scripts, uses API or web crawling technology to download the full text of the PDF annual report, and obtains key financial indicators of at least seven companies in the same industry from public data sources, calculates the industry average, and stores them in structured JSON format for later use. S1.2 Text Extraction and Cleaning: The PDF version of the annual report was converted into plain text using the pdfplber library, preserving the table of contents structure. The text was cleaned by removing headers and footers, table garbled characters, special symbols, and standardizing line breaks. Regular expressions were used to extract eight key sections from the annual report: "Management Discussion and Analysis," "Financial Report," "Important Notes," "Company Basic Information," "Summary of Accounting Data and Financial Indicators," "Board of Directors' Report," "Important Matters," and "Changes in Shareholding and Shareholder Information." If any section was missing, the full text was extracted. This provides high-quality, parsable text data for subsequent analysis, avoiding noise interference with model understanding. S1.3 Key Data Extraction and Index Construction: The cleaned text is segmented into paragraphs and an index is built for easy quick location later; at the same time, the original values of the three main tables, namely the balance sheet, income statement and cash flow statement, are extracted from the financial report to form auxiliary data files for subsequent verification of the accuracy of the model output and to ensure that the values generated by the model are consistent with the annual report.
[0018] As a preferred approach, the specific steps in S2 of the enterprise financial intelligent analysis method are as follows: S2.1 Analysis Framework Design: The system has a built-in financial analysis knowledge base. Based on the five preset analysis modules—profit return, risk control, asset operation, sustainable development, and cash flow—it automatically generates an initial prompt framework. Each module includes role settings, analysis tasks, a list of specific indicators, output format requirements, and example guidance. The indicator selection is based on financial analysis theory to ensure comprehensive coverage of key dimensions of the company's health status. S2.2 Introducing an industry comparison dimension: Based on the basic framework, the system automatically expands the output format according to the analysis objectives, requiring the model to add two columns, "Industry Average" and "Comparative Analysis," to the table; S2.3 Format Specifications and Constraint Generation: The system defines a unified table output format for each module, including the following: core indicators, current year data, previous year data, trend changes (e.g., ↑ / ↓ / →), industry average, comparative analysis, interpretation, and risk assessment; the system also automatically generates example guidance to help the model understand the expected output style, with constraints appended to the end of the prompts: "Please answer only based on the provided annual report text and industry data, and do not introduce external information; if a certain data cannot be directly obtained from the text, please mark it 'not disclosed'." S2.4, Prompt word integration and optimization: The system integrates the prompt words, output format specifications, constraints and examples of the five analysis modules into a complete prompt word template for subsequent model calls; this template is one of the core assets generated. The general language model focuses on financial analysis tasks and outputs in a structured manner.
[0019] As a preferred approach, the specific steps in S3 of the enterprise financial intelligent analysis method are as follows: S3.1 Parameter Settings and Model Selection: The system calls the Large Language Model API to set model parameters: temperature is set to 0.2 to ensure output stability and determinism; maximum generation length is set to 4000 tokens; top_p is set to 0.9; at the same time, a backup model and a timeout retry mechanism are configured, i.e., retrying twice after a 30-second timeout to ensure high service availability; S3.2 Multi-source data input: The system packages the constructed prompt words, the cleaned text of the annual report, and the industry average data in JSON format obtained from external sources together as input and sends them to the model; the multi-source data fusion strategy enables the model to simultaneously refer to the detailed description of the annual report and the industry comparison benchmark, generating a more in-depth analysis; S3.3 Response Reception and Post-processing: Receive the text returned by the model and check whether it contains a complete table structure; if the model output does not conform to the expected format, such as missing table lines or incomplete indicators, the post-processing correction module is triggered: use regular expressions to extract key values and attempt to rebuild the table; if it fails, the problematic sample is stored in the log for manual review to ensure that the data entering the subsequent verification stage has a good structure.
[0020] As a preferred approach, the specific steps in S4 of the enterprise financial intelligent analysis method are as follows: S4.1 Parsing and Indicator Completion: Parse the Markdown table output by the model into a Pandas Data Frame and check whether the indicators of each module are complete; if there are missing indicators, such as an indicator marked as "not disclosed" but actually existing in the annual report, try to extract the value directly from the original annual report text through keyword matching to complete it, such as using the regular expression: r'Operating Revenue[:\s]\d+\.?\d*[hundred million yuan]?'; S4.2 Data Reasonableness Verification: Compare the extracted data with the financial statement values extracted in step S1.3. If the error exceeds 5%, a second analysis is triggered. After adjusting the prompt words, the model is called again, such as adding prompts like "Please confirm whether the unit of the value is RMB 10,000 / RMB 100 million". If a certain indicator, such as ROE, is not directly given by the model, the system can calculate it automatically based on net profit and net assets, and fill it into the table along with the industry average. S4.3 Industry Comparison Analysis Generation: Based on the current year's data output by the model and the preset industry average, the system automatically generates a text description in the "Comparison Analysis" column. If a certain indicator is significantly better than the industry average, it will be marked as "far higher than the industry average (+XX%)" and highlighted. At the same time, the system can call the natural language generation module to convert the comparison results into concise text descriptions such as "Net profit grew against the trend, far exceeding the industry average level", improving readability. S4.4 Comprehensive Conclusion Generation: The system summarizes the analysis results of each module and generates the "Comprehensive Conclusion" section according to the preset template, including the advantages of the governance structure, core risk warnings, overall evaluation and recommendations; the low / medium / high risk level is automatically determined by the system based on indicator thresholds and industry comparisons. For example, if the free cash flow is negative and significantly lower than the industry average, it is marked as high risk.
[0021] As a preferred approach, the specific steps in S5 of the enterprise financial intelligent analysis method are as follows: S5.1 HTML Report Generation: The system merges the verified tables and overall conclusions of each module and fills them into a preset HTML template. The template adopts the Bootstrap style and supports tab switching between modules. The tables can be sorted and filtered. The report homepage includes basic company information, analysis timestamp, model version number, and a risk level summary chart, such as a radar chart, to display the risk scores of each module. S5.2 PDF Report Export: Simultaneously generate a PDF version of the report for investors to download. The PDF version of the report retains the HTML layout style and embeds fonts to ensure cross-platform consistency. S5.3 Risk Warning and Email Notification: If significant risks such as continuous losses, insolvency, or negative free cash flow that is far below the industry average are discovered during the analysis process, the system will automatically send email reminders to subscribed users; if there are no significant warnings, the system will still highlight the industry-wide risk of negative free cash flow in the overall conclusion.
[0022] As a preferred approach, the specific steps in S6 of the enterprise financial intelligent analysis method are as follows: S6.1 Error Case Collection and Fine-tuning: The system regularly collects error cases after manual review, such as model misreading tables and omission of indicators, builds fine-tuning datasets, and fine-tunes the instructions of the large language model to improve the understanding of financial terms and table generation capabilities. For example, for the "asset impairment provision" that the model may have missed in this analysis, the relevant instructions will be strengthened in subsequent fine-tuning. S6.2 Dynamic Optimization of Prompt Terms: Based on user feedback and analysis results, the system automatically adjusts the priority and interpretation depth of indicators in the prompt terms. For example, if a user repeatedly focuses on "free cash flow," the system will list it as a core indicator of the cash flow module in subsequent prompt terms and add detailed interpretation requirements. This closed-loop optimization mechanism ensures that the system adapts to different user needs and policy orientations, and continuously improves the quality of analysis.
[0023] The beneficial effects of this invention are as follows: This invention utilizes a structured prompt-driven large language model to comprehensively and systematically analyze corporate financial conditions, significantly improving the objectivity and consistency of the analysis and avoiding human error. The system automatically identifies risks across dimensions such as profitability, debt repayment, operations, development, and cash flow, providing trend interpretations and risk levels to offer investors intuitive decision support. Furthermore, cross-validation with original annual report data enhances the accuracy of the output results. The report format is clear and user-friendly, supporting multiple formats and email notifications, thus improving the user experience. In addition, the system possesses excellent scalability and continuous learning capabilities, adapting to different user needs and policy orientations, and has broad application prospects in financial institutions, regulatory authorities, and corporate internal audits. Attached Figure Description
[0024] Figure 1 This is a diagram showing the module architecture of the enterprise financial intelligent analysis system based on structured prompts, as described in this invention. Detailed Implementation
[0025] The present invention will be further described and illustrated below with reference to specific embodiments.
[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0027] In the description of this invention, it should be understood that the terms "upper", "lower", "horizontal", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship of the technical solution, and are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.
[0028] like Figure 1 As shown, an enterprise financial intelligent analysis system based on structured prompt words is disclosed. The enterprise financial intelligent analysis system includes an input layer, a core processing layer, and an output and optimization layer. The input layer includes a data acquisition and preprocessing module, the core processing layer includes a structured prompt word construction module, a large language model invocation and generation module, and a result verification and structured processing module, and the output and optimization layer includes a report generation and output module and a model iteration and optimization module.
[0029] The data acquisition and preprocessing module is used to obtain PDF files of listed companies' annual reports from specified data sources and convert them into a processable plain text format using document parsing technology. At the same time, it extracts key financial table data from the reports. This module is also used to obtain key financial indicators of comparable companies in the same industry from public data sources and calculate industry averages. All data is unified into a structured format for storage and indexing, providing a clean, accurate, and multi-source data foundation for subsequent analysis.
[0030] The structured prompt word construction module has a built-in analysis framework based on a financial analysis professional knowledge base, covering multiple preset financial analysis dimensions. The module can automatically generate structured prompt word templates that include role settings, analysis tasks, specific indicator lists, output format specifications and constraints according to the analysis objectives and dimensions, so as to guide the large language model to perform targeted and standardized analysis.
[0031] The large language model calling and generation module connects to multiple large language model API interfaces and is responsible for packaging and sending the structured prompt word template, preprocessed annual report text data, and industry average data to the large language model. This module also includes parameter setting, backup model switching, timeout retry, and output format verification functions to ensure the stability of the model service and the initial availability of the output.
[0032] The results verification and structured processing module receives the analysis results returned by the large language model and parses them into structured data. This module verifies the accuracy of the model output data by cross-comparing it with the raw financial data directly extracted from the annual report, and automatically completes, corrects or triggers secondary analysis for any missing, erroneous or unexpected indicators. At the same time, this module automatically generates comparative analysis and risk level determination based on preset rules and industry comparison data.
[0033] The report generation and output module is used to integrate and render the analysis results of each module after verification and structured processing in a preset, user-friendly format (including but not limited to HTML and PDF) to generate a complete financial intelligence analysis report; this module also supports automatically triggering email alert notifications based on preset risk thresholds.
[0034] The model iteration and optimization module is used to collect error cases and user feedback generated during system operation, build a fine-tuning dataset, and periodically fine-tune the underlying large language model or dynamically optimize the prompt word strategy to form a closed loop of continuous improvement, thereby continuously improving the system's analysis quality and adaptability.
[0035] Furthermore, the data acquisition and preprocessing module inputs the PDF version of the annual report from an external data source, performs PDF parsing, plain text cleaning, and extraction of three main tables internally, and sends the cleaned plain text as output to the structured prompt word construction module; the structured prompt word construction module internally performs prompt word framework generation, output format specification, and constraint condition formation, and sends the prompt word template as output to the large language model calling and generation module.
[0036] Furthermore, the large language model invocation and generation module performs model API calls, model parameter settings, and model output processing and verification operations, and calculates the "industry average value" to feed back to the data acquisition and preprocessing module. The Markdown table is then sent as output to the result verification and structured processing module. The result verification and structured processing module performs module indicator completion, numerical error comparison, and risk level determination operations. If the numerical error exceeds 5%, the Markdown table is fed back to the large language model invocation and generation module for secondary adjustment, and the verified data is sent as output to the report generation and output module.
[0037] Furthermore, the report generation and output module performs HTML template rendering, PDF report export, risk email warnings and alerts, and provides the PDF report and HTML template to investors. The error cases reviewed by the human review are sent as output to the model iteration and optimization module. The model iteration and optimization module performs model iteration and optimization, error case fine-tuning dataset construction, model instruction fine-tuning, and capability dynamic optimization, and feeds back the error case fine-tuning data to the large language model.
[0038] like Figure 1 As shown, a method for intelligent enterprise financial analysis based on structured prompts includes the following steps: S1. Data Acquisition and Preprocessing: The system connects to the annual report database of listed companies through Python scripts, downloads the full text of the PDF annual report using API or web crawler technology, and obtains key financial indicators of companies in the same industry from public data sources and calculates the industry average, storing them in structured JSON format for later use. The PDF plumber library was used to convert the PDF version of the annual report into plain text, preserving the table of contents structure. The text was cleaned, and regular expressions were used to extract key chapters from the annual report. If a chapter was missing, the full text was extracted. The cleaned text was then segmented into paragraphs and indexed. At the same time, the original values of the three main tables in the financial report were extracted to form auxiliary data files. S2. Structured Prompt Term Construction: The system has a built-in financial analysis knowledge base and automatically generates an initial prompt term framework based on five preset analysis modules. On this basic framework, the system automatically expands the output format according to the analysis objectives. The model adds two columns, "Industry Average" and "Comparative Analysis," to the table. The system defines a unified table output format for each module and automatically generates example guidance to help the model understand the expected output style. The system integrates the prompt terms, output format specifications, constraints, and examples of the five analysis modules into a complete prompt term template for subsequent model use. S3. Model Call and Generation: The system calls the large language model API to set model parameters, and configures backup models and timeout retry mechanisms. The system packages the constructed prompt words, the cleaned text of the annual report, and the industry average data in JSON format obtained from the outside as input and sends them to the model. The system receives the text returned by the model and checks whether it contains a complete table structure. If the model output does not conform to the expected format, the post-processing correction module is triggered. The system uses regular expressions to extract key values and attempts to rebuild the table. If it fails, the problem sample is stored in the log for manual review. S4. Results Structuring and Validation: Parse the Markdown table output by the model into a Pandas Data Frame, check whether the indicators of each module are complete, if there are missing indicators, try to extract the values directly from the original annual report text through keyword matching to complete them, compare the extracted data with the extracted financial statement values, if the error exceeds 5%, trigger a second analysis, adjust the prompt words and call the model again, if the model does not directly provide a certain indicator, the system can calculate it automatically based on net profit and net assets, and fill it into the table along with the industry average; The system automatically generates a “Comparative Analysis” column text description based on the model’s output data for this year and the preset industry average. At the same time, the system can call the natural language generation module to convert the comparison results into concise text descriptions. The system summarizes the analysis results of each module and generates a “Comprehensive Conclusion” section according to a preset template. The risk level is automatically determined by the system based on indicator thresholds and industry comparisons. S5. Output and Display: The system merges the tables and comprehensive conclusions of each module after verification and fills them into the preset HTML template. The report homepage includes basic company information, analysis timestamp, model version number and risk level summary chart. At the same time, a PDF version of the report is generated for investors to download. If a major risk is found during the analysis, the system will automatically send an email reminder to the subscriber. Even if there is no major warning, the system will still indicate the negative free cash flow risk that is common in the industry in the comprehensive conclusion. S6. Model Iteration and Optimization: The system regularly collects error cases after manual review to build a fine-tuning dataset, fine-tunes the large language model instructions, improves the understanding of financial terms and table generation capabilities, and automatically adjusts the priority and interpretation depth of indicators in the prompts based on user feedback and analysis results.
[0039] Furthermore, the specific operation of S1 in the enterprise financial intelligent analysis method is as follows: S1.1 Annual Report Download and Analysis: The system connects to the annual report database of listed companies through Python scripts, uses API or web crawling technology to download the full text of the PDF annual report, and obtains key financial indicators of at least seven companies in the same industry from public data sources, calculates the industry average, and stores them in structured JSON format for later use. S1.2 Text Extraction and Cleaning: The PDF version of the annual report was converted into plain text using the pdfplber library, preserving the table of contents structure. The text was cleaned by removing headers and footers, table garbled characters, special symbols, and standardizing line breaks. Regular expressions were used to extract eight key sections from the annual report: "Management Discussion and Analysis," "Financial Report," "Important Notes," "Company Basic Information," "Summary of Accounting Data and Financial Indicators," "Board of Directors' Report," "Important Matters," and "Changes in Shareholding and Shareholder Information." If any section was missing, the full text was extracted. This provides high-quality, parsable text data for subsequent analysis, avoiding noise interference with model understanding. S1.3 Key Data Extraction and Index Construction: The cleaned text is segmented into paragraphs and an index is built for easy quick location later; at the same time, the original values of the three main tables, namely the balance sheet, income statement and cash flow statement, are extracted from the financial report to form auxiliary data files for subsequent verification of the accuracy of the model output and to ensure that the values generated by the model are consistent with the annual report.
[0040] Furthermore, the specific operation of S2 in the enterprise financial intelligent analysis method is as follows: S2.1 Analysis Framework Design: The system has a built-in financial analysis knowledge base. Based on the five preset analysis modules—profit return, risk control, asset operation, sustainable development, and cash flow—it automatically generates an initial prompt framework. Each module includes role settings, analysis tasks, a list of specific indicators, output format requirements, and example guidance. The indicator selection is based on financial analysis theory to ensure comprehensive coverage of key dimensions of the company's health status. S2.2 Introducing an industry comparison dimension: Based on the basic framework, the system automatically expands the output format according to the analysis objectives, requiring the model to add two columns, "Industry Average" and "Comparative Analysis," to the table; S2.3 Format Specifications and Constraint Generation: The system defines a unified table output format for each module, including the following: core indicators, current year data, previous year data, trend changes (e.g., ↑ / ↓ / →), industry average, comparative analysis, interpretation, and risk assessment; the system also automatically generates example guidance to help the model understand the expected output style, with constraints appended to the end of the prompts: "Please answer only based on the provided annual report text and industry data, and do not introduce external information; if a certain data cannot be directly obtained from the text, please mark it 'not disclosed'." S2.4, Prompt word integration and optimization: The system integrates the prompt words, output format specifications, constraints and examples of the five analysis modules into a complete prompt word template for subsequent model calls; this template is one of the core assets generated. The general language model focuses on financial analysis tasks and outputs in a structured manner.
[0041] Furthermore, the specific operation of S3 in the enterprise financial intelligent analysis method is as follows: S3.1 Parameter Settings and Model Selection: The system calls the Large Language Model API to set model parameters: temperature is set to 0.2 to ensure output stability and determinism; maximum generation length is set to 4000 tokens; top_p is set to 0.9; at the same time, a backup model and a timeout retry mechanism are configured, i.e., retrying twice after a 30-second timeout to ensure high service availability; S3.2 Multi-source data input: The system packages the constructed prompt words, the cleaned text of the annual report, and the industry average data in JSON format obtained from external sources together as input and sends them to the model; the multi-source data fusion strategy enables the model to simultaneously refer to the detailed description of the annual report and the industry comparison benchmark, generating a more in-depth analysis; S3.3 Response Reception and Post-processing: Receive the text returned by the model and check whether it contains a complete table structure; if the model output does not conform to the expected format, such as missing table lines or incomplete indicators, the post-processing correction module is triggered: use regular expressions to extract key values and attempt to rebuild the table; if it fails, the problematic sample is stored in the log for manual review to ensure that the data entering the subsequent verification stage has a good structure.
[0042] Furthermore, the specific operation of S4 in the enterprise financial intelligent analysis method is as follows: S4.1 Parsing and Indicator Completion: Parse the Markdown table output by the model into a Pandas Data Frame and check whether the indicators of each module are complete; if there are missing indicators, such as an indicator marked as "not disclosed" but actually existing in the annual report, try to extract the value directly from the original annual report text through keyword matching to complete it, such as using the regular expression: r'Operating Revenue[:\s]\d+\.?\d*[hundred million yuan]?'; S4.2 Data Reasonableness Verification: Compare the extracted data with the financial statement values extracted in step S1.3. If the error exceeds 5%, a second analysis is triggered. After adjusting the prompt words, the model is called again, such as adding prompts like "Please confirm whether the unit of the value is RMB 10,000 / RMB 100 million". If a certain indicator, such as ROE, is not directly given by the model, the system can calculate it automatically based on net profit and net assets, and fill it into the table along with the industry average. S4.3 Industry Comparison Analysis Generation: Based on the current year's data output by the model and the preset industry average, the system automatically generates a text description in the "Comparison Analysis" column. If a certain indicator is significantly better than the industry average, it will be marked as "far higher than the industry average (+XX%)" and highlighted. At the same time, the system can call the natural language generation module to convert the comparison results into concise text descriptions such as "Net profit grew against the trend, far exceeding the industry average level", improving readability. S4.4 Comprehensive Conclusion Generation: The system summarizes the analysis results of each module and generates the "Comprehensive Conclusion" section according to the preset template, including the advantages of the governance structure, core risk warnings, overall evaluation and recommendations; the low / medium / high risk level is automatically determined by the system based on indicator thresholds and industry comparisons. For example, if the free cash flow is negative and significantly lower than the industry average, it is marked as high risk.
[0043] Furthermore, the specific operations of S5 in the enterprise financial intelligent analysis method are as follows: S5.1 HTML Report Generation: The system merges the verified tables and overall conclusions of each module and fills them into a preset HTML template. The template adopts the Bootstrap style and supports tab switching between modules. The tables can be sorted and filtered. The report homepage includes basic company information, analysis timestamp, model version number, and a risk level summary chart, such as a radar chart, to display the risk scores of each module. S5.2 PDF Report Export: Simultaneously generate a PDF version of the report for investors to download. The PDF version of the report retains the HTML layout style and embeds fonts to ensure cross-platform consistency. S5.3 Risk Warning and Email Notification: If significant risks such as continuous losses, insolvency, or negative free cash flow that is far below the industry average are discovered during the analysis process, the system will automatically send email reminders to subscribed users; if there are no significant warnings, the system will still highlight the industry-wide risk of negative free cash flow in the overall conclusion.
[0044] Furthermore, the specific operation of S6 in the enterprise financial intelligent analysis method steps is as follows: S6.1 Error Case Collection and Fine-tuning: The system regularly collects error cases after manual review, such as model misreading tables and omission of indicators, builds fine-tuning datasets, and fine-tunes the instructions of the large language model to improve the understanding of financial terms and table generation capabilities. For example, for the "asset impairment provision" that the model may have missed in this analysis, the relevant instructions will be strengthened in subsequent fine-tuning. S6.2 Dynamic Optimization of Prompt Terms: Based on user feedback and analysis results, the system automatically adjusts the priority and interpretation depth of indicators in the prompt terms. For example, if a user repeatedly focuses on "free cash flow," the system will list it as a core indicator of the cash flow module in subsequent prompt terms and add detailed interpretation requirements. This closed-loop optimization mechanism ensures that the system adapts to different user needs and policy orientations, and continuously improves the quality of analysis. Example 1
[0045] This example uses the 2023 annual report of a listed A-share company as the analysis object. The system executes the following steps: S1. Data Acquisition and Preprocessing S1.1 Annual Report Download and Analysis: The system connects to listed company annual report databases (such as CNINFO and Wind) via Python scripts, and uses API or web scraping technology to download the full text of CATL's 2024 PDF annual report. Simultaneously, it obtains key financial indicators of the aforementioned seven peer companies from public data sources (such as Eastmoney Choice and iFinD), calculates industry averages, and stores them in structured JSON format for later use.
[0046] S1.2 Text Extraction and Cleaning: The PDF report was converted to plain text using the pdfplber library, preserving the table of contents structure. The text was cleaned by removing headers and footers, table errors, special characters, and standardizing line breaks. Regular expressions were used to extract key sections such as "Management Discussion and Analysis" and "Financial Report." If a section was missing, the entire text was extracted. The purpose of this step is to provide high-quality, parsable text data for subsequent analysis, avoiding noise interference with model understanding.
[0047] S1.3 Key Data Extraction and Index Construction: The cleaned text is segmented into paragraphs and an index is built for easy locating later. Simultaneously, raw values from the three main financial statements (balance sheet, income statement, and cash flow statement) are extracted to form auxiliary data files for subsequent verification of the model's output accuracy. For example, "Operating Revenue" is extracted from the income statement as 362.013 billion yuan, and "Net Profit Attributable to Shareholders of the Listed Company" as 50.745 billion yuan. This structured data will serve as a verification benchmark to ensure that the values generated by the model are consistent with the annual reports.
[0048] S2, Structured Prompt Keyword Construction S2.1 Analytical Framework Design: The system has a built-in financial analysis knowledge base and automatically generates an initial prompt framework based on five preset analysis modules (profitability, risk control, asset operation, sustainable development, and cash flow). Each module includes role settings, analysis tasks, a list of specific indicators, output format requirements, and example guidance. For example, the profitability module's indicators include operating revenue, net profit, gross profit margin, and weighted average return on equity (ROE); the risk control module includes debt-to-equity ratio, current ratio, quick ratio, and interest coverage ratio. The selection of indicators is based on financial analysis theory to ensure comprehensive coverage of key dimensions of the company's health.
[0049] S2.2 Introducing an Industry Comparison Dimension: Building upon the basic framework, the system automatically expands the output format based on the analysis objectives (in this case, industry comparison is required), requiring the model to add two columns to the table: "Industry Average" and "Comparative Analysis." This allows the final report to not only showcase the company's own trends but also assess its relative strengths and weaknesses within an industry context, significantly enhancing the analytical insight. See S2.3 for an example of the output format.
[0050] S2.3 Format Specifications and Constraint Generation: The system defines a unified table output format for each module, including the following: core indicators, current year data, previous year data, trend changes (↑ / ↓ / →), industry average, comparative analysis, interpretation, and risk assessment. Simultaneously, the system automatically generates example guidance (such as a row for operating revenue) to help the model understand the expected output style. A constraint is appended to the prompt: "Please answer only based on the provided annual report and industry data, and do not introduce external information. If a data point cannot be directly obtained from the text, please mark it 'Not disclosed'." This constraint effectively prevents the model from generating false information and ensures the verifiability of the analysis.
[0051] S2.4, Prompt Word Integration and Optimization: The system integrates the prompt words, output format specifications, constraints, and examples from the five modules into a complete prompt word template for subsequent model calls. This template is one of the core assets generated by this invention, enabling the general-purpose large language model to focus on financial analysis tasks and output in a structured manner. The final prompt word content used in this embodiment is highly consistent with the "Financial Related Indicators.docx" file, but an additional industry comparison column has been added.
[0052] S3, Model Calling and Generation S3.1 Parameter Settings and Model Selection: The system calls large language model APIs (such as OpenAI GPT-4, Wenxin Yiyan ERNIE-Bot, etc.) and sets the model parameters: temperature is set to 0.2 to ensure output stability and determinism; maximum generation length is set to 4000 tokens; top_p is set to 0.9. A backup model and a timeout retry mechanism are also configured (retrying twice after a 30-second timeout) to ensure high service availability.
[0053] S3.2 Multi-source data input: The system packages the constructed prompts, the cleaned text of CATL's 2024 annual report, and industry average data (JSON format) obtained from external sources together as input and sends them to the model. This multi-source data fusion strategy enables the model to simultaneously refer to the detailed descriptions in the annual report and industry benchmarks, thereby generating more in-depth analysis.
[0054] S3.3 Response Reception and Post-processing: Receive the text returned by the model and check if it contains a complete table structure. If the model output does not conform to the expected format (e.g., missing table lines, incomplete indicators), the post-processing correction module is triggered: key values are extracted using regular expressions, and an attempt is made to rebuild the table; if this fails, the problematic sample is logged for manual review. This step ensures that the data entering subsequent verification stages has a good structure.
[0055] S4. Results Structuring and Validation S4.1 Parsing and Indicator Completion: The Markdown table output by the model is parsed into a Pandas DataFrame, and the completeness of indicators in each module is checked. If any indicators are missing (e.g., an indicator is marked as "not disclosed" but actually exists in the annual report), the system attempts to extract the values directly from the original annual report text through keyword matching to complete the indicator (e.g., using the regular expression: r'Operating Revenue[:\s]\d+\.?\d*[hundred million yuan]?'). This mechanism improves the completeness of the final report.
[0056] S4.2 Data Reasonableness Verification: The extracted data is compared with the financial statement values extracted in S1.3. If the error exceeds 5%, a secondary analysis is triggered, and the prompts are adjusted before the model is called again (e.g., adding a prompt such as "Please confirm whether the unit of the value is RMB 10,000 / RMB 100 million"). For example, if the model outputs CATL's 2024 operating revenue as "approximately RMB 362 billion", the system compares it with the extracted "RMB 362.013 billion", and the error is far less than 5%, thus the verification passes. If a certain indicator (such as ROE) is not directly provided by the model, the system can calculate it automatically based on net profit and net assets, and fill it into the table along with the industry average.
[0057] S4.3 Industry Comparison Analysis Generation: Based on the current year's data output by the model and the preset industry average, the system automatically generates a text description for the "Comparison Analysis" column. For example, if a certain indicator is significantly better than the industry average, it will be marked as "significantly higher than the industry average (+XX%)" and highlighted. Simultaneously, the system can call the natural language generation module to convert the comparison results into concise text descriptions (such as "Net profit grew against the trend, far exceeding the industry average"), improving readability.
[0058] S4.4 Generation of Comprehensive Conclusions: The system summarizes the analysis results of each module and generates a "Comprehensive Conclusions" section according to a preset template. This section includes the advantages of the governance structure, core risk warnings (sorted by risk level), overall evaluation, and recommendations. The risk level (low / medium / high) is automatically determined by the system based on indicator thresholds and industry comparisons. For example, a negative free cash flow that is significantly lower than the industry average is marked as high risk. The comprehensive conclusions table generated in this embodiment is consistent with the "Comprehensive Conclusions and Industry Comparison Analysis" table in "CATL Industry Comparison.html".
[0059] S5, Output and Display S5.1 HTML Report Generation: The system merges the verified tables from each module and the overall conclusions, and populates them into a preset HTML template. The template uses a Bootstrap style, supports tab switching between modules, and the tables can be sorted and filtered. The report's homepage includes basic company information, analysis timestamps, model version numbers, and a risk level summary chart (such as a radar chart displaying the risk scores for each module). The HTML report generated in this example is "CATL Industry Comparison.html," which clearly shows the comparison between CATL and the industry average.
[0060] S5.2 PDF Report Export: A PDF version of the report is generated simultaneously for investors to download. The PDF retains the HTML layout style and embeds fonts to ensure cross-platform consistency.
[0061] S5.3 Risk Warning and Email Notification: If significant risks are identified during the analysis (such as continuous losses, insolvency, negative free cash flow significantly lower than the industry average), the system will automatically send email alerts to subscribed users. In this case, CATL's free cash flow was positive and far better than the industry average, and there were no major warnings. However, the system still highlighted the industry-wide risk of negative free cash flow in the overall conclusion.
[0062] S6. Model Iteration and Optimization S6.1 Error Case Collection and Fine-tuning: The system regularly collects error cases reviewed by humans (such as model misinterpretation of tables, omission of indicators, etc.), constructs a fine-tuning dataset, and fine-tunes the instructions of the large language model to improve its understanding of financial terminology and table generation capabilities. For example, regarding the "asset impairment provision" that the model may have missed in this analysis, the relevant instructions will be strengthened in subsequent fine-tuning.
[0063] S6.2 Dynamic Optimization of Prompt Keywords: Based on user feedback and analysis results, the system automatically adjusts the priority and depth of interpretation of indicators in the prompt keywords. For example, if a user repeatedly focuses on "free cash flow," the system will list it as a core indicator of the cash flow module in subsequent prompts and add detailed interpretation requirements. This closed-loop optimization mechanism ensures that the system can adapt to different user needs and policy orientations, continuously improving the quality of analysis.
[0064] In this invention, a structured prompt-driven large language model is used to comprehensively and systematically analyze a company's financial situation, significantly improving the objectivity and consistency of the analysis and avoiding human error. The system automatically identifies risks in dimensions such as profitability, debt repayment, operations, development, and cash flow, and provides trend interpretations and risk levels, offering investors intuitive decision support. Furthermore, cross-validation with original annual report data improves the accuracy of the output results. The report format is clear and user-friendly, supporting multiple formats and email notifications, enhancing the user experience. In addition, the system possesses good scalability and continuous learning capabilities, adapting to different user needs and policy orientations, and has broad application prospects in financial institutions, regulatory authorities, and corporate internal audits.
[0065] The technical solutions disclosed in the embodiments of the present invention have been described in detail above. Specific embodiments have been used to illustrate the principles and implementation methods of the embodiments of the present invention. The description of the above embodiments is only for helping to understand the principles of the embodiments of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the embodiments of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A corporate financial intelligent analysis system based on structured prompt words, characterized in that, The enterprise financial intelligent analysis system includes an input layer, a core processing layer, and an output and optimization layer. The input layer includes a data acquisition and preprocessing module, the core processing layer includes a structured prompt word construction module, a large language model calling and generation module, and a result verification and structured processing module, and the output and optimization layer includes a report generation and output module and a model iteration and optimization module. The data acquisition and preprocessing module receives the PDF version of the annual report from an external data source, performs PDF parsing, plain text cleaning, and extraction of three main tables internally, and outputs the cleaned plain text to the structured prompt word construction module. The structured prompt word construction module generates prompt word frameworks, standardizes output formats, and forms constraints internally, and outputs prompt word templates to the large language model calling and generation module. The large language model calling and generation module internally performs model API calls, model parameter settings, and model output processing and verification operations, and calculates the "industry average value" to feed back to the data acquisition and preprocessing module, and sends the Markdown table as output to the result verification and structured processing module. The results verification and structured processing module performs tasks such as completing module indicators, comparing numerical errors, and determining risk levels. If the numerical error exceeds 5%, the Markdown table is fed back to the large language model calling and generation module for secondary adjustment, and the verified data is sent as output to the report generation and output module. The report generation and output module internally performs HTML template rendering, PDF report export, risk email warning and prompt operations, and provides PDF reports and HTML templates to investors. It also sends manually reviewed error cases as output to the model iteration and optimization module. The model iteration and optimization module performs model iteration and optimization, builds error case fine-tuning datasets, fine-tunes model instructions, and dynamically optimizes capabilities, and feeds back the error case fine-tuning data to the large language model.
2. A method for intelligent enterprise financial analysis based on structured prompt words, characterized in that, The specific steps include: S1. Data Acquisition and Preprocessing: The system connects to the annual report database of listed companies through Python scripts, downloads the full text of the PDF annual report using API or web crawler technology, and obtains key financial indicators of companies in the same industry from public data sources and calculates the industry average, storing them in structured JSON format for later use. The PDF plumber library was used to convert the PDF version of the annual report into plain text, preserving the table of contents structure. The text was cleaned, and regular expressions were used to extract key chapters from the annual report. If a chapter was missing, the full text was extracted. The cleaned text was then segmented into paragraphs and indexed. At the same time, the original values of the three main tables in the financial report were extracted to form auxiliary data files. S2. Structured Prompt Term Construction: The system has a built-in financial analysis knowledge base and automatically generates an initial prompt term framework based on five preset analysis modules. On this basic framework, the system automatically expands the output format according to the analysis objectives. The model adds two columns, "Industry Average" and "Comparative Analysis," to the table. The system defines a unified table output format for each module and automatically generates example guidance to help the model understand the expected output style. The system integrates the prompt terms, output format specifications, constraints, and examples of the five analysis modules into a complete prompt term template for subsequent model use. S3. Model Call and Generation: The system calls the large language model API to set model parameters, and configures backup models and timeout retry mechanisms. The system packages the constructed prompt words, the cleaned text of the annual report, and the industry average data in JSON format obtained from the outside as input and sends them to the model. The system receives the text returned by the model and checks whether it contains a complete table structure. If the model output does not conform to the expected format, the post-processing correction module is triggered. The system uses regular expressions to extract key values and attempts to rebuild the table. If it fails, the problem sample is stored in the log for manual review. S4. Results Structuring and Validation: Parse the Markdown table output by the model into a Pandas Data Frame, check whether the indicators of each module are complete, if there are missing indicators, try to extract the values directly from the original annual report text through keyword matching to complete them, compare the extracted data with the extracted financial statement values, if the error exceeds 5%, trigger a second analysis, adjust the prompt words and call the model again, if the model does not directly provide a certain indicator, the system can calculate it automatically based on net profit and net assets, and fill it into the table along with the industry average; The system outputs this year's data and preset industry averages based on the model, and automatically generates a text description in the "Comparative Analysis" column. At the same time, the system can call the natural language generation module to convert the comparison results into concise text descriptions. The system summarizes the analysis results of each module and generates the "Comprehensive Conclusion" section according to the preset template. The risk level is automatically determined by the system based on the indicator thresholds and industry comparisons. S5. Output and Display: The system merges the verified tables from each module and the overall conclusions and fills them into a preset HTML template. The report homepage includes basic company information, analysis timestamps, model version numbers, and a risk level summary chart. At the same time, a PDF version of the report is generated for investors to download. If significant risks are found during the analysis, the system will automatically send email reminders to subscribers. Even without major warnings, the system will still highlight the industry-wide risk of negative free cash flow in the overall conclusions. S6. Model Iteration and Optimization: The system regularly collects error cases after manual review to build a fine-tuning dataset, fine-tunes the large language model instructions, improves the understanding of financial terms and table generation capabilities, and automatically adjusts the priority and interpretation depth of indicators in the prompts based on user feedback and analysis results.
3. The enterprise financial intelligent analysis method based on structured prompt words according to claim 2, characterized in that, The specific operation of step S1 in the enterprise financial intelligent analysis method is as follows: S1.1 Annual Report Download and Analysis: The system connects to the annual report database of listed companies through Python scripts, uses API or web crawling technology to download the full text of the PDF annual report, and obtains key financial indicators of at least seven companies in the same industry from public data sources, calculates the industry average, and stores them in structured JSON format for later use. S1.2 Text Extraction and Cleaning: The PDF version of the annual report was converted into plain text using the pdfplber library, preserving the table of contents structure. The text was cleaned by removing headers and footers, table garbled characters, special symbols, and standardizing line breaks. Regular expressions were used to extract eight key sections from the annual report: "Management Discussion and Analysis," "Financial Report," "Important Notes," "Company Basic Information," "Summary of Accounting Data and Financial Indicators," "Board of Directors' Report," "Important Matters," and "Changes in Shareholding and Shareholder Information." If any section was missing, the full text was extracted. This provides high-quality, parsable text data for subsequent analysis, avoiding noise interference with model understanding. S1.3 Key Data Extraction and Index Construction: The cleaned text is segmented into paragraphs and an index is built for easy quick location later; at the same time, the original values of the three main tables, namely the balance sheet, income statement and cash flow statement, are extracted from the financial report to form auxiliary data files for subsequent verification of the accuracy of the model output and to ensure that the values generated by the model are consistent with the annual report.
4. The enterprise financial intelligent analysis method based on structured prompt words according to claim 2, characterized in that, The specific operation of step S2 in the aforementioned enterprise financial intelligent analysis method is as follows: S2.1 Analysis Framework Design: The system has a built-in financial analysis knowledge base. Based on the five preset analysis modules—profit return, risk control, asset operation, sustainable development, and cash flow—it automatically generates an initial prompt framework. Each module includes role settings, analysis tasks, a list of specific indicators, output format requirements, and example guidance. The indicator selection is based on financial analysis theory to ensure comprehensive coverage of key dimensions of the company's health status. S2.2 Introducing an industry comparison dimension: Based on the basic framework, the system automatically expands the output format according to the analysis objectives, requiring the model to add two columns, "Industry Average" and "Comparative Analysis," to the table; S2.3 Format Specifications and Constraint Generation: The system defines a unified table output format for each module, including the following: core indicators, current year data, previous year data, trend changes (↑ / ↓ / →), industry average, comparative analysis, interpretation, and risk assessment; at the same time, the system automatically generates example guidance to help the model understand the expected output style, with the following constraint appended to the end of the prompt: "Please answer only based on the provided annual report text and industry data, and do not introduce external information; if a certain data cannot be directly obtained from the text, please mark it 'not disclosed'"; S2.4, Prompt word integration and optimization: The system integrates the prompt words, output format specifications, constraints and examples of the five analysis modules into a complete prompt word template for subsequent model calls; this template is one of the core assets generated. The general language model focuses on financial analysis tasks and outputs in a structured manner.
5. The enterprise financial intelligent analysis method based on structured prompt words according to claim 2, characterized in that, The specific operation of step S3 in the aforementioned enterprise financial intelligent analysis method is as follows: S3.1 Parameter Settings and Model Selection: The system calls the Large Language Model API to set model parameters: temperature is set to 0.2 to ensure output stability and determinism; maximum generation length is set to 4000 tokens; top_p is set to 0.9; at the same time, a backup model and a timeout retry mechanism are configured, i.e., retrying twice after a 30-second timeout to ensure high service availability; S3.2 Multi-source data input: The system packages the constructed prompt words, the cleaned text of the annual report, and the industry average data in JSON format obtained from external sources together as input and sends them to the model; the multi-source data fusion strategy enables the model to simultaneously refer to the detailed description of the annual report and the industry comparison benchmark, generating a more in-depth analysis; S3.3 Response Reception and Post-processing: Receive the text returned by the model and check whether it contains a complete table structure; if the model output does not conform to the expected format, such as missing table lines or incomplete indicators, the post-processing correction module is triggered: use regular expressions to extract key values and attempt to rebuild the table; if it fails, the problematic sample is stored in the log for manual review to ensure that the data entering the subsequent verification stage has a good structure.
6. The enterprise financial intelligent analysis method based on structured prompt words according to claim 2, characterized in that, The specific operation of step S4 in the aforementioned enterprise financial intelligent analysis method is as follows: S4.1 Parsing and Indicator Completion: Parse the Markdown table output by the model into a Pandas Data Frame and check whether the indicators of each module are complete; if there are missing indicators, such as an indicator marked as "not disclosed" but actually existing in the annual report, try to extract the value directly from the original annual report text through keyword matching to complete it, such as using the regular expression: r'Operating Revenue[:\s]\d+\.?\d*[hundred million yuan]?'; S4.2 Data Reasonableness Verification: Compare the extracted data with the financial statement values extracted in step S1.
3. If the error exceeds 5%, a secondary analysis is triggered. After adjusting the prompt words, the model is called again, such as adding prompts like "Please confirm whether the unit of the value is RMB 10,000 / RMB 100 million". If a certain indicator, such as ROE, is not directly given by the model, the system can calculate it automatically based on net profit and net assets, and fill it into the table along with the industry average. S4.3 Industry Comparison Analysis Generation: Based on the current year's data output by the model and the preset industry average, the system automatically generates a text description in the "Comparison Analysis" column. If a certain indicator is significantly better than the industry average, it will be marked as "far higher than the industry average (+XX%)" and highlighted. At the same time, the system can call the natural language generation module to convert the comparison results into concise text descriptions such as "Net profit grew against the trend, far exceeding the industry average level", improving readability. S4.4 Comprehensive Conclusion Generation: The system summarizes the analysis results of each module and generates the "Comprehensive Conclusion" section according to the preset template, including the advantages of the governance structure, core risk warnings, overall evaluation and recommendations; the low / medium / high risk level is automatically determined by the system based on indicator thresholds and industry comparisons. For example, if the free cash flow is negative and significantly lower than the industry average, it is marked as high risk.
7. The enterprise financial intelligent analysis method based on structured prompt words according to claim 2, characterized in that, The specific operation of step S5 in the aforementioned enterprise financial intelligent analysis method is as follows: S5.1 HTML Report Generation: The system merges the verified tables and overall conclusions of each module and fills them into a preset HTML template. The template adopts the Bootstrap style and supports tab switching between modules. The tables can be sorted and filtered. The report homepage includes basic company information, analysis timestamp, model version number, and a risk level summary chart, such as a radar chart, to display the risk scores of each module. S5.2 PDF Report Export: Simultaneously generate a PDF version of the report for investors to download. The PDF version of the report retains the HTML layout style and embeds fonts to ensure cross-platform consistency. S5.3 Risk Warning and Email Notification: If significant risks such as continuous losses, insolvency, or negative free cash flow that is far below the industry average are discovered during the analysis process, the system will automatically send email reminders to subscribed users; if there are no significant warnings, the system will still highlight the industry-wide risk of negative free cash flow in the overall conclusion.
8. The enterprise financial intelligent analysis method based on structured prompt words according to claim 2, characterized in that, The specific operation of step S6 in the enterprise financial intelligent analysis method is as follows: S6.1 Error Case Collection and Fine-tuning: The system regularly collects error cases after manual review, such as model misreading tables and omission of indicators, builds a fine-tuning dataset, and fine-tunes the instructions of the large language model to improve the understanding of financial terms and table generation capabilities. For example, for the "asset impairment provision" that the model may have missed in this analysis, the relevant instructions will be strengthened in subsequent fine-tuning. S6.2 Dynamic Optimization of Prompt Terms: Based on user feedback and analysis results, the system automatically adjusts the priority and interpretation depth of indicators in prompt terms. For example, if a user repeatedly focuses on "free cash flow", the system will list it as a core indicator of the cash flow module in subsequent prompt terms and add detailed interpretation requirements. This closed-loop optimization mechanism ensures that the system adapts to different user needs and policy orientations, and continuously improves the quality of analysis.