CN117744804A - Reasoning method, terminal and medium of financial analysis task based on large language model - Google Patents

Reasoning method, terminal and medium of financial analysis task based on large language model Download PDF

Info

Publication number
CN117744804A
CN117744804A CN202410182916.7A CN202410182916A CN117744804A CN 117744804 A CN117744804 A CN 117744804A CN 202410182916 A CN202410182916 A CN 202410182916A CN 117744804 A CN117744804 A CN 117744804A
Authority
CN
China
Prior art keywords
financial
analysis
language model
information
large language
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410182916.7A
Other languages
Chinese (zh)
Inventor
徐铖晋
杨策皓
卢浩
齐逸岩
林舟驰
郭健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Digital Economy Academy IDEA
Original Assignee
International Digital Economy Academy IDEA
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Digital Economy Academy IDEA filed Critical International Digital Economy Academy IDEA
Priority to CN202410182916.7A priority Critical patent/CN117744804A/en
Publication of CN117744804A publication Critical patent/CN117744804A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Machine Translation (AREA)

Abstract

The invention discloses a large language model-based reasoning method, a terminal and a medium of financial analysis tasks, wherein the method comprises the following steps: identifying a financial analysis task, extracting financial keywords of the financial analysis task based on a large language model, and acquiring financial knowledge information corresponding to the financial keywords; determining a target analysis tool based on the financial keywords and the financial knowledge information, and determining a target calculation result corresponding to the financial analysis task based on the target analysis tool; based on the financial knowledge information, the target analysis tool and the target calculation result, the promt is synthesized, and the large language model performs reasoning and interpretation on the financial analysis task according to the promt. According to the invention, financial knowledge information corresponding to the financial keywords is retrieved and acquired in the financial knowledge base based on the financial keywords extracted by the large language model so as to obtain a more accurate target analysis tool, and the reasoning calculation of the financial analysis task is performed based on the target analysis tool, so that the calculation accuracy and the reliability of the financial analysis task are improved.

Description

Reasoning method, terminal and medium of financial analysis task based on large language model
Technical Field
The invention relates to the technical field of financial problem analysis, in particular to a large language model-based reasoning method, terminal and medium for financial analysis tasks.
Background
With the rapid development of big data technology and the scale expansion of financial industry, the analysis and calculation scenes related to the financial industry are increased, the faced analysis and calculation problems are more complex and diversified, and the analysis and calculation problems relate to various financial scenes such as financial examination, investment analysis, risk management, asset evaluation, insurance fine calculation, macro economic analysis and the like.
The analysis and calculation problems in the current financial scene mainly depend on professionals who possess rich related financial knowledge to calculate and analyze according to own knowledge reserves, such as professional accountant who possess registered accountant certificates, professional compilers who possess computator certificates, and the like. However, since the knowledge of financial staff in different financial scenes is relatively independent, it is almost impossible for individuals to implement analytical calculation problems in financial full scenes. With the development of large language models, the industry is hoped to use large language models to perform financial task reasoning calculation, but facing more complex analysis calculation problems, large language models cannot give accurate analysis tools, for example, the problem is solved by means of a code generation function of the large language models, but codes for solving the financial calculation problem need to be used in combination with specific financial scenes to select specific mathematical calculation formulas for application, wherein the application of specific variables, the formula deformation of the specific scenes and the like may be involved, and the large-scale sharing and recycling are difficult to perform. Therefore, in the prior art, accurate calculation and efficient analysis of analysis and calculation problems under a financial full scene are difficult to realize through a large language model.
Accordingly, there is a need for improvement and advancement in the art.
Disclosure of Invention
The invention aims to solve the technical problems that in the prior art, accurate calculation and efficient analysis of analysis and calculation problems under a financial full scene are difficult to realize through a large language model.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a method for reasoning a financial analysis task based on a large language model, wherein the method includes:
identifying a financial analysis task, extracting financial keywords of the financial analysis task based on a large language model and acquiring financial knowledge information corresponding to the financial keywords, wherein the large language model is a model obtained by training a plurality of financial corpora and corresponding financial meanings in advance;
determining a target analysis tool based on the financial keywords and the financial knowledge information, and determining a target calculation result corresponding to the financial analysis task based on the target analysis tool;
And synthesizing a prompt based on the financial knowledge information, the target analysis tool and the target calculation result, and performing reasoning explanation on the financial analysis task by the large language model according to the prompt.
In one implementation, the identifying financial analysis tasks includes:
receiving a financial problem input by a user, and acquiring text information and/or chart information corresponding to the financial problem;
and carrying out intention recognition on the large language model based on the text information and/or the chart information to obtain the financial analysis task.
In one implementation manner, the obtaining text information and/or chart information corresponding to the financial problem includes:
performing optical character recognition on the images in the financial problem to obtain the chart information;
and/or the number of the groups of groups,
and carrying out character recognition on the financial problem based on a character recognition interface to obtain the character information.
In one implementation, the optical character recognition of the image in the financial question to obtain the chart information includes:
identifying a table in the image based on a table character identification interface to obtain table information;
Identifying a mathematical formula in the image based on a mathematical formula character identification interface to obtain mathematical formula information;
and taking the table information and the mathematical formula information as the chart piece information.
In one implementation manner, the extracting financial keywords of the financial analysis task based on the large language model and obtaining financial knowledge information corresponding to the financial keywords includes:
based on the large language model, carrying out scene recognition on the text information and/or the chart information to obtain analysis scene information corresponding to the financial analysis task;
determining analysis intention information according to the analysis scene information;
acquiring problem description information corresponding to the financial analysis task, and extracting financial vocabulary of the problem description information based on the large language model to obtain financial vocabulary information;
matching the financial vocabulary information with the analysis intention information to obtain the financial keywords;
and determining the financial knowledge information based on the financial keywords.
In one implementation, the determining the financial knowledge information based on the financial keywords includes:
And searching the financial keywords in a preset financial knowledge base to obtain the financial knowledge information.
In one implementation, the determining a target analysis tool based on the financial keywords and the financial knowledge information includes:
acquiring financial description information of each financial keyword, and carrying out vector coding on each financial keyword and corresponding financial description information to obtain first vector information of each financial keyword;
performing similarity calculation on the first vector information of each financial keyword and the second vector information corresponding to each analysis tool in a preset analysis tool library one by one to obtain a similarity result;
based on the similarity results, the target analysis tool is determined.
In one implementation, the determining the target analysis tool based on the similarity result includes:
according to the similarity result, obtaining an analysis tool with the highest similarity with each financial keyword, and taking the analysis tool with the highest similarity with each financial keyword as an alternative analysis tool;
acquiring problem description information corresponding to the financial analysis task, and determining complexity information of the problem description information;
The large language model determines at least one of the target analysis tools from the alternative analysis tools based on the complexity information.
In one implementation, the determining, based on the target analysis tool, a target calculation result corresponding to the financial analysis task includes:
based on a preset program interface library, respectively acquiring application program interfaces corresponding to each target analysis tool, and determining the use sequence of the application program interfaces;
and calling the target analysis tool to analyze the financial analysis task based on the use sequence of the application program interface to obtain the target calculation result.
In one implementation manner, the calling the target analysis tool to analyze the financial analysis task based on the use sequence of the application program interface to obtain the target calculation result includes:
determining a variable value for analyzing the financial analysis task based on the problem description information corresponding to the financial analysis task;
based on the application program interface, the large language model generates a function code according to the target analysis tool, and inputs the variable numerical value into the function code for calculation, so that the target calculation result is obtained.
In one implementation, the method further comprises:
and acquiring a preset financial case library, and retrieving a target case corresponding to the financial analysis task from the preset financial case library.
In one implementation, the method further comprises:
pre-constructing a financial knowledge base, wherein the financial knowledge base comprises a plurality of financial corpora and corresponding financial meanings;
training a large language model by using the financial corpus and the corresponding financial meanings in the financial knowledge base, so that the large language model can understand the financial meaning of each financial corpus.
In one implementation, the method further comprises:
constructing a multi-source heterogeneous data retrieval engine driven by the large language model, wherein the multi-source heterogeneous data retrieval engine is used for responding to data query requirements of different task scenes.
In one implementation, the method further comprises:
and pre-constructing a program interface library, wherein the program interface library comprises a plurality of application program interfaces, and the application program interfaces are used for calling the target analysis tool and generating function codes according to the target analysis tool so as to perform reasoning calculation on the financial analysis task through the function codes.
In a second aspect, an embodiment of the present invention further provides an inference apparatus for a financial analysis task based on a large language model, where the apparatus includes:
the keyword analysis module is used for identifying financial analysis tasks, extracting financial keywords of the financial analysis tasks based on a large language model and acquiring financial knowledge information corresponding to the financial keywords, wherein the large language model is a model obtained by training a plurality of financial corpora and corresponding financial meanings in advance;
the tool determining module is used for determining a target analysis tool based on the financial keywords and the financial knowledge information and determining a target calculation result corresponding to the financial analysis task based on the target analysis tool;
and the task analysis module is used for generating a prompt based on the financial knowledge information, the target analysis tool and the target calculation result, and the large language model performs reasoning explanation on the financial analysis task according to the prompt.
In a third aspect, an embodiment of the present invention further provides a terminal, where the terminal includes a memory, a processor, and an inference program of a large language model-based financial analysis task stored in the memory and executable on the processor, and when the processor executes the inference program of the large language model-based financial analysis task, the processor implements the steps of the inference method of the large language model-based financial analysis task of any one of the above schemes.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium stores an inference program of a financial analysis task based on a large language model, where when the inference program of the financial analysis task based on the large language model is executed by a processor, the steps of the inference method of the financial analysis task based on the large language model according to any one of the above schemes are implemented.
The beneficial effects are that: compared with the prior art, the invention provides a reasoning method of a financial analysis task based on a large language model. The invention may then determine a target analysis tool based on the financial keywords and the financial knowledge information. Because the large language model is a model obtained by training a plurality of financial corpora and corresponding financial meanings in advance, financial keywords and financial knowledge information analyzed by the large language model are related to the financial field, and the obtained target analysis tool is also a financial field specific analysis tool, so that an accurate target calculation result can be obtained after the financial analysis task is analyzed based on the target analysis tool. Finally, the invention can generate reasoning information based on the financial knowledge information, the target analysis tool and the target calculation result, and the large language model performs reasoning explanation on the financial analysis task according to the reasoning information. Therefore, the invention determines the financial knowledge information corresponding to the financial analysis task based on the large language model, and is convenient for determining a more accurate target analysis tool, thereby improving the analysis accuracy and the reliability of the financial analysis task.
Drawings
Fig. 1 is a flowchart of a preferred embodiment of a method for reasoning about financial analysis tasks based on a large language model according to an embodiment of the present invention.
Fig. 2 is a schematic block diagram of a reasoning method of a financial analysis task based on a large language model according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of an inference apparatus for a financial analysis task based on a large language model according to an embodiment of the present invention.
Fig. 4 is a schematic block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and more specific, the present invention will be described in further detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Because the accurate calculation and the efficient analysis of the analysis and calculation problems in the financial full scene are difficult to realize through the large language model in the prior art. Therefore, the embodiment provides a large language model-based reasoning method for financial analysis tasks, which can eliminate the defects of inaccuracy, incompleteness and the like caused by analysis and calculation problems in a financial full scene by adopting a large language model. In specific application, the embodiment first identifies a financial analysis task, extracts financial keywords of the financial analysis task based on a large language model, and acquires financial knowledge information corresponding to the financial keywords. The financial keywords in the embodiment are obtained by searching in the financial knowledge base, and because the data quality is ensured when the financial knowledge base is constructed, compared with the explanation of related terms or concepts directly generated by the traditional large language model, the financial knowledge information obtained by searching is more reliable and authoritative, the problem of illusion of the content generated by the large language model is avoided, and the accurate target analysis tool can be ensured to be determined based on the financial keywords and the financial knowledge information later. Because the large language model of the embodiment is a model obtained by training a plurality of financial corpora and corresponding financial meanings in advance, financial keywords and financial knowledge information analyzed by the large language model are related to the financial domain, and the obtained target analysis tool is also a financial domain-specific analysis tool, so that an accurate target calculation result can be obtained after analysis and calculation are performed on the financial analysis task based on the target analysis tool. Finally, the present embodiment may synthesize a prompt (prompt word) based on the financial knowledge information, the target analysis tool, and the target calculation result, and the large language model performs inference interpretation on the financial analysis task according to the prompt, including, but not limited to, interpretation of a financial term related to an original question, a financial calculation formula related to the original question, a calculation step of analyzing the original question, a calculation result of each step, and a final answer. Therefore, the financial knowledge information corresponding to the financial analysis task is determined based on the large language model, so that a more accurate target analysis tool can be determined conveniently, and the analysis accuracy and the reliability of the financial analysis task are improved.
The reasoning method of the financial analysis task based on the large language model can be applied to a terminal, and the terminal can be an intelligent product terminal such as a computer and an intelligent television. Specifically, as shown in fig. 1, the reasoning method of the financial analysis task based on the large language model of the present embodiment includes the steps of:
step S100, identifying a financial analysis task, extracting financial keywords of the financial analysis task based on a large language model and acquiring financial knowledge information corresponding to the financial keywords, wherein the large language model is a model obtained by training a plurality of financial corpora and corresponding financial meanings in advance.
The present embodiment first identifies a financial analysis task that may be based on a user asking questions by way of voice input or text input. In this embodiment, a large language model may be used to identify financial tasks, and determine financial keywords corresponding to financial analysis tasks and financial knowledge information corresponding to the financial keywords.
Although the large language model has general coaching and problem solving capability at present, certain limitations still exist in coping with financial analysis tasks. The current large language model is not familiar with knowledge points and examination points of a particular financial analysis scenario, so that serious "illusion" problems occur. For example, in the reasoning process, a large language model generates and uses wrong financial calculation formulas or extends along wrong thinking links, so that financial analysis tasks cannot be completed. Therefore, in this embodiment, the financial knowledge base is constructed in advance, and steps such as data screening, data cleaning, knowledge extraction and the like can be performed when the financial knowledge base is constructed. The financial knowledge base comprises a plurality of financial corpora and corresponding financial meanings. And training the existing large language model by using the financial corpus and the corresponding financial meaning in the financial knowledge base so that the large language model can understand the financial meaning of each financial corpus. Since the financial corpus and the corresponding financial meaning are related to the financial domain, the large language model of the embodiment can extract the financial keywords and the financial knowledge information related to the financial domain from the financial analysis task, so as to accurately determine the target analysis tool in the subsequent steps.
Specifically, the embodiment can process a large number of books, teaching materials, industry research reports, financial reports and other original images, PDF (portable document format) and other files in the financial field by adopting an optical character recognition technology, extract related financial entities, concepts, terms, formulas, cases, example questions and the like, and construct a comprehensive financial knowledge base. In addition, the present embodiment uses a large language model to understand the meaning of various structured financial corpora of the financial knowledge base, enriches the entries thereof, such as calculation formulas of key indexes including the asset return rate, the leverage rate, the liability rate, the share information payment rate, etc., in various aspects of money, market, finance, lending, assets, etc., and generates more detailed descriptions for the calculation formulas as text features so as to analyze financial analysis tasks based on the large language model.
Referring to fig. 2, the terminal first receives a financial question input by a user, where the financial question may be obtained by asking the user through voice input or text input. If a question is entered using text, the financial question is in text form. If the user uses voice input mode to make question, the financial question is voice form, and voice recognition technology can be used to convert the voice form financial question into text form financial question. If an image is inserted into a financial question in text form, the present embodiment needs to identify the image in the financial question, so as to obtain text information and/or chart information. If no image exists, the embodiment can directly adopt the character recognition interface to carry out character recognition on the financial problem to obtain character information. After identifying the text information and/or the chart information, the embodiment can replace the identified text information and/or chart information at the same position in the financial problem, and perform intention identification, so as to obtain the financial analysis task, wherein the financial analysis task reflects the financial problem description proposed by the user.
In one implementation, the present embodiment may employ optical character recognition techniques to identify materials in image format that are present in financial problems when the user inputs a containing image. The embodiment preferentially calls a form character recognition interface to recognize a form in the image, and if the recognition is successful, the form information expressed in a MarkDown format is returned; and if the mathematical formula information is detected to be not the table information, calling a mathematical formula character recognition interface to recognize the mathematical formula in the image, and if the mathematical formula is successfully recognized, returning the mathematical formula information expressed in the LaTeX format. The present embodiment can use the identified table information and mathematical formula information as the chart information of the user input image. If neither the form information nor the mathematical formula information is recognized when the user input image is recognized, the embodiment may invoke the universal text recognition interface to return text information in the image.
The embodiment pre-builds a multi-source heterogeneous data retrieval engine driven by the large language model, wherein the multi-source heterogeneous data retrieval engine is used for responding to data query requirements of different task scenes. Based on this, the present embodiment may perform scene recognition on the text information and/or the chart information input by the user based on the large language model to obtain the analysis scene information corresponding to the financial analysis task, and since the large language model of the present embodiment is specifically trained for the financial domain, the obtained analysis calculation scene information is a scene related to the financial domain, for example, the analysis calculation scene information may be a financial audit, risk assessment, asset pricing, investment portfolio management, market research, and other financial analysis technologies of multiple types. Further, a scene recognition agent, which may be driven by a large language model, may perform intent recognition on financial analysis computing scenes associated with user input information, determining analysis intent information. Similarly, the analysis intention information is also an intention related to the financial field, for example, the analysis intention information is an intention to assist a financial practitioner in work, a financial occupational certificate examination, personal financial planning, education, academic research, and the like. In one implementation, the present embodiment may synthesize the scene prompt word and the intention prompt word related to the financial domain in advance, and inject the scene prompt word and the intention prompt word as structured metadata into the large language model in Json format, so that the scene recognition agent driven by the large language model automatically recognizes the analysis intention information.
Because the financial questions input by the user are rich, the financial terms or concepts related in the questions may have smaller duty ratios, and the direct use of the financial questions to retrieve financial knowledge is susceptible to extraneous information. In addition, the financial questions entered by the user may not explicitly include the financial terms or concepts associated therewith, and financial knowledge cannot be obtained by keyword retrieval. In order to ensure that the financial terms and concepts related to the financial problem input by the user are aligned with the information in the financial knowledge base, the present embodiment first obtains problem description information corresponding to the financial analysis task, where the problem description information reflects the specific content of the financial problem. Then, the embodiment extracts keywords from the question description information and the analysis intention information based on the large language model to obtain the financial keywords, and the financial keywords are related to the analysis intention information. In one implementation, the financial keywords are a type of financial terms, and the financial keywords obtained in this embodiment may be plural, to form a financial keyword list, such as "interest rate", "long term premium", "return rate", etc. After the financial keywords are obtained, the embodiment searches the financial knowledge information related to the financial keywords in the preset financial knowledge base, and the financial knowledge information is the detailed explanation of the financial questions input by the user. According to the method, the device and the system, the data quality is ensured by constructing the financial knowledge base, compared with explanation of related terms or concepts directly generated by using a large language model, the financial knowledge information obtained by searching is more reliable and authoritative, the problem of 'illusion' of the content generated by the large model is avoided, and the accurate target analysis tool is ensured to be obtained by subsequent searching.
Step 200, determining a target analysis tool based on the financial keywords and the financial knowledge information, and determining a target calculation result corresponding to the financial analysis task based on the target analysis tool.
After obtaining the financial keywords and financial knowledge information, the present embodiment may determine a target analysis tool. In this embodiment, the financial problem input by the user is a financial calculation problem, and the corresponding financial analysis task is an analysis calculation task for various financial scenes, so the target analysis tool is a financial calculation formula for calculating the financial calculation problem. That is, the target analysis tool obtained in this embodiment is the most accurate financial calculation formula, so that the financial analysis task can be accurately calculated based on the financial calculation formula, and the obtained target calculation result is also a more accurate calculation result.
Specifically, the present embodiment constructs in advance an analysis tool library including a plurality of analysis tools and financial terms and detailed explanations associated with each analysis tool. In practice, the library of analysis tools may be a library of financial computational formulas. In addition, the embodiment also adopts a text vectorization model to understand the financial corpus of each item in the financial knowledge base and generate text vectors, stores the text vectors in a vector database and embeds the text vectors in a similarity query bottom algorithm for retrieval so as to return N knowledge items with highest cosine similarity to the problem vectors to be queried. Based on this, the embodiment can obtain the financial description information of each financial keyword, and vector-encode each financial keyword and the corresponding financial description information to obtain the first vector information of each financial keyword. And then carrying out similarity calculation on the first vector information of each financial keyword and the second vector information corresponding to each analysis tool in the preset analysis tool library one by one to obtain a similarity result. And then, according to the similarity result, obtaining an analysis tool with the highest similarity with each financial keyword, and taking the analysis tool with the highest similarity with each financial keyword as an alternative analysis tool. For example, the financial keyword is "water-up", which is also called "long-term premium", that is, the long-term contract price is higher than the spot price, and then the financial keyword "water-up" and the specific description are included in the financial keyword list, when the similarity analysis is performed, the financial keyword "water-up" and the specific description can be vector-coded to obtain first vector information, then the first vector information and the second vector information corresponding to each analysis tool in the analysis tool library are subjected to similarity calculation one by one, and the analysis tool with the highest similarity is screened out, as an alternative analysis tool, for example, the screened alternative analysis tool is a calculation formula of "long-term premium".
Further, the embodiment may obtain the problem description information corresponding to the financial analysis task, and determine complexity information of the problem description information, where the complexity information reflects the analysis difficulty of the financial analysis task. The large language model then determines at least one of the target analysis tools from the alternative analysis tools based on the complexity information. In this embodiment, the target analysis tool is a retrieved related financial calculation formula that can be presented to the user as financial knowledge to help the user understand the calculation formula needed to analyze the original problem, but cannot be used directly for calculation.
In one implementation manner, the embodiment pre-constructs a program interface library, where the program interface library includes a plurality of Application Program Interfaces (APIs), and the application program interfaces are configured to call the target analysis tool and generate a function code according to the target analysis tool, so as to perform inference calculation on the financial analysis task through the function code. Based on this, according to the program interface library, the embodiment obtains the application program interfaces corresponding to each target analysis tool respectively, forms a financial computing API list, and determines the use sequence of the application program interfaces. Next, the present embodiment sequentially invokes the corresponding target analysis tools to analyze the financial analysis task based on the application program interface usage sequence, so as to obtain the target calculation result. And then generating a function code according to the target analysis tool based on the application program interface, and inputting the variable numerical value into the function code to obtain the target calculation result, wherein the target calculation result is a problem solution of a financial analysis task.
In specific application, for complex financial computing problems, the large language model may determine at least one target analysis tool from the alternative analysis tools, and determine an application program interface of each target analysis tool, so as to obtain at least one financial computing formula and a corresponding financial computing API. Then, during calculation, the present embodiment may determine the usage order of the financial calculation API so as to call the corresponding financial calculation formula according to the usage order, where the usage order of the financial calculation API in the present embodiment reflects the calculation logic planning calculation order, for example, when the financial scenario is a foreign exchange transaction, the numerical result obtained for the calculation task of "distant premium" may be used for the calculation of the "return on investment" of the next stage. Then, the present embodiment calls the large language model to extract specific values (i.e., variable values) of various parameters possibly required for calculation from the problem description information corresponding to the financial analysis task, specifically, the financial analysis calculation agent driven by the large language model needs to determine whether the variable value required to be input by each financial calculation formula is already given in the user input, or needs to execute some calculation formulas as a pre-step, if already given, the financial calculation API and the financial calculation formulas can be automatically called, and the given variable value is filled into the parameter list of the corresponding financial calculation formula, thereby obtaining the target calculation result. If the needed variable values cannot be obtained from the problem description information and the related chart information corresponding to the financial analysis task, and cannot be calculated from the calculation formula in the middle of the flow, the intelligent analysis and calculation agent prompts the user to supplement the needed values of the parameters.
And step 300, synthesizing a prompt based on the financial knowledge information, the target analysis tool and the target calculation result, and performing reasoning explanation on the financial analysis task by the large language model according to the prompt.
The embodiment synthesizes a prompt according to the financial knowledge information, the target analysis tool and the target calculation result. The large language model generates comprehensive reasoning and interpretation for the problem description information corresponding to the financial analysis task according to the prompt, including but not limited to financial term interpretation related to the problem description information, financial calculation formulas related to the problem description information, calculation steps for analyzing the original problem, calculation results of the steps and final answers.
In addition, the implementation also builds a financial case library in advance, and the steps of data screening, data cleaning, case extraction and the like can be carried out when the financial case library is built. Specifically, the large language model is used for extracting and summarizing the entries of unstructured corpora of the financial knowledge base, such as source financial textbooks, financial topics of examination or real financial cases related to scenes such as economic laws, tax laws and the like, and corresponding abstracts are generated. The embodiment can retrieve the target case corresponding to the financial analysis task from the preset financial case library and display the target case to the user so as to perform omnibearing explanation on the financial analysis task.
In summary, the reasoning method of the financial analysis task based on the large language model of the embodiment has at least the following effects:
(1) The embodiment helps the large language model overcome the difficulty that the problem is easy to generate illusion when the knowledge in the specific financial field is lack by injecting external financial knowledge;
(2) The embodiment solves the difficulty of unreliability and unexplainability of the large language model to execute mathematical calculation by proposing a retrieval paradigm of a financial calculation formula library driven by the large language model;
(3) The embodiment solves the difficulty of insufficient code generation capability of a large language model in the financial field by introducing a packaged program interface library;
(4) The embodiment provides a scheme for assisting an external tool to call by an intelligent agent to help a large language model overcome the difficulty that the large language model cannot respond to the complex financial analysis and calculation requirements.
Based on the above embodiment, the present invention further provides a device for reasoning about financial analysis tasks based on a large language model, as shown in fig. 3, the device comprising: keyword analysis module 10, tool determination module 20, and task analysis module 30. Specifically, the keyword analysis module 10 is configured to identify a financial analysis task, extract financial keywords of the financial analysis task based on a large language model, and obtain financial knowledge information corresponding to the financial keywords, where the large language model is a model obtained by training a plurality of financial corpora and corresponding financial meanings in advance. The tool determining module 20 is configured to determine a target analysis tool based on the financial keyword and the financial knowledge information, and determine a target calculation result corresponding to the financial analysis task based on the target analysis tool. The task analysis module 30 is configured to synthesize a prompt based on the financial knowledge information, the target analysis tool, and the target calculation result, and the large language model performs inference interpretation on the financial analysis task according to the prompt.
In one implementation, the keyword analysis module 10 includes:
the information acquisition unit is used for receiving financial questions input by a user and acquiring text information and/or chart information corresponding to the financial questions;
and the task determining unit is used for carrying out intention recognition on the basis of the text information and/or the chart information by the large language model to obtain the financial analysis task.
In one implementation, the information acquisition unit includes:
the chart identification subunit is used for carrying out optical character identification on the images in the financial problems to obtain the chart information;
and/or the number of the groups of groups,
and the character recognition subunit is used for carrying out character recognition on the financial problem based on a character recognition interface to obtain the character information.
In one implementation, the chart identification subunit includes:
the form recognition subunit is used for recognizing forms in the images based on the form character recognition interface to obtain form information;
the formula recognition subunit is used for recognizing the mathematical formulas in the image based on the mathematical formula character recognition interface to obtain mathematical formula information;
and the chart determining subunit is used for taking the table information and the mathematical formula information as the chart information.
In one implementation, the keyword analysis module 10 further includes:
the scene analysis unit is used for carrying out scene recognition on the text information and/or the chart information based on the large language model to obtain analysis scene information corresponding to the financial analysis task;
the keyword analysis unit is used for determining analysis intention information according to the analysis scene information;
the vocabulary extraction subunit is used for acquiring problem description information corresponding to the financial analysis task, and extracting financial vocabulary of the problem description information based on the large language model to obtain financial vocabulary information;
and the keyword matching subunit is used for matching the financial vocabulary information with the analysis intention information to obtain the financial keywords.
And the financial knowledge determining unit is used for determining the financial knowledge information based on the financial keywords.
In one implementation, the financial knowledge determination unit includes:
and the financial knowledge matching sub-unit is used for searching the financial keywords in a preset financial knowledge base to obtain the financial knowledge information.
In one implementation, the tool determination module 20 includes:
The vector coding unit is used for obtaining the financial description information of each financial keyword, and carrying out vector coding on each financial keyword and the corresponding financial description information to obtain first vector information of each financial keyword;
the similarity calculation unit is used for calculating the similarity of the first vector information of each financial keyword and the second vector information corresponding to each analysis tool in the preset analysis tool library one by one to obtain a similarity result;
and an analysis tool determination unit configured to determine the target analysis tool based on the similarity result.
In one implementation, the analysis tool determination unit includes:
the alternative tool determining subunit is used for obtaining an analysis tool with the highest similarity with each financial keyword according to the similarity result, and taking the analysis tool with the highest similarity with each financial keyword as an alternative analysis tool;
the complexity analysis subunit is used for acquiring the problem description information corresponding to the financial analysis task and determining the complexity information of the problem description information;
and the target tool screening subunit is used for determining at least one target analysis tool from the alternative analysis tools according to the complexity information by the large language model.
In one implementation, the tool determination module 20 further includes:
the use sequence determining unit is used for respectively acquiring the application program interfaces corresponding to each target analysis tool based on a preset program interface library and determining the use sequence of the application program interfaces;
and the calculation result determining unit is used for calling the target analysis tool to analyze the financial analysis task based on the use sequence of the application program interface so as to obtain the target calculation result.
In one implementation, the calculation result determining unit includes:
the variable value determining subunit is used for determining a variable value for analyzing the financial analysis task based on the problem description information corresponding to the financial analysis task;
and the data analysis subunit is used for generating a function code according to the target analysis tool based on the application program interface, inputting the variable numerical value into the function code for calculation, and obtaining the target calculation result.
In one implementation, the apparatus further comprises:
the case matching module is used for acquiring a preset financial case library and retrieving a target case corresponding to the financial analysis task from the preset financial case library.
In one implementation, the apparatus further comprises:
the financial knowledge base construction module is used for constructing a financial knowledge base in advance, wherein the financial knowledge base comprises a plurality of financial corpora and corresponding financial meanings;
and the large language model training module is used for training a large language model by using the financial corpus and the corresponding financial meanings in the financial knowledge base so that the large language model can understand the financial meaning of each financial corpus.
In one implementation, the apparatus further comprises:
and the search engine construction module is used for constructing a multi-source heterogeneous data search engine driven by the large language model, and the multi-source heterogeneous data search engine is used for responding to the data query requirements of different task scenes.
In one implementation, the apparatus further comprises:
the program interface library construction module is used for pre-constructing a program interface library, the program interface library comprises a plurality of application program interfaces, the application program interfaces are used for calling the target analysis tool and generating function codes according to the target analysis tool so as to perform reasoning calculation on the financial analysis task through the function codes.
The working principle of each module in the reasoning device of the financial analysis task based on the large language model in this embodiment is the same as the principle of each step in the above method embodiment, and will not be repeated here.
Based on the above embodiment, the present invention also provides a terminal, and a schematic block diagram of the terminal may be shown in fig. 4. The terminal may include one or more processors 100 (only one shown in fig. 4), a memory 101, and a computer program 102 stored in the memory 101 and executable on the one or more processors 100, such as a data interaction program for a large language model based reasoning apparatus for financial analysis tasks. The one or more processors 100, when executing the computer program 102, may implement the various steps in embodiments of the data interaction method of the inference means for financial analysis tasks based on a large language model. Alternatively, the functions of the modules/units in the data interaction method embodiment of the inference device for financial analysis tasks based on a large language model may be implemented by one or more processors 100 when executing computer program 102, which is not limited herein.
In one embodiment, the processor 100 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In one embodiment, the memory 101 may be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. The memory 101 may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the electronic device. Further, the memory 101 may also include both an internal storage unit and an external storage device of the electronic device. The memory 101 is used to store computer programs and other programs and data required by the terminal. The memory 101 may also be used to temporarily store data that has been output or is to be output.
It will be appreciated by those skilled in the art that the functional block diagram shown in fig. 4 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the terminal to which the present inventive arrangements may be applied, as a specific terminal may include more or less components than those shown, or may be combined with some components, or may have a different arrangement of components.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program, which may be stored on a non-transitory computer readable storage medium, that when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, operational database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual operation data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (17)

1. A method for reasoning financial analysis tasks based on a large language model, the method comprising:
identifying a financial analysis task, extracting financial keywords of the financial analysis task based on a large language model and acquiring financial knowledge information corresponding to the financial keywords, wherein the large language model is a model obtained by training a plurality of financial corpora and corresponding financial meanings in advance;
determining a target analysis tool based on the financial keywords and the financial knowledge information, and determining a target calculation result corresponding to the financial analysis task based on the target analysis tool;
And synthesizing a prompt based on the financial knowledge information, the target analysis tool and the target calculation result, and performing reasoning explanation on the financial analysis task by the large language model according to the prompt.
2. The method of reasoning about large language model based financial analysis tasks of claim 1, wherein the identifying financial analysis tasks comprises:
receiving a financial problem input by a user, and acquiring text information and/or chart information corresponding to the financial problem;
and carrying out intention recognition on the large language model based on the text information and/or the chart information to obtain the financial analysis task.
3. The reasoning method of the financial analysis task based on the large language model as claimed in claim 2, wherein the obtaining text information and/or chart information corresponding to the financial problem includes:
performing optical character recognition on the images in the financial problem to obtain the chart information;
and/or the number of the groups of groups,
and carrying out character recognition on the financial problem based on a character recognition interface to obtain the character information.
4. The reasoning method of the financial analysis task based on the large language model as set forth in claim 3, wherein the optical character recognition of the image in the financial question to obtain the chart information includes:
Identifying a table in the image based on a table character identification interface to obtain table information;
identifying a mathematical formula in the image based on a mathematical formula character identification interface to obtain mathematical formula information;
and taking the table information and the mathematical formula information as the chart information.
5. The method for reasoning about a financial analysis task based on a large language model according to claim 2, wherein the extracting financial keywords of the financial analysis task based on the large language model and acquiring financial knowledge information corresponding to the financial keywords comprises:
based on the large language model, carrying out scene recognition on the text information and/or the chart information to obtain analysis scene information corresponding to the financial analysis task;
determining analysis intention information according to the analysis scene information;
acquiring problem description information corresponding to the financial analysis task, and extracting financial vocabulary of the problem description information based on the large language model to obtain financial vocabulary information;
matching the financial vocabulary information with the analysis intention information to obtain the financial keywords;
And determining the financial knowledge information based on the financial keywords.
6. The method of reasoning about a large language model based financial analysis task of claim 5, wherein the determining the financial knowledge information based on the financial keywords comprises:
and searching the financial keywords in a preset financial knowledge base to obtain the financial knowledge information.
7. The method for reasoning about a large language model based financial analysis task of claim 1, wherein the determining a target analysis tool based on the financial keywords and the financial knowledge information comprises:
acquiring financial description information of each financial keyword, and carrying out vector coding on each financial keyword and corresponding financial description information to obtain first vector information of each financial keyword;
performing similarity calculation on the first vector information of each financial keyword and the second vector information corresponding to each analysis tool in a preset analysis tool library one by one to obtain a similarity result;
based on the similarity results, the target analysis tool is determined.
8. The method of reasoning about a large language model based financial analysis task of claim 7, wherein the determining the target analysis tool based on the similarity result comprises:
According to the similarity result, obtaining an analysis tool with the highest similarity with each financial keyword, and taking the analysis tool with the highest similarity with each financial keyword as an alternative analysis tool;
acquiring problem description information corresponding to the financial analysis task, and determining complexity information of the problem description information;
the large language model determines at least one of the target analysis tools from the alternative analysis tools based on the complexity information.
9. The method for reasoning about a financial analysis task based on a large language model as recited in claim 8, wherein the determining, based on the target analysis tool, a target calculation result corresponding to the financial analysis task includes:
based on a preset program interface library, respectively acquiring application program interfaces corresponding to each target analysis tool, and determining the use sequence of the application program interfaces;
and calling the target analysis tool to analyze the financial analysis task based on the use sequence of the application program interface to obtain the target calculation result.
10. The method for reasoning about a large language model based financial analysis task of claim 9, wherein the invoking the target analysis tool to analyze the financial analysis task based on the order of use of the application program interface to obtain the target calculation result comprises:
Determining a variable value for analyzing the financial analysis task based on the problem description information corresponding to the financial analysis task;
based on the application program interface, the large language model generates a function code according to the target analysis tool, and inputs the variable numerical value into the function code for calculation, so that the target calculation result is obtained.
11. The method for reasoning about a large language model based financial analysis task of claim 1, further comprising:
and acquiring a preset financial case library, and retrieving a target case corresponding to the financial analysis task from the preset financial case library.
12. The method for reasoning about a large language model based financial analysis task of claim 1, further comprising:
pre-constructing a financial knowledge base, wherein the financial knowledge base comprises a plurality of financial corpora and corresponding financial meanings;
training a large language model by using the financial corpus and the corresponding financial meanings in the financial knowledge base, so that the large language model can understand the financial meaning of each financial corpus.
13. The method for reasoning about a large language model based financial analysis task of claim 12, further comprising:
Constructing a multi-source heterogeneous data retrieval engine driven by the large language model, wherein the multi-source heterogeneous data retrieval engine is used for responding to data query requirements of different task scenes.
14. The method for reasoning about a large language model based financial analysis task of claim 1, further comprising:
and pre-constructing a program interface library, wherein the program interface library comprises a plurality of application program interfaces, and the application program interfaces are used for calling the target analysis tool and generating function codes according to the target analysis tool so as to perform reasoning calculation on the financial analysis task through the function codes.
15. A large language model based reasoning apparatus for financial analysis tasks, the apparatus comprising:
the keyword analysis module is used for identifying financial analysis tasks, extracting financial keywords of the financial analysis tasks based on a large language model and acquiring financial knowledge information corresponding to the financial keywords, wherein the large language model is a model obtained by training a plurality of financial corpora and corresponding financial meanings in advance;
the tool determining module is used for determining a target analysis tool based on the financial keywords and the financial knowledge information and determining a target calculation result corresponding to the financial analysis task based on the target analysis tool;
And the task analysis module is used for synthesizing a prompt based on the financial knowledge information, the target analysis tool and the target calculation result, and the large language model performs reasoning explanation on the financial analysis task according to the prompt.
16. A terminal comprising a memory, a processor and an inference program for large language model based financial analysis tasks stored in the memory and executable on the processor, the processor implementing the steps of the large language model based financial analysis tasks inference method as claimed in any one of claims 1 to 14 when executing the large language model based inference program for financial analysis tasks.
17. A computer-readable storage medium, wherein the computer-readable storage medium has stored thereon an inference program of a large language model-based financial analysis task, which when executed by a processor, implements the steps of the large language model-based financial analysis task inference method as claimed in any one of claims 1 to 14.
CN202410182916.7A 2024-02-19 2024-02-19 Reasoning method, terminal and medium of financial analysis task based on large language model Pending CN117744804A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410182916.7A CN117744804A (en) 2024-02-19 2024-02-19 Reasoning method, terminal and medium of financial analysis task based on large language model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410182916.7A CN117744804A (en) 2024-02-19 2024-02-19 Reasoning method, terminal and medium of financial analysis task based on large language model

Publications (1)

Publication Number Publication Date
CN117744804A true CN117744804A (en) 2024-03-22

Family

ID=90281717

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410182916.7A Pending CN117744804A (en) 2024-02-19 2024-02-19 Reasoning method, terminal and medium of financial analysis task based on large language model

Country Status (1)

Country Link
CN (1) CN117744804A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116151943A (en) * 2022-11-22 2023-05-23 中国银行股份有限公司 Interest data acquisition method and device for financial products in mobile phone bank
CN117520503A (en) * 2023-11-09 2024-02-06 中国平安人寿保险股份有限公司 Financial customer service dialogue generation method, device, equipment and medium based on LLM model

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116151943A (en) * 2022-11-22 2023-05-23 中国银行股份有限公司 Interest data acquisition method and device for financial products in mobile phone bank
CN117520503A (en) * 2023-11-09 2024-02-06 中国平安人寿保险股份有限公司 Financial customer service dialogue generation method, device, equipment and medium based on LLM model

Similar Documents

Publication Publication Date Title
CN111368049B (en) Information acquisition method, information acquisition device, electronic equipment and computer readable storage medium
CN110457431B (en) Knowledge graph-based question and answer method and device, computer equipment and storage medium
WO2021068321A1 (en) Information pushing method and apparatus based on human-computer interaction, and computer device
CN112527999B (en) Extraction type intelligent question-answering method and system for introducing knowledge in agricultural field
US8924197B2 (en) System and method for converting a natural language query into a logical query
CN111027327A (en) Machine reading understanding method, device, storage medium and device
CN110532397B (en) Question-answering method and device based on artificial intelligence, computer equipment and storage medium
WO2020233131A1 (en) Question-and-answer processing method and apparatus, computer device and storage medium
CN110929038A (en) Entity linking method, device, equipment and storage medium based on knowledge graph
CN110737756B (en) Method, apparatus, device and medium for determining answer to user input data
CN111309881A (en) Method and device for processing unknown questions in intelligent question answering, computer equipment and medium
CN109033427B (en) Stock screening method and device, computer equipment and readable storage medium
CN114693215A (en) Purchase request processing method and device, computer equipment and storage medium
CN112100401A (en) Knowledge graph construction method, device, equipment and storage medium for scientific and technological service
CN114647713A (en) Knowledge graph question-answering method, device and storage medium based on virtual confrontation
CN113064980A (en) Intelligent question and answer method and device, computer equipment and storage medium
CN113761124A (en) Training method of text coding model, information retrieval method and equipment
CN113220862A (en) Standard question recognition method and device, computer equipment and storage medium
CN112182126A (en) Model training method and device for determining matching degree, electronic equipment and readable storage medium
CN117131155A (en) Multi-category identification method, device, electronic equipment and storage medium
CN116186223A (en) Financial text processing method, device, equipment and storage medium
CN116662495A (en) Question-answering processing method, and method and device for training question-answering processing model
EP3964980A1 (en) Automatically recommending an existing machine learning project as adaptable for use in a new machine learning project
CN117744804A (en) Reasoning method, terminal and medium of financial analysis task based on large language model
CN113204679B (en) Code query model generation method and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination