A method and system for generating financial analysis report

By preprocessing and graph structure representation of financial data, combining vector quantization variational autoencoder and LORA fine-tuning technology, the problems of low data processing efficiency and unfine-tuning of models in traditional financial analysis methods are solved, and intelligent and automated finance are realized The generation of analysis reports improves the accuracy and reliability of analysis results.

CN118761401BActive Publication Date: 2025-01-07SHENZHEN DIBO ENTERPRISE RISK MANAGEMENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411241166.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2025-01-07
Estimated Expiration
2044-09-05

AI Technical Summary

Technical Problem

Traditional financial analysis methods are difficult to deal with huge and complex financial data. Data cleaning is cumbersome and prone to errors, lacks intelligent means, and large language models are not fine-tuned and difficult to capture the semantic characteristics and complex relationships of financial data, resulting in the accuracy and reliability of the analysis results. Sexual limitation.

Method used

By preprocessing financial data, a standardized data set with a graph structure is generated, a vector quantized variational autoencoder is used for discrete encoding, and a large language model is optimized using LORA fine-tuning technology to generate financial analysis reports to achieve intelligent and Automated analysis.

Benefits of technology

It improves the model computing efficiency, realizes intelligent training and the generation of automated financial analysis reports, provides high-quality support for corporate financial decisions, and ensures data accuracy and consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761401B_ABST
    Figure CN118761401B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of machine learning and enterprise risk control, and specifically relates to a method and system for generating a financial analysis report, comprising the following steps: obtaining the financial data of an enterprise, performing data preprocessing, and generating a standardized financial data set; constructing the generated standardized financial data set into a standardized data set with a graph structure; based on the standardized financial data set with a graph structure, using a vector quantization variational autoencoder for discretization encoding to generate a discrete token sequence; using the discrete token sequence as the input of an original large language model, using the LoRA fine-tuning technology to fine-tune the model, and generating an optimal large language model; weighting the original large language model and the optimal large language model to generate a financial analysis report based on new financial data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of machine learning and enterprise risk control, and specifically relates to a method and system for generating a financial analysis report. Background Art

[0002] In the modern financial field, with the expansion of enterprise scale and the complexity of business, the amount of financial data generated has increased dramatically, and these data are highly complex and diverse. These data include not only structured data in traditional financial statements, but also semi-structured and unstructured data from different business systems. The complexity of these data environments has put forward higher requirements on the financial analysis and decision-making capabilities of enterprises.

[0003] Traditional financial analysis methods mainly rely on manual processing and the experience and judgment of financial experts, and are not competent for processing large and complex data sets. Specifically, the data cleaning process is cumbersome and error-prone, and improper handling of duplicate data, erroneous data, and outliers will affect the accuracy of the analysis results; secondly, it is difficult to fully utilize the inherent correlation of the data to fill in missing values; finally, there is a lack of intelligent means for financial data analysis; in addition, when the pre-trained large language model is directly applied to financial data analysis, it is difficult to accurately capture the semantic features and complex relationships of financial data without fine-tuning. Manual processing is inefficient and prone to errors due to human factors, affecting the accuracy and reliability of the analysis results. Summary of the invention

[0004] The present invention provides a method and system for generating a financial analysis report, which generates and constructs a standardized financial data set with a graph structure by preprocessing the acquired financial data of an enterprise, then uses a vector quantization variational autoencoder for discretization encoding to generate a discrete token sequence, and uses the LORA fine-tuning technology to fine-tune the original large language model to optimize the model parameters, thereby generating a financial analysis report based on the new financial data; through weight fusion, the model calculation efficiency is improved, intelligent training is realized, and the generation of automated and intelligent financial analysis reports is realized, thereby providing support for corporate financial decision-making.

[0005] A method for generating a financial analysis report comprises the following steps:

[0006] Obtain the company's financial data, perform data preprocessing, and generate standardized financial data sets;

[0007] Constructing the generated standardized financial data set into a standardized financial data set with a graph structure;

[0008] Based on the standardized financial data set with graph structure, vector quantization variational autoencoder is used for discretization encoding to generate discrete token sequence;

[0009] The discrete token sequence is used as the input of the original large language model, and the LoRA fine-tuning technology is used to fine-tune the model to generate the optimal large language model;

[0010] The original large language model and the optimal large language model are weighted and fused to generate a financial analysis report based on the new financial data.

[0011] By preprocessing the acquired financial data of the enterprise, a standardized financial data set with a graph structure is generated and constructed. The vector quantization variational autoencoder is then used for discretization encoding to generate a discrete token sequence. The LORA fine-tuning technology is used to fine-tune the original large language model to optimize the model parameters, and then a financial analysis report is generated based on the new financial data. The model calculation efficiency is improved through weight fusion, and intelligent training is realized. At the same time, the generation of automated and intelligent financial analysis reports is realized, which provides support for corporate financial decision-making.

[0012] Furthermore, the financial data of an enterprise includes revenue, expenditure, assets and liabilities, cash flow, transaction frequency, and transaction conditions.

[0013] Furthermore, the process of preprocessing data and generating standardized financial data sets specifically includes the following steps:

[0014] Based on the financial data of the companies obtained, the Jaccard similarity coefficient was used to determine the data repeatability and remove duplicate data;

[0015] Normalizing the financial data of the enterprise by using a normalization method; the normalization method includes a minimum-maximum normalization method and a Z-score normalization method;

[0016] Generate a standardized financial data set based on deduplicated and normalized financial data.

[0017] By removing duplicate data from the acquired financial data of enterprises, redundant information can be reduced and data processing efficiency can be improved; by normalizing the acquired financial data of enterprises, the differences between different data dimensions can be eliminated, so that each data feature can be analyzed on the same scale; by preprocessing the financial data of enterprises, the accuracy and consistency of the data can be guaranteed;

[0018] Furthermore, the process of constructing the generated standardized financial data set into a standardized financial data set with a graph structure specifically includes the following steps:

[0019] Take the normalized financial dataset as input matrix;

[0020] Based on the correlation of financial data, an adjacency matrix is ​​constructed; the adjacency matrix includes a first adjacency matrix constructed based on the transaction relationship between companies, a second adjacency matrix constructed based on the time series correlation, and a third adjacency matrix constructed based on the geographical location.

[0021] By constructing a graph structure representation for standardized financial data sets, we can better capture the intrinsic structure and relationships between financial data, thereby providing a basis for subsequent data processing and ensuring data quality and model stability during model training.

[0022] Furthermore, based on the standardized financial data set with graph structure, the vector quantized variational autoencoder is used for discretization encoding. The process of generating discrete token sequences specifically includes the following steps:

[0023] The vector quantized variational autoencoder is assumed to consist of a graph convolutional network and a long short-term memory network;

[0024] The input matrix and adjacency matrix are used as the input of the graph convolutional network. The multi-layer graph convolutional network is used to extract the structural information and local features of the financial data layer by layer, and the node feature matrix is ​​output.

[0025] The node feature matrix output by the graph convolutional network is used as the input of the long short-term memory network. The gating mechanism of the long short-term memory network is used to extract the time series features and long-term and short-term dependencies of the financial data, and the feature matrix is ​​output.

[0026] The feature matrix output by the long short-term memory network is used as the input of the quantizer for discretization to generate a discrete token sequence.

[0027] The graph convolutional network can be used to extract the structural and local features of financial data, and the long short-term memory network can be used to extract the temporal features and long-term and short-term dependencies of financial data. The quantizer is used to achieve discretization processing and generate a discrete token sequence to facilitate the subsequent adjustment of the large language model and ensure that the model can better understand and analyze financial data.

[0028] Furthermore, the discrete token sequence is composed of a codebook index; the codebook index process specifically includes the following steps:

[0029] Predefined codebook vectors; each codebook vector corresponds to a codebook index;

[0030] Each codebook vector is quantized and mapped to the closest codebook vector to generate a codebook index.

[0031] Furthermore, when generating a discrete token sequence, a decoder is used to decode the generated discrete token sequence so as to reconstruct the original input data. The process specifically includes the following steps:

[0032] The decoder is set to have the same structure as the encoder and to be used symmetrically with the encoder;

[0033] The generated discrete token sequence is used as the input of the long short-term memory network, and the decoded node feature matrix is ​​output;

[0034] The decoded node feature matrix is ​​used as the input of the graph convolutional network and the decoding result is output.

[0035] By symmetrically using a decoder with a similar structure to the encoder, efficient reconstruction of the original input financial data can be facilitated.

[0036] Furthermore, the discrete token sequence is used as the input of the original large language model, and the LoRA fine-tuning technology is used to fine-tune the model. The process of generating the optimal large language model specifically includes the following steps:

[0037] Divide the generated discrete token sequence into training set and validation set;

[0038] The training set is used as the input of the large language model after the LoRA fine-tuning technology, and forward propagation is performed to calculate the forward propagation output result, and the cross entropy loss is calculated; the large language model is a deep learning network model based on the self-attention mechanism and the feedforward neural network; the LoRA fine-tuning technology is to introduce low-rank matrix decomposition in the attention mechanism of the large language model, and decompose the weight matrix into a first low-rank matrix and a second low-rank matrix for adjusting the model weight;

[0039] The gradient descent back propagation algorithm is used to calculate the gradient of the loss function with respect to the first low-rank matrix and the second low-rank matrix, and the model parameters of the first low-rank matrix and the second low-rank matrix are iteratively updated based on the gradient descent back propagation algorithm to generate a fine-tuned large language model;

[0040] The validation set is used as the input of the fine-tuned large language model, and the cross-entropy loss function based on the validation set is calculated to verify and evaluate the model performance. The model parameters are iteratively optimized and adjusted based on the validation and evaluation results until the model performs optimally and an optimal large language model is generated.

[0041] By using LORA fine-tuning technology to fine-tune and optimize the large language model, the large language model is aligned on the semantic features of financial data information, enhancing the model's understanding and analysis capabilities of financial data, and thus obtaining the optimal large language model; and by training the model with a training set and optimizing the model with a validation set, the model's performance in financial data understanding and prediction tasks can be optimized, thereby being able to accurately capture the complex features in financial data and provide high-quality analysis results for the generation of financial analysis reports and decision support.

[0042] Furthermore, the original large language model and the optimal large language model are weighted and fused, and the process of generating a financial analysis report based on the new financial data specifically includes the following steps:

[0043] The first low-rank matrix and the second low-rank matrix in the optimal large language model are combined with the original large language model, and weighted combination is performed based on preset weights to obtain a fused model weight;

[0044] Based on the obtained fused model weights, the new financial data that has undergone data preprocessing is input into the optimal large language model to generate a financial analysis report.

[0045] By weighting the original large language model and the optimal large language model, the computational efficiency of the model can be improved and the storage space occupied can be reduced.

[0046] A system for generating a financial analysis report, comprising:

[0047] Data collection module, used to collect financial data;

[0048] A data processing module, used to generate standardized financial data sets and construct standardized financial data sets with graph structures;

[0049] The data encoding module is used to discretize the data using a vector quantized variational autoencoder to generate a discrete token sequence.

[0050] Model fine-tuning module, used to fine-tune the model using LoRA fine-tuning technology to generate the optimal large language model;

[0051] The model prediction module is used to perform weighted fusion on the original large language model and the optimal large language model, and generate a financial analysis report based on the new financial data.

[0052] The beneficial effects of the present invention are:

[0053] The present invention generates and constructs a standardized financial data set with a graph structure by preprocessing the acquired financial data of the enterprise, then uses a vector quantization variational autoencoder for discretization encoding to generate a discrete token sequence, and uses the LORA fine-tuning technology to fine-tune the original large language model to optimize the model parameters, and then generates a financial analysis report based on the new financial data; through weight fusion, the model calculation efficiency is improved, intelligent training is realized, and at the same time, the generation of automated and intelligent financial analysis reports is realized, thereby providing support for corporate financial decision-making. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 is a flow chart of the present invention;

[0055] Figure 2It is a structural schematic diagram of the system in the present invention;

[0056] Figure 3 It is a schematic diagram of the structure of the computer device in the present invention. DETAILED DESCRIPTION

[0057] 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.

[0058] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.

[0059] In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples, and a person of ordinary skill in the art can understand the specific meanings of the above terms in this application under specific circumstances.

[0060] Example 1

[0061] Figure 1 The method shown is a method for generating a financial analysis report. The obtained financial data of the enterprise is preprocessed to generate and construct a standardized financial data set with a graph structure, and then a vector quantized variational autoencoder is used for discretization encoding to generate a discrete token sequence. The original large language model is fine-tuned using the LORA fine-tuning technology to optimize the model parameters, and then a financial analysis report is generated based on the new financial data. The model calculation efficiency is improved through weight fusion, and intelligent training is realized. At the same time, the generation of automated and intelligent financial analysis reports is realized, thereby providing support for corporate financial decision-making. The specific steps include the following:

[0062] S1: Obtain the financial data of the enterprise, perform data preprocessing, and generate a standardized financial data set;

[0063] In this embodiment, the financial data of the enterprise includes income, expenditure, assets and liabilities, cash flow, transaction frequency, and transaction conditions.

[0064] In this embodiment, in order to ensure the accuracy and consistency of financial data, data preprocessing is performed to generate a standardized financial data set, and the process specifically includes the following steps:

[0065] S11: Based on the acquired financial data of the enterprise, the Jaccard similarity coefficient is used to determine the data duplication and remove duplicate data to reduce redundant information and improve data processing efficiency;

[0066] The expression of Jaccard similarity coefficient is:

[0067] ;

[0068] In the formula, Representing financial data and financial data similarity; Indicates Financial data; Indicates Financial data; , Indicates the sequence number of financial data. , , Indicates the total amount of financial data.

[0069] S12: Use normalization methods to normalize the financial data of the enterprise to eliminate the differences between the dimensions of different financial data values ​​so that each data feature can be analyzed on the same scale; normalization methods include minimum-maximum normalization method and Z-score normalization method;

[0070] The expression of the minimum-maximum normalization method is:

[0071] ;

[0072] In the formula, represents normalized data; Indicates the financial data with the smallest value; Indicates the financial data with the largest value;

[0073] The expression of Z-score normalization method is:

[0074] ;

[0075] In the formula, represents the mean of all financial data; Represents the standard deviation of financial data. By normalizing the acquired financial data of the enterprise, the differences between different data dimensions can be eliminated, so that each data feature can be analyzed on the same scale.

[0076] S13: Generate a standardized financial data set based on deduplicated and normalized financial data .

[0077] S2: Based on the characteristics and internal relationships of financial data, the generated standardized financial data set A standardized financial dataset constructed as a graph structure;

[0078] S21: Take a standardized financial dataset as input matrix , to characterize the feature vector of each financial data;

[0079] S211: Set the standardized financial data set to include financial data points, each of which includes Features

[0080] S212: Creation The input matrix ,Right now ; Input matrix Each element in Indicates The financial data eigenvalues;

[0081] S22: Based on the correlation relationship of the financial data, an adjacency matrix is ​​constructed to characterize the connection relationship between the financial data; the adjacency matrix includes a first adjacency matrix constructed based on the transaction relationship between companies, a second adjacency matrix constructed based on the time series correlation, and a third adjacency matrix constructed based on the geographical location;

[0082] Among them, the construction method of each element in the first adjacency matrix is:

[0083] ;

[0084] In the formula, Represents the companies in the adjacency matrix and Company The intersection node of Indicates companies; Indicates companies; , Indicates the company number;

[0085] Among them, the construction method of each element in the second adjacency matrix is:

[0086] ;

[0087] ;

[0088] In the formula, Represents the companies in the adjacency matrix and Company The intersection node of Indicates the company and Company Pearson correlation coefficient for financial data; represents a preset correlation threshold; Indicates the company and Company Covariance of financial data; Indicates the company The standard deviation of financial data; Indicates the company The standard deviation of financial data;

[0089] Among them, the construction method of each element in the third adjacency matrix is:

[0090] ;

[0091] In the formula, Represents the companies in the adjacency matrix and Company The intersection node.

[0092] S3: A standardized financial dataset based on a graph structure is discretized using a vector quantized variational autoencoder (VQVAE) to generate a discrete token sequence.

[0093] S31: Set the vector quantized variational autoencoder VQVAE to consist of a graph convolutional network and a long short-term memory network;

[0094] S32: Input matrix and the adjacency matrix As the input of the graph convolutional network, a multi-layer graph convolutional network is used to extract the structural information and local features of financial data layer by layer, and output the node feature matrix ;

[0095] Among them, the operation expression of the graph convolutional network is:

[0096] ;

[0097] In the formula, Indicates The node feature matrix of the layer; Indicates The node feature matrix of the layer; represents the activation function; represents the adjacency matrix; Indicates The weight matrix of the layer;

[0098] S33: Output the node feature matrix of the graph convolutional network As the input of the long short-term memory network, the gating mechanism of the long short-term memory network is used to extract the time series characteristics and long-term and short-term dependencies of the financial data, and the feature matrix is ​​output. ;

[0099] Among them, the expression of long short-term memory network is:

[0100] ;

[0101] In the formula, The feature matrix representing the output of the LSTM network; Represents the long short-term memory network model; Represents the node feature matrix output by the graph convolutional network;

[0102] S34: The feature matrix output by the long short-term memory network As the input of the VQVAE quantizer, it is continuously discretized to generate a discrete token sequence;

[0103] Among them, the expression of VQVAE quantizer is:

[0104] ;

[0105] In the formula, Represents a discretized representation, i.e. a discrete token sequence; Represents a quantization function.

[0106] In this embodiment, during the quantization process, the discrete token sequence is composed of codebook indexes; the codebook indexing process specifically includes the following steps:

[0107] S341: Predefined codebook vector ; Each codebook vector Corresponding to a codebook index ;

[0108] S342: For each codebook vector Quantize and map it to the closest codebook vector , generate codebook index ;

[0109] The mapping process is expressed as:

[0110] ;

[0111] In the formula, Indicates Codebook index; Indicates The eigenvector of the feature matrix output by the LSTM network; represents a predefined codebook vector; Indicates the value of the independent variable that makes the function reach the minimum value.

[0112] In this embodiment, when generating a discrete token sequence, in order to ensure that the quantized discrete token sequence It can effectively reconstruct the original input, including using the decoder to generate discrete token sequences Decoding is performed, and the operation process specifically includes the following steps:

[0113] S351: Set the decoder to have the same structure as the encoder and to be used symmetrically with the encoder;

[0114] S352: Generate the generated discrete token sequence As the input of the long short-term memory network, the decoded node feature matrix is ​​output ;

[0115] Among them, the decoded node feature matrix The expression is:

[0116] ;

[0117] In the formula, Represents the decoded node feature matrix;

[0118] S353: decoded node feature matrix As the input of the graph convolutional network, the decoding result is output ;

[0119] Among them, the decoding result The expression is:

[0120] ;

[0121] In the formula, Indicates the decoding result; represents the weight matrix.

[0122] S4: Discrete token sequence As the input of the original large language model, the LoRA fine-tuning technology is used to fine-tune the model to generate the optimal large language model , so that the large language model can be aligned on the semantic features of financial data information, enhancing the model's ability to understand and analyze financial data;

[0123] S41: Generate the generated discrete token sequence Divide into training set and validation set;

[0124] S42: Use the training set as the input of the large language model after LoRA fine-tuning technology, perform forward propagation to calculate the forward propagation output, and calculate the cross entropy loss to measure the difference between the model output and the true label;

[0125] Specifically, the large language model is a deep learning network model based on the self-attention mechanism and feedforward neural network. The large language model includes multiple Transformer layers, each of which is composed of a multi-head self-attention mechanism and a feedforward neural network. The network structure model of each layer is:

[0126] ;

[0127] In the formula, Indicates The output of the layer; Indicates The output of the layer; represents the normalization function; Indicates Model parameters of the layer;

[0128] Specifically, the LoRA fine-tuning technique introduces low-rank matrix decomposition into the attention mechanism of the large language model, decomposing the weight matrix into the first low-rank matrix and the second low-rank matrix , used to adjust the model weights;

[0129] Among them, the weight matrix decomposition is expressed as:

[0130] ;

[0131] In the formula, Represents the weight matrix in the attention mechanism; represents the first low-rank matrix, ; represents the second low-rank matrix, ; Represents the dimension of the original weight matrix; represents the rank of the first low-rank matrix or the second low-rank matrix; represents transpose;

[0132] Among them, the expression of the forward propagation output result is:

[0133] ;

[0134] In the formula, Represents the forward propagation output result; Represents the forward propagation algorithm of the large language model after fine-tuning by LORA;

[0135] Among them, the expression of the cross entropy loss function is:

[0136] ;

[0137] In the formula, represents the cross entropy loss function; Indicates The true labels of financial data; Indicates The forward propagation output results of financial data;

[0138] S43: Use the gradient descent back propagation algorithm to calculate the loss function for the first low-rank matrix and the second low-rank matrix The gradient of , and iteratively update the first low-rank matrix based on the gradient descent back propagation algorithm and the second low-rank matrix Model parameters of the model are used to generate a fine-tuned large language model;

[0139] Among them, the loss function is the first low-rank matrix and the second low-rank matrix The expression of the gradient is:

[0140] ;

[0141] ;

[0142] In the formula, represents partial derivative;

[0143] Among them, the first low-rank matrix is ​​iteratively updated based on the gradient descent back propagation algorithm and the second low-rank matrix The update rule of the model parameters is:

[0144] ;

[0145] ;

[0146] In the formula, represents the learning rate;

[0147] S44: Use the validation set as the input of the fine-tuned large language model, calculate the cross entropy loss function based on the validation set to perform model performance verification and evaluation, and iteratively optimize and adjust the model parameters based on the validation and evaluation results until the model performs optimally in the financial data understanding and prediction tasks, generating the optimal large language model , in order to accurately capture the complex characteristics of financial data and provide high-quality analysis results for financial report generation and decision support.

[0148] In this embodiment, if the cross entropy loss function value obtained by the validation set decreases, it means that the performance of the large language model after optimization in the current iteration round is improved compared with that in the previous iteration round; anyway, if the cross entropy loss function value obtained by the validation set no longer decreases or shows signs of overfitting, it is necessary to adjust the learning rate or adopt an early stopping strategy to avoid overfitting of the large language model.

[0149] S5: Perform weight fusion on the original large language model and the optimal large language model, and generate a financial analysis report based on the new financial data.

[0150] S51: The first low-rank matrix in the optimal large language model and the second low-rank matrix , combined with the original large language model, weighted combination based on preset weights to obtain the fused model weight ;

[0151] Among them, the fused model weight expression is:

[0152] ;

[0153] In the formula, represents the weight of the fused model, Represents the fusion coefficient, which is used to control the weight ratio of the optimal large language model and the original large language model; Represents the model parameters of the original large language model; Represents the first low-rank matrix in the optimal large language model; represents the second lowest rank matrix in the optimal large language model;

[0154] S52: Based on the obtained fused model weight , input the new financial data after data preprocessing into the optimal large language model to generate a financial analysis report;

[0155] S521: Preprocess the new financial data and generate a new discrete token sequence through a vector quantized variational autoencoder ;

[0156] S522: Based on the obtained fused model weight , the obtained new discrete token sequence As the input of the optimal large language model, perform forward propagation and calculate the output forward propagation prediction result , generate financial analysis reports;

[0157] The expression of the prediction result is:

[0158] ;

[0159] In the formula, Represents the forward propagation forecast results based on new financial data, including trend analysis, risk assessment, and decision-making recommendations of financial data; Represents a new discrete token sequence based on new financial data.

[0160] Example 2

[0161] Based on the same design concept, Figure 2 As shown, this embodiment provides a system for a financial analysis report generation method, including a data acquisition module, a data processing module, a data encoding module, a model fine-tuning module, and a model prediction module.

[0162] Specifically, the data collection module is used to collect financial data;

[0163] Specifically, the data processing module is used to generate a standardized financial data set and construct a standardized financial data set with a graph structure;

[0164] Specifically, the data encoding module is used to perform discretization encoding using a vector quantization variational autoencoder to generate a discrete token sequence;

[0165] Specifically, the model fine-tuning module is used to fine-tune the model using LoRA fine-tuning technology to generate the optimal large language model;

[0166] Specifically, the model prediction module is used to perform weighted fusion on the original large language model and the optimal large language model, and generate a financial analysis report based on the new financial data.

[0167] Example 3

[0168] Based on the same technical concept, the embodiment of the present application also provides a computer device, including a memory 1 and a processor 2, such as Figure 3 As shown, the memory 1 stores a computer program, and the processor 2 implements any of the above-mentioned methods when executing the computer program.

[0169] Among them, the memory 1 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 1 can be an internal storage unit of the financial analysis report generation system, such as a hard disk. In other embodiments, the memory 1 can also be an external storage device of the financial analysis report generation system, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 1 can also include both an internal storage unit of the financial analysis report generation system and an external storage device. The memory 1 can not only be used to store application software and various types of data installed in the financial analysis report generation system, such as the code of the financial analysis report generation system program, etc., but also can be used to temporarily store data that has been output or is to be output.

[0170] In some embodiments, the processor 2 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, and is used to run program codes or process data stored in the memory 1, such as executing a financial analysis report generation system program.

[0171] The disclosed embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to perform the steps of the method described in the above method embodiment. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0172] The computer program product of the application page content refresh method provided in the disclosed embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0173] The disclosed embodiment of the present invention further provides a computer program, which implements any one of the methods of the aforementioned embodiments when executed by a processor. The computer program product can be implemented in hardware, software, or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium, and in another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0174] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0175] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0176] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0177] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0178] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0179] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0180] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0181] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0182] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for generating a financial analysis report, characterized in that: The steps include: Obtain the company's financial data, perform data preprocessing, and generate standardized financial data sets; Constructing the generated standardized financial data set into a standardized financial data set with a graph structure; Based on the standardized financial data set with graph structure, vector quantization variational autoencoder is used for discretization encoding to generate discrete token sequence; The discrete token sequence is used as the input of the original large language model, and the LoRA fine-tuning technology is used to fine-tune the model to generate the optimal large language model; Perform weighted fusion on the original large language model and the optimal large language model, and generate a financial analysis report based on the new financial data; The discrete token sequence is used as the input of the original large language model, and the LoRA fine-tuning technology is used to fine-tune the model. The process of generating the optimal large language model specifically includes the following steps: Divide the generated discrete token sequence into training set and validation set; Use the training set as the input of the large language model after LoRA fine-tuning technology, perform forward propagation to calculate the forward propagation output results, and calculate the cross entropy loss; The large language model is a deep learning network model based on a self-attention mechanism and a feedforward neural network; the LoRA fine-tuning technology introduces low-rank matrix decomposition into the attention mechanism of the large language model, decomposing the weight matrix into a first low-rank matrix and a second low-rank matrix for adjusting the model weight; The gradient descent back propagation algorithm is used to calculate the gradient of the loss function with respect to the first low-rank matrix and the second low-rank matrix, and the model parameters of the first low-rank matrix and the second low-rank matrix are iteratively updated based on the gradient descent back propagation algorithm to generate a fine-tuned large language model; The validation set is used as the input of the fine-tuned large language model, and the cross entropy loss function based on the validation set is calculated to evaluate the model performance. The model parameters are iteratively optimized based on the validation evaluation results until the model performs optimally and the optimal large language model is generated. The process of weighting and fusing the original large language model and the optimal large language model to generate a financial analysis report based on the new financial data includes the following steps: The first low-rank matrix and the second low-rank matrix in the optimal large language model are combined with the original large language model, and weighted combination is performed based on preset weights to obtain a fused model weight; Based on the obtained fused model weights, the new financial data that has undergone data preprocessing is input into the optimal large language model to generate a financial analysis report.

2. A method for generating a financial analysis report according to claim 1, characterized in that: A company's financial data includes revenue, expenditure, assets and liabilities, cash flow, transaction frequency, and transaction conditions.

3. A method for generating a financial analysis report according to claim 1, characterized in that: The process of data preprocessing and generating standardized financial data sets includes the following steps: Based on the financial data of the companies obtained, the Jaccard similarity coefficient was used to determine the data repeatability and remove duplicate data; Normalizing the financial data of the enterprise by using a normalization method; the normalization method includes a minimum-maximum normalization method and a Z-score normalization method; Generate a standardized financial data set based on deduplicated and normalized financial data.

4. A method for generating a financial analysis report according to claim 1, characterized in that: The process of constructing the generated standardized financial data set into a standardized financial data set with a graph structure specifically includes the following steps: Take the normalized financial dataset as input matrix; Based on the correlation of financial data, an adjacency matrix is ​​constructed; the adjacency matrix includes a first adjacency matrix constructed based on the transaction relationship between companies, a second adjacency matrix constructed based on the time series correlation, and a third adjacency matrix constructed based on the geographical location.

5. A method for generating a financial analysis report according to claim 1, characterized in that: Based on the standardized financial data set with graph structure, the vector quantized variational autoencoder is used for discretization encoding. The process of generating discrete token sequences includes the following steps: The vector quantized variational autoencoder is assumed to consist of a graph convolutional network and a long short-term memory network; The input matrix and adjacency matrix are used as the input of the graph convolutional network. The multi-layer graph convolutional network is used to extract the structural information and local features of the financial data layer by layer, and the node feature matrix is ​​output. The node feature matrix output by the graph convolutional network is used as the input of the long short-term memory network. The gating mechanism of the long short-term memory network is used to extract the time series features and long-term and short-term dependencies of the financial data, and the feature matrix is ​​output. The feature matrix output by the long short-term memory network is used as the input of the quantizer for discretization to generate a discrete token sequence.

6. A method for generating a financial analysis report according to claim 5, characterized in that: The discrete token sequence is composed of a codebook index; the codebook index process specifically includes the following steps: Predefined codebook vectors; each codebook vector corresponds to a codebook index; Each codebook vector is quantized and mapped to the closest codebook vector to generate a codebook index.

7. A method for generating a financial analysis report according to claim 5, characterized in that: When generating a discrete token sequence, a decoder is also used to decode the generated discrete token sequence to reconstruct the original input data. The process specifically includes the following steps: The decoder is set to have the same structure as the encoder and to be used symmetrically with the encoder; The generated discrete token sequence is used as the input of the long short-term memory network, and the decoded node feature matrix is ​​output; The decoded node feature matrix is ​​used as the input of the graph convolutional network and the decoding result is output.

8. A system for the financial analysis report generation method according to claim 1, characterized in that: include: Data collection module, used to collect financial data; A data processing module, used to generate standardized financial data sets and construct standardized financial data sets with graph structures; The data encoding module is used to discretize the data using a vector quantized variational autoencoder to generate a discrete token sequence. Model fine-tuning module, used to fine-tune the model using LoRA fine-tuning technology to generate the optimal large language model; The model prediction module is used to perform weighted fusion on the original large language model and the optimal large language model, and generate a financial analysis report based on the new financial data.

Citation Information

Patent Citations

  • Learning situation report generation method and system based on large language model

    CN118428348A

  • Report generation method and device, storage medium and electronic equipment

    CN118586389A