Structured financial data query method, device, equipment and medium
By constructing a training data set of structured financial data in a large language model and fine-tuning the model, the problem of large language models when processing structured financial data is solved, and efficient processing and accurate query of structured data in the financial field is achieved.
Patent Information
- Application Number
- CN202411977237.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
AI Technical Summary
When processing structured financial data, large language models are difficult to parse their complex logical associations and format arrangements, and cannot effectively extract information and operate. The existing technology relies on external API tools, which increases the requirements for model processing capabilities.
By extracting keyword entities in the financial database based on the table structure, building an entity pool, and obtaining natural language questions in combination with real business scenarios, generating extended training samples, converting them into API call instructions, performing actual calls and verifications, and building training data, which is used to fine-tune the instructions of the base model and generating API call instructions that can read structured financial data.
The ability of large language models to process structured data in the financial field has been improved. The generated tool call data can give users more accurate answers, have interpretability advantages, and meet the high requirements for data quality in the financial field.
Smart Images

Figure CN119782339A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of data processing technology, and in particular to a structured financial data query method, device, equipment and medium. Background Art
[0002] Large Language Models (LLMs) have made significant achievements in the field of natural language. They have the ability to deeply understand and generate natural language. Current LLMs vary in model size, data size, training objectives, and generation strategies, but they all have a common feature, that is, they can generate natural language text across different domains and tasks, and have shown amazing results in many natural language processing application scenarios. However, their potential in data generation in the financial field has not been fully developed.
[0003] In the financial field, structured financial data is widely distributed and stored in various databases and spreadsheets, covering key information such as financial transaction flows, asset and liability details, market indicator values, etc. These data are highly organized and standardized, and are presented in a rigorous format specification and logical structure. With financial expertise and practical experience, humans can effectively interpret and analyze them, and accurately apply them to complex financial business processes such as risk assessment, investment strategy formulation, and financial statement preparation, thereby efficiently supporting the formulation and execution of various financial decisions.
[0004] However, when we look at the application of large language models (LLMs) in structured financial data processing, we will find that they face many difficult problems. Due to the inherent limitations of model architecture design and technical principles, especially the constraints of context length, large language models have difficulty directly parsing the complex logical associations and sophisticated formatting of structured financial data, and cannot extract valuable information and perform effective operations from it as smoothly as processing natural language text. To overcome this obstacle, it is currently common to use external API tools to achieve indirect processing of structured financial data, which undoubtedly puts more stringent requirements on the structured data processing capabilities of large language models, not only involving the interactive and coordinated optimization of models and external tools, but also including the preprocessing of data, accurate transmission of instructions, and accurate parsing of results. Capability improvement needs at multiple levels.
[0005] Fine-tuning training is an effective way to improve the model's ability to use external API tools, but its successful implementation is highly dependent on a large amount of high-quality, diverse and targeted training corpus. At this stage, model-generated data has become one of the main means of obtaining training corpus, but this process is also full of challenges: 1. Large models have powerful data generation capabilities and can quickly produce large amounts of data, but the quality and reliability of these generated data lack effective guarantees. How to ensure the high quality and stability of the generated data is one of the key issues.
[0006] 2. The data generation of traditional large models mainly focuses on the field of natural language. However, natural language is not very effective when dealing with the complex logic and precise structural expression of structured data, and it is difficult to meet the needs of structured data processing. This requires the exploration of new data generation models and methods.
[0007] 3. When large models use self-generated data to fine-tune instructions, although significant improvements may be achieved in the execution efficiency and accuracy of specific tasks, this optimization is often accompanied by the risk of potential attenuation of the model's general capabilities. Summary of the invention
[0008] The present invention proposes a structured financial data query method, device, equipment and medium, the purpose of which is to generate a batch of data that can be used by the big model calling tool through the existing big language model. The big model after data training can read the structured financial data in the financial field through API calling instructions, thereby solving a series of problems in the financial field.
[0009] To achieve the above purpose, the technical solution adopted by the present invention is as follows: In one aspect, the present invention provides a structured financial data query method, comprising: Extracting various keyword entities of structured financial data in a financial database based on the table structure, and building an entity pool containing various keyword entities, wherein the structured financial data is stored in the financial database in the form of a data table; For each structured financial data and combined with real business scenarios, a certain amount of natural language questions are obtained, and the corresponding table names and related keyword entities are annotated to form seed samples in the form of "natural language question-table name-keyword entity"; Perform a combination traversal of various keyword entities in the data table and entity pool. Each combination result corresponds to an instance. A seed sample is randomly sampled from each instance to prompt the large language model to generate a natural language question corresponding to each instance, and obtain an extended training sample in the form of "natural language question-table name-keyword entity"; The natural language questions in the extended training samples are converted into API call instructions, and the converted API call instructions are actually called. The validity of the API call instructions is verified according to the return results of the API call. Natural language questions that cannot obtain actual data are cleaned, and natural language questions that can correctly obtain data and their corresponding API call instructions are retained, so as to construct training data including natural language questions, API call instructions and corresponding return results. The constructed training data is used as fine-tuning data and input into the base model to perform instruction fine-tuning on the base model; The natural language question to be queried is input into the fine-tuned model, and the model automatically generates an API call instruction based on the natural language question to read structured financial data matching the natural language question in the financial database.
[0010] In another aspect, the present invention provides a structured financial data query device, comprising: The first module is used to extract various keyword entities from structured financial data in a financial database based on a table structure, and to build an entity pool containing various keyword entities. The structured financial data is stored in the financial database in the form of a data table; The second module is used to obtain a certain amount of natural language questions for each structured financial data and in combination with real business scenarios, and annotate the corresponding table names and related keyword entities to form a seed sample in the form of "natural language question-table name-keyword entity"; The third module is used to perform a combination traversal of various keyword entities in the data table and entity pool. Each combination result corresponds to an instance. A seed sample is randomly sampled from each instance to prompt the large language model to generate a natural language question corresponding to each instance, and obtain an extended training sample in the form of "natural language question-table name-keyword entity"; The fourth module is used to convert the natural language questions in the extended training samples into API call instructions, and actually call the converted API call instructions, verify the validity of the API call instructions according to the return results of the API call, clean up the natural language questions that cannot obtain actual data, retain the natural language questions that can correctly obtain data and their corresponding API call instructions, and construct training data including natural language questions, API call instructions and corresponding return results; The fifth module is used to input the constructed training data as fine-tuning data into the base model to perform instruction fine-tuning on the base model; The sixth module is used to input the natural language question to be queried into the fine-tuned model, and the model automatically generates API call instructions based on the natural language question to read structured financial data matching the natural language question in the financial database.
[0011] On the other hand, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above structured financial data query method when executing the computer program.
[0012] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned structured financial data query method when executed by a processor.
[0013] On the other hand, the present invention provides a computer program product, which is stored on a computer-readable storage medium and includes computer instructions, which, when executed by a processor, enable a computer device to implement the steps of the above-mentioned structured financial data query method.
[0014] Compared with the prior art, the technical effects of the present invention are: There is a large amount of structured data in the financial field. Structured financial data is reflected through tables, fields and relationships in the database, such as shareholder structure analysis charts, financial statements, time series data tables, etc. It has a clear data structure and can be easily retrieved, analyzed and calculated. Although the large language model has strong capabilities, it needs to call tools to process structured data. At present, there is no data set in this field that prompts the large model to call the tool to reply to the user. The present invention combines the powerful semantic understanding ability of the large model, and generates a training data set that can be directly used to fine-tune the instructions of the large model through a series of processing for the structured data in the financial field. After the large model is fine-tuned through this training data set, it will have the ability to generate tool call data. The generated tool call data can give users more accurate answers when combined with the tool call ability of the large model. Since the financial field requires that the quality of data must be accurate, the calling API instruction designed by the present invention can reflect each query path of the large model calling tool, and can accurately realize the reply traceability, which has great advantages in interpretability. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0016] Figure 1 It is a flowchart of a structured financial data query method provided by an embodiment. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] Reference Figure 1 , an embodiment provides a structured financial data query method, including: Extracting various keyword entities of structured financial data in a financial database based on the table structure, and building an entity pool containing various keyword entities, wherein the structured financial data is stored in the financial database in the form of a data table; For each structured financial data and in combination with real business scenarios, a certain amount of natural language questions are obtained, and the table names and related keyword entities of the corresponding structured financial data are annotated to form a seed sample in the form of "natural language question-table name-keyword entity"; Perform a combination traversal of various keyword entities in the data table and entity pool. Each combination result corresponds to an instance. A seed sample is randomly sampled from each instance to prompt the large language model to generate a natural language question corresponding to each instance, and obtain an extended training sample in the form of "natural language question-table name-keyword entity"; The natural language questions in the extended training samples are converted into API call instructions, and the converted API call instructions are actually called. The validity of the API call instructions is verified according to the return results of the API call. Natural language questions that cannot obtain actual data are cleaned, and natural language questions that can correctly obtain data and their corresponding API call instructions are retained, so as to construct training data including natural language questions, API call instructions and corresponding return results. The constructed training data is used as fine-tuning data and input into the base model to perform instruction fine-tuning on the base model; The natural language question to be queried is input into the fine-tuned model, and the model automatically generates an API call instruction based on the natural language question to read structured financial data matching the natural language question in the financial database.
[0019] In the above embodiment, various keyword entities of structured financial data include but are not limited to table name, company name, time, and financial indicators. Based on the table structure, keyword entities such as table name, company name, time, and financial indicators of structured financial data in the financial database are extracted to build an entity pool containing keyword entities such as table name, company name, time, and financial indicators.
[0020] For each structured financial data and combined with real business scenarios, a small number of natural language questions and their related keyword entities are manually annotated to form seed samples in the form of "natural language question-table name-company name-financial indicator name-time". Since the number of seed samples is limited, the training data needs to be expanded based on the seed samples in the future. Based on the seed data, the present invention uses a large model to generate an extended data set, including a variety of natural language questions and their corresponding instructions. The extended training data is verified by actual API calls, and questions and instructions that cannot correctly obtain data are cleaned to retain high-quality samples.
[0021] Specifically, a combination traversal is performed on the candidate companies, time, and financial indicators in the data table and entity pool, and the combination traversal adopts a random sampling method to ensure the diversity and coverage of the data set expansion. Furthermore, during the combination traversal process, priority screening or weight setting can be performed on specific fields or combination results according to business needs. Each combination result corresponds to an instance, and each instance randomly samples any example seed sample to prompt the large language model to generate a natural language question corresponding to each instance, and obtain an extended training sample in the form of "natural language question-table name-company name-financial indicator name-time". A diverse data set is generated through combination traversal to ensure the diversity and effectiveness of the extended data set, provide support for subsequent model training and optimization, and support high-quality structured financial data query and analysis tasks.
[0022] The natural language questions in the extended training samples are converted into API call instructions, and the converted API call instructions are actually called. The validity of the instructions is verified according to the return results of the API call, and the natural language questions that cannot obtain actual data are cleaned. The natural language questions that can correctly obtain data and their corresponding API call instructions are retained to form the final training data set. The API call instructions are constructed based on entity keywords (such as table name, company name, time, indicator name) in the natural language questions. Among them, the basis for verifying the validity of the instructions is whether the API call successfully returns the target data. If the call fails, it is judged as an invalid instruction. The cleaned high-quality training data can be used to fine-tune the instructions of the large model, thereby improving the accuracy and reliability of the large model in natural language question answering in the financial field.
[0023] The present invention uses the constructed training data as fine-tuning data and inputs it into the base model to perform instruction fine-tuning on the base model. The base model is a lightweight pre-trained language model, including but not limited to the LightGPT model or other similar large language models.
[0024] Further, in a preferred embodiment, fine-tuning the base model by instructions includes: Mix the training data and general natural language instruction fine-tuning data in a preset ratio to construct a comprehensive instruction fine-tuning dataset; The synthetic instruction fine-tuning dataset is input into the base model, and the model is fine-tuned through supervised learning methods.
[0025] The instruction fine-tuning adopts a supervised learning method to iteratively optimize the model parameters by calculating the loss value between the instructions generated by the model and the API call instructions in the training data.
[0026] The present invention mixes the training data including natural language questions, API call instructions and corresponding return results and the general natural language instruction fine-tuning data according to a preset ratio to construct a comprehensive instruction fine-tuning data set, and fine-tunes the instruction of the base model based on the comprehensive instruction fine-tuning data set. The model after instruction fine-tuning is not only suitable for structured financial data queries in the financial field, but also for general natural language data in non-financial fields. The mixed training data enables the model to learn the distribution of different types of tasks, thereby improving its generalization ability in a variety of task scenarios, reducing the risk of performance degradation of the model on new tasks, avoiding the model from overfitting to the financial field and ignoring general language tasks, thereby taking into account the robustness of the model. The model after instruction fine-tuning can not only handle complex structured financial data queries in the financial field, but also interact with users naturally, generate answers that are more in line with natural language habits, and improve user experience satisfaction. For example, in a financial scenario, user questions may include general questions and professional questions. Mixed data training allows the model to understand user intentions and industry background at the same time. By mixing financial-specific training data with general natural language instruction data in a preset ratio, the model's professional and general capabilities can be enhanced at the same time, improving its task adaptability, generalization ability, and user experience quality. This method is applicable to multi-domain scenarios and can effectively balance the model's multiple performance indicators. It is a key strategy for building a high-performance instruction fine-tuning model.
[0027] Without loss of generality, a dynamic weight adjustment mechanism can be used in the process of fine-tuning the instructions of the base model to optimize the model parameters according to the complexity of different types of natural language questions in the training data. For example, different training weights can be set according to the type and number of keyword entities in the natural language questions (such as table names, company names, time or indicator names) to reduce the probability of generating wrong instructions. The fine-tuned model can automatically parse questions and generate structured query instructions through natural language interaction with users, realizing efficient conversion from natural language to structured data retrieval.
[0028] When the fine-tuned instruction model automatically generates API call instructions based on natural language questions, it first extracts keyword entities based on the natural language questions, and then automatically constructs API call instructions based on the extracted keyword entities.
[0029] In order to verify the effectiveness of the present invention, the following experiments were set up to verify the technical effects.
[0030] Natural language questions in the financial field are used to verify the accuracy, recall rate and F1 value of the call tool data generated by the large model after fine-tuning the instructions obtained based on the present invention. The data set after generalization of the large model is divided into a training set and a test set in a ratio of 8:2. The base models for experimental comparison are LightGPT, llama2-13B, and Qwen-14B. Table 1 shows the detailed experimental results of the fine-tuned model on the training set.
[0031] Table 1
[0032] The general capability test of the large model after fine-tuning the tool call data instructions: CMMLU data is used to test the general ability of large models. CMMLU is a comprehensive Chinese large model benchmark. It contains 11,528 questions covering 67 subjects. Each subject has at least 105 questions, involving natural sciences, social sciences, engineering, humanities, and common sense, etc., which can comprehensively evaluate the ability of large models in Chinese knowledge reserves and language comprehension. CMMLU follows the MMLU method to obtain the probability of the next token after the prompt, and selects the option with the highest probability among A', B', C' and D' as the model's choice. The present invention experiments with both zero-sample (no input examples) and few-sample (a small number of input examples) settings. Table 2 and Table 3 show the detailed experimental results of the model before and after fine-tuning on CMMLU.
[0033] Table 2 Zero samples
[0034] Table 3 Few samples
[0035] As can be seen from Table 1, the fine-tuned LightGPT exceeds llama2-13B and Qwen-14B in accuracy, recall and F1 value, indicating that the model proposed by the present invention has a very high accuracy in generating financial fields, meeting the extremely high requirements for data quality in the financial field. At the same time, other open source models have also achieved relatively excellent performance, indicating that the method proposed by the present invention is also feasible for use on other models, indicating that the method proposed by the present invention can be generalized. As can be seen from Tables 2 and 3, the general ability of the fine-tuned model of the present invention has basically not decreased, which means that the fine-tuned model still has strong basic capabilities.
[0036] In summary, the model proposed in this paper has achieved remarkable performance in data generation and general ability testing in the financial field. From the experimental results, it can be seen that the model can effectively generate instructions for querying structured data in the financial field, and combined with tool calls, it can finally successfully generate accurate responses to users.
[0037] In another aspect, the present invention provides a structured financial data query device, comprising: The first module is used to extract various keyword entities from structured financial data in a financial database based on a table structure, and to build an entity pool containing various keyword entities. The structured financial data is stored in the financial database in the form of a data table; The second module is used to obtain a certain amount of natural language questions for each structured financial data and in combination with real business scenarios, and annotate the corresponding table names and related keyword entities to form a seed sample in the form of "natural language question-table name-keyword entity"; The third module is used to perform a combination traversal of various keyword entities in the data table and entity pool. Each combination result corresponds to an instance. A seed sample is randomly sampled from each instance to prompt the large language model to generate a natural language question corresponding to each instance, and obtain an extended training sample in the form of "natural language question-table name-keyword entity"; The fourth module is used to convert the natural language questions in the extended training samples into API call instructions, and actually call the converted API call instructions, verify the validity of the API call instructions according to the return results of the API call, clean up the natural language questions that cannot obtain actual data, retain the natural language questions that can correctly obtain data and their corresponding API call instructions, and construct training data including natural language questions, API call instructions and corresponding return results; The fifth module is used to input the constructed training data as fine-tuning data into the base model to perform instruction fine-tuning on the base model; The sixth module is used to input the natural language question to be queried into the fine-tuned model, and the model automatically generates API call instructions based on the natural language question to read structured financial data matching the natural language question in the financial database.
[0038] On the other hand, the present invention provides a computer device, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the structured financial data query method provided in any of the above embodiments when executing the computer program. The computer device may be a server. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store sample data. The network interface of the computer device is used to communicate with an external terminal via a network connection.
[0039] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the structured financial data query method provided in any of the above embodiments are implemented.
[0040] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0041] Matters not covered by the present invention are known technologies.
[0042] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0043] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
[0044] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A structured financial data query method, characterized in that: include: Extracting various keyword entities of structured financial data in a financial database based on the table structure, and building an entity pool containing various keyword entities, wherein the structured financial data is stored in the financial database in the form of a data table; For each structured financial data and combined with real business scenarios, a certain amount of natural language questions are obtained, and the corresponding table names and related keyword entities are annotated to form seed samples in the form of "natural language question-table name-keyword entity"; Perform a combination traversal of various keyword entities in the data table and entity pool. Each combination result corresponds to an instance. A seed sample is randomly sampled from each instance to prompt the large language model to generate a natural language question corresponding to each instance, and obtain an extended training sample in the form of "natural language question-table name-keyword entity"; The natural language questions in the extended training samples are converted into API call instructions, and the converted API call instructions are actually called. The validity of the API call instructions is verified according to the return results of the API call. Natural language questions that cannot obtain actual data are cleaned, and natural language questions that can correctly obtain data and their corresponding API call instructions are retained, so as to construct training data including natural language questions, API call instructions and corresponding return results. The constructed training data is used as fine-tuning data and input into the base model to perform instruction fine-tuning on the base model; The natural language question to be queried is input into the fine-tuned model, and the model automatically generates an API call instruction based on the natural language question to read structured financial data matching the natural language question in the financial database.
2. The structured financial data query method according to claim 1, characterized in that: The base model is a lightweight pre-trained language model, including but not limited to the LightGPT model or other similar large language models.
3. The structured financial data query method according to claim 1 or 2, characterized in that: Fine-tune the base model with instructions, including: Mix the training data and general natural language instruction fine-tuning data in a preset ratio to construct a comprehensive instruction fine-tuning dataset; The synthetic instruction fine-tuning dataset is input into the base model, and the model is fine-tuned through supervised learning methods.
4. The structured financial data query method according to claim 1 or 2, characterized in that: A dynamic weight adjustment mechanism is used in the process of fine-tuning the instructions of the base model to perform weighted optimization on the model parameters according to the complexity of different types of natural language questions in the training data.
5. The structured financial data query method according to claim 1, characterized in that: The keyword entities include multiple keyword entities, including table name, company name, time, and financial indicators.
6. The structured financial data query method according to claim 4, characterized in that: When the model automatically generates API call instructions based on natural language questions, it first extracts keyword entities based on the natural language questions, and then automatically constructs API call instructions based on the extracted keyword entities.
7. A structured financial data query device, characterized in that: include: The first module is used to extract various keyword entities from structured financial data in a financial database based on a table structure, and to build an entity pool containing various keyword entities. The structured financial data is stored in the financial database in the form of a data table; The second module is used to obtain a certain amount of natural language questions for each structured financial data and in combination with real business scenarios, and annotate the corresponding table names and related keyword entities to form seed samples in the form of "natural language question-table name-keyword entity"; The third module is used to perform a combination traversal of various keyword entities in the data table and entity pool. Each combination result corresponds to an instance. A seed sample is randomly sampled from each instance to prompt the large language model to generate a natural language question corresponding to each instance, and obtain an extended training sample in the form of "natural language question-table name-keyword entity"; The fourth module is used to convert the natural language questions in the extended training samples into API call instructions, and actually call the converted API call instructions, verify the validity of the API call instructions according to the return results of the API call, clean up the natural language questions that cannot obtain actual data, retain the natural language questions that can correctly obtain data and their corresponding API call instructions, and construct training data including natural language questions, API call instructions and corresponding return results; The fifth module is used to input the constructed training data as fine-tuning data into the base model to perform instruction fine-tuning on the base model; The sixth module is used to input the natural language question to be queried into the fine-tuned model, and the model automatically generates API call instructions based on the natural language question to read structured financial data matching the natural language question in the financial database.
8. The structured financial data query device according to claim 7, characterized in that: The base model is a lightweight pre-trained language model, including but not limited to the LightGPT model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the structured financial data query method as claimed in claim 1 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the structured financial data query method as claimed in claim 1 are implemented.