Financial attribution generation method and device, equipment and medium
By constructing a knowledge graph of financial indicators and a neural network model, the problem of low accuracy in financial attribution analysis was solved, and efficient and accurate financial cause analysis was achieved.
Patent Information
- Application Number
- CN202511643405.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-02-06
AI Technical Summary
Existing technologies lack systematic methods for financial cost attribution analysis, resulting in inaccurate or incomplete analysis results that fail to provide valuable insights.
Construct a knowledge graph of financial indicators, determine the relationships and weights between various indicators, obtain related indicators through question text, trim subgraphs of the knowledge graph, and generate financial attribution reports using a neural network model.
It improves the accuracy of financial attribution results, enables in-depth analysis of complex relationships in the data, and generates well-organized and well-supported financial attribution reports.
Smart Images

Figure CN121481689A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a financial attribution generation method, apparatus, device, and medium. Background Technology
[0002] In the financial field, cost attribution analysis is a method that analyzes financial data to identify the underlying causes of cost changes. It breaks down costs according to different dimensions (such as expense type, business segment, region, etc.) and uses data mining and logical reasoning to determine the specific factors leading to cost increases or decreases. Current technology generally relies on financial analysts manually extracting data, judging the correlation of indicators, and performing attribution reasoning. It lacks a systematic approach to comprehensively and accurately discover and identify these complex relationships hidden within the vast system of financial data. Analysts often rely on limited experience or pre-set rules, easily overlooking key influencing factors or incorrectly associating irrelevant indicators. This directly leads to inaccurate (erroneous associations) or incomplete (omission of key factors) attribution analysis results, failing to provide truly valuable insights. Therefore, improving the accuracy of financial causal analysis is a pressing issue that needs to be addressed. Summary of the Invention
[0003] In view of this, embodiments of this application provide a financial attribution generation method, apparatus, device, and medium to solve the problem of low accuracy in financial cause analysis during the financial cause analysis process.
[0004] In a first aspect, embodiments of this application provide a financial attribution generation method, the financial attribution generation method comprising: A financial indicator knowledge graph is defined, wherein the nodes in the financial indicator knowledge graph are various indicators of various dimensions in a preset financial system, and the edges in the financial indicator knowledge graph include the relationship type between various indicators and the weight value of the corresponding relationship, wherein the weight value represents the relationship strength of the corresponding relationship. Obtain the question text corresponding to the financial question; extract the indicators associated with the question text based on the question text and the financial indicator knowledge graph to obtain the associated indicators; prune the associated indicators based on the weight values of the relationship between the associated indicators and the corresponding associated indicators to determine the knowledge graph subgraphs. Based on the knowledge graph subgraph, a query is performed in a preset Hive table to determine the query result corresponding to the financial question; The query results are processed using a pre-defined neural network model to generate a financial attribution report.
[0005] Secondly, embodiments of this application provide a financial attribution generation apparatus, the financial attribution generation apparatus comprising: The determination module is used to determine the financial indicator knowledge graph. The nodes in the financial indicator knowledge graph are the indicators of each dimension in the preset financial system. The edges in the financial indicator knowledge graph include the relationship type between each indicator and the weight value of the corresponding relationship. The weight value represents the relationship strength of the corresponding relationship. The extraction module is used to obtain the question text corresponding to the financial question, and extract the indicators associated with the question text based on the question text and the financial indicator knowledge graph to obtain a knowledge graph subgraph. The query module is used to perform queries in a preset Hive table based on the knowledge graph subgraph to determine the query results corresponding to the financial question. The processing module is used to process the query results using a preset neural network model to generate a financial attribution report.
[0006] Thirdly, embodiments of this application provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the financial attribution generation method as described above.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the financial attribution generation method as described above.
[0008] The advantages of this application compared to the prior art are: In this application, a financial indicator knowledge graph is defined. The edges in the financial indicator knowledge graph include the relationship types between various indicators and the weight values of the corresponding relationships. The strength of the relationships between indicators is quantified to improve the accuracy of financial attribution results. Indicators associated with the query text are extracted, and subgraphs of the knowledge graph are defined to facilitate the determination of query results corresponding to financial queries based on the indicators in the knowledge graph. A pre-set neural network model is used to process the query results and generate a financial attribution report. The neural network model can deeply analyze the complex relationships in the data and improve the accuracy of query result processing. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1This is a schematic diagram of the application environment of a financial attribution generation method provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a financial attribution generation method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a financial attribution generation device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a computer device provided in one embodiment of this application. Detailed Implementation
[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0012] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0013] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0014] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0015] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0016] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0017] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0018] The embodiments of this invention can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0019] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0020] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0021] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0022] An embodiment of the present invention provides a financial attribution generation method, which can be applied to, for example... Figure 1In this application environment, the client communicates with the server. The client includes, but is not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be a standalone server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0023] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0024] See Figure 2 This is a flowchart illustrating a financial attribution generation method according to an embodiment of the present invention, as shown below. Figure 2 As shown, the financial attribution generation method may include the following steps.
[0025] S201: Determine the financial indicator knowledge graph. The nodes in the financial indicator knowledge graph are the indicators of each dimension in the pre-set financial system. The edges in the financial indicator knowledge graph include the relationship type between each indicator and the weight value of the corresponding relationship. The weight value represents the relationship strength of the corresponding relationship.
[0026] In step S201, a financial indicator knowledge graph is determined. The nodes in the financial indicator knowledge graph are the indicators of each dimension in the preset financial system. The edges in the financial indicator knowledge graph include the relationship type between each indicator and the weight value of the corresponding relationship. The preset financial system is a six-part financial cost system. Each type is a different dimension in the six-part financial cost system. The indicators are financial-related indicators under the corresponding dimension. The weight value represents the relationship strength of the corresponding relationship, that is, the degree of correlation.
[0027] In this embodiment, the indicators in the financial indicator knowledge graph are relevant indicators in the financial system, such as those in the auto insurance system. Based on the six-part cost system of finance, the subdivision method for each dimension is determined. For example, the six-part cost system of finance includes six dimensions: strategic cost, operating cost, fixed cost, variable cost, controllable cost, and uncontrollable cost. Each dimension is further subdivided according to specific scenarios. Operating cost is subdivided into product dimensions, such as primary categories and secondary categories. Primary categories correspond to indicators such as auto insurance, non-auto insurance, group non-auto insurance, and individual non-auto insurance. Secondary categories correspond to indicators such as personal accident insurance, personal health insurance, and agricultural insurance. Fixed cost is subdivided into the organizational dimension, with corresponding indicators such as head office, secondary branches, and tertiary branches. Variable cost is refined into the expense dimension, with corresponding indicators such as sales expenses, administrative expenses, and claims costs. Controllable cost is refined into the time dimension, with corresponding indicators such as annual, quarterly, and monthly granularity. Each indicator is then identified as a node in the financial indicator knowledge graph. Determine the relationships, types, and weights among the various indicators. If one indicator influences another, a relationship is considered to exist. For example, if "auto insurance premium income" influences "auto insurance claims payouts," then there is a relationship between the two indicators. The type of relationship is determined based on the type of each indicator. For instance, if the related indicators are agricultural insurance and group non-auto insurance, and agricultural insurance is a subcategory of group non-auto insurance, then the relationship between agricultural insurance and group non-auto insurance is a hierarchical relationship. If the related indicators are the Guangdong branch and the South China region, then the relationship between the Guangdong branch and the South China region is a subordinate relationship. If the related indicators are advertising investment and sales expenses, and advertising investment influences sales expenses, then the relationship between advertising investment and sales expenses is an influence relationship. The weight of each relationship is determined based on its strength, with weight values ranging from 0 to 1.
[0028] It should be noted that when determining the strength of corresponding relationships, historical data analysis or expert experience can be used. For example, if there is a relationship between the "auto insurance premium income" indicator and the "auto insurance claims expenditure" indicator, and the auto insurance premium income has a significant impact on auto insurance claims expenditure, the weight value of the corresponding edge can be determined to be a larger value, such as 0.8. Conversely, if "office utility fees" indirectly affect "auto insurance claims expenditure," but the impact of office utility fees on auto insurance claims expenditure is relatively small, the weight value of the corresponding edge can be determined to be a smaller value, such as 0.1.
[0029] In this embodiment, each indicator in each dimension of the preset financial system is taken as the corresponding node set. Based on the relationship between each node, the corresponding edge set is determined. Based on the node set and edge set, the corresponding financial indicator knowledge graph is constructed. Based on the corresponding relationship strength, different weight values are set for each edge. This upgrades the knowledge graph from a static relationship network to a dynamic quantitative model, providing the "relationship strength" dimension for intelligent retrieval and reasoning. It solves the problem of not being able to quantify the influence strength between indicators and is the basis for accurate attribution.
[0030] S202: Obtain the question text corresponding to the financial question; extract the indicators associated with the question text based on the question text and the financial indicator knowledge graph to obtain the associated indicators; prune the associated indicators based on the weight values of the relationship between the associated indicators and the corresponding associated indicators to determine the subgraph of the knowledge graph. In step S202, the question text is the user's question text about financial issues. The question text includes different indicators with different guiding words. The indicators associated with the question text are the indicators that appear in the question text in the financial indicator knowledge graph and the indicators that have a relationship with the corresponding indicators. The knowledge graph subgraph is a graph composed of the indicators associated with the question text and the relationships between the indicators. The knowledge graph subgraph is a part of the financial indicator knowledge graph.
[0031] In this embodiment, the question text corresponding to the financial question is obtained. The question text can be text in different expressions, such as formal, colloquial, or text containing aliases / abbreviations. The question text includes guiding words such as "why", "reason", "analysis", "change", "rise", "fall" and different indicator granularities such as "auto insurance", "Guangdong branch", "sales expenses", "January expense ratio" and other indicators.
[0032] The process involves identifying keywords in the query text, including corresponding lead words and indicators at different granularities. Based on these keywords, the process searches the financial indicator knowledge graph for indicators that match the keywords, identifying matching indicators. Then, it identifies related indicators within the financial indicator knowledge graph that have a relationship with the matching indicators. These related indicators are multi-step related indicators; for example, indicator 1 is related to indicator 2, and indicator 2 is related to indicator 3. If indicators with a relationship within 5 steps are identified as related indicators, then indicator 3 is a related indicator of indicator 1. Based on the weight values of the relationships between the related indicators and their corresponding related indicators, the related indicators are pruned to determine the knowledge graph subgraph. Specifically, an initial knowledge graph subgraph consisting of all related indicators and their corresponding relationships is first determined based on the related indicators. Then, the initial knowledge graph subgraph is pruned based on the weight values of each edge in the initial knowledge graph subgraph to obtain the final knowledge graph subgraph. In this embodiment, when pruning the initial knowledge graph subgraph based on the weight value of each edge, edges with weight values less than a preset weight threshold can be pruned, or other methods can be used for pruning. This embodiment does not limit the specific methods.
[0033] In this embodiment, indicators associated with the question text are extracted based on the knowledge graph of financial indicators to obtain a knowledge graph subgraph, so as to determine the query results corresponding to the financial question based on the indicators in the knowledge graph subgraph.
[0034] Optionally, based on the question text and the financial indicator knowledge graph, indicators associated with the question text are extracted to obtain associated indicators, including: The question text is identified using a pre-defined entity recognition model to determine the initial indicators corresponding to the question text. Obtain a preset number of steps, and based on the preset number of steps, search for related indicators associated with the initial indicator in the financial indicator knowledge graph.
[0035] In this embodiment, a preset entity recognition model is used to perform entity recognition on the query text to determine the initial indicators corresponding to the entities. The preset entity recognition model can be a fine-tuned Qwen2-72b model or other models; this embodiment is not limited to any particular model. The initial indicators are the matching indicators that correspond to the entities in the query text. For example, if the query text is "Why did the sales expenses of the Guangdong branch increase by 15% year-on-year in December 2024?", the preset entity recognition model is used to perform entity recognition on the query text, obtaining the corresponding entity recognition results such as "why", "Guangdong branch", "December 2024", "sales expenses", and "increase". Based on the corresponding entity recognition results, initial indicators matching the corresponding entity recognition results are determined in the financial indicator knowledge graph, such as "Guangdong branch", "December 2024", and "sales expenses".
[0036] Obtain a preset number of steps, which represents the search range, i.e., the search range when searching with the initial indicator as the origin node. Based on the preset number of steps and the initial indicator, search for related indicators associated with the initial indicator in the financial indicator knowledge graph. That is, search with the initial indicator as the origin node and the preset number of steps as the search range. For example, if the initial indicator is "loss rate" and the preset number of steps is three, then use "loss rate" as the origin and search for indicators corresponding to nodes within three steps as related indicators.
[0037] It should be noted that the preset entity recognition model is a finely tuned Qwen2 model. The training process of the Qwen2 model is as follows: Obtain sample question texts and an initial Qwen2 model. Label the entities and their corresponding types in the sample question texts to obtain entity labels. Fine-tune the initial Qwen2 model using the corresponding sample question texts and entity labels to obtain a fine-tuned Qwen2 model. During fine-tuning, the LoRA (Low Rank Adaptation) method can be used. LoRA adapts the initial Qwen2 model to a specific task by adding low-rank matrices to specific layers of the model, efficiently adjusting model parameters while maintaining the model's generalization ability. Train this model into a professional financial indicator Named Entity Recognition (NER) model.
[0038] In this embodiment, entity recognition is performed on the question text according to a preset entity recognition model to quickly identify the corresponding entity. Based on a preset number of steps, related indicators associated with the initial indicator are searched in the financial indicator knowledge graph to prevent data redundancy when the search range is too large.
[0039] Optionally, based on the weight values of the relationships between the related indicators and their corresponding related indicators, the related indicators are pruned to determine the knowledge graph subgraphs, including: Based on the preset business rules, the weight value of each relationship is adjusted to obtain the target weight value of each relationship; Based on the target weight value, the associated indicators are pruned to obtain the pruned associated indicators.
[0040] In this embodiment, the weight value of each relationship is adjusted according to preset business rules to obtain the target weight value of each relationship. For example, the preset business rule is that the weight of relationships across business segments (such as from car insurance to health insurance) is reduced by 50%. Based on the target weight value, the related indicators are pruned. For example, based on the magnitude of the target weight value, when the target weight value is less than a preset threshold, the corresponding edges in the graph composed of the related indicators are pruned to obtain the corresponding knowledge graph subgraph.
[0041] In this embodiment, the weight value of each edge in the financial indicator knowledge graph is dynamically adjusted to filter irrelevant indicators, ensuring that the indicators of the output knowledge graph subgraph are both comprehensive and highly relevant, which greatly improves retrieval efficiency and accuracy.
[0042] S203: Based on the knowledge graph subgraph, perform a query in the preset Hive table to determine the query results corresponding to the financial question.
[0043] In step S203, the preset Hive table is a storage table corresponding to the preset financial system, that is, a storage table for each piece of data in the preset financial system, and the query result is data used to answer financial questions.
[0044] In this embodiment, based on the various indicators in the knowledge graph subgraph, the corresponding data for each indicator in the knowledge graph subgraph is searched in a preset Hive table. For example, the query result for the indicator "loss rate" is 5%, and the query result for the indicator "auto insurance claim payment" is 50,000 yuan.
[0045] It should be noted that, based on the knowledge graph subgraph, queries are performed in the preset Hive tables to determine the corresponding query results for the financial questions. The corresponding query results are in the form of a corresponding table.
[0046] In this embodiment, a query is performed in a preset Hive table based on the knowledge graph subgraph to determine the query results corresponding to the financial question, so as to conduct analysis based on the corresponding query results and generate a financial attribution report.
[0047] Optionally, based on the knowledge graph subgraph, queries are performed in a pre-defined Hive table to determine the query results corresponding to the financial question, including: Determine the table structure information of the Hive table; A pre-defined large language model is used to process the table structure information and knowledge graph subgraphs to determine the target query statement; Based on the target query statement, query the Hive table to determine the query results corresponding to the financial question.
[0048] In this embodiment, the table structure information of the Hive table is determined. This information includes the table name, field names, field types, partition fields, and relationships between tables (such as JOIN conditions). After determining the table structure information, it is processed to determine its structured form, resulting in structured data, such as in JSON or JavaScript Object Notation format, to facilitate recognition by large language models.
[0049] A pre-defined large language model is used to process the table structure information and knowledge graph subgraphs to determine the target query statement. The structured data corresponding to the structured form of the table structure information and the knowledge graph subgraphs are input into the pre-defined large language model, and the target query statement is output. The pre-defined large language model can be the qwen3 model or other large language models; this embodiment does not limit it. The target query statement is an SQL statement.
[0050] It should be noted that the preset large language model is a pre-trained model, and the training process of the preset large language model includes: The process involves obtaining sample training data and its corresponding labels, as well as an initial large language model. The sample training data includes multiple sets of sample knowledge graph subgraphs and the table structure information of the corresponding sample Hive tables. The table structure information of the sample Hive tables is then processed to obtain structured sample data. The labels corresponding to the sample training data are query statement labels, and each query statement label corresponds one-to-one with the table structure information of the sample Hive tables corresponding to the sample knowledge graph subgraphs. Supervised training of the initial large language model is then performed based on the sample training data and its corresponding labels to obtain the trained model, i.e., the pre-defined large language model.
[0051] After determining the target query statement, the Hive table is queried according to the target query statement to determine the query results corresponding to the financial question. The query results are in the form of a corresponding table.
[0052] In this embodiment, a large language model is used to understand table structure metadata, enabling intelligent mapping from metric names to database fields and JOIN conditions. This feature allows business analysts to extract data automatically simply by asking questions in natural language, without needing to master SQL programming or complex table structures. This lowers the technical barrier and improves the efficiency of data-driven analysis.
[0053] Optionally, a pre-defined large language model is used to process the table structure information and knowledge graph subgraph to determine the target query statement, including: Obtain the preset first prompt template, fill the first prompt template according to the table structure information and knowledge graph subgraph, and obtain the first input data; Input the first input data into the preset large language model and output the target query statement.
[0054] In this embodiment, the preset first prompt template is the corresponding prompt template, used to guide the large language model to generate a query statement that meets business requirements. The first prompt template is filled based on the table structure information and the knowledge graph subgraph to obtain the first input data. This first input data is then input into the preset large language model, and the target query statement is output. The format of the first prompt template may include the table structure information, the portion of the knowledge graph subgraph to be filled, and the output requirements of the query statement, etc.
[0055] In this embodiment, the corresponding prompt template is used to guide the large language model to generate query statements that meet business requirements. The prompt template helps the model clarify the boundary between "core objectives" and "additional requirements". The final generated query statement is not only grammatically correct, but also accurately matches the graph logic and user needs. It can be executed directly in the query engine without secondary modification.
[0056] S204: The query results are processed using a pre-defined neural network model to generate a financial attribution report.
[0057] In step S204, the neural network model is an artificial intelligence model. The query results are processed using a preset neural network model to generate a financial attribution report. The financial attribution report is a clear and well-supported natural language attribution result.
[0058] In this embodiment, the preset neural network model is a pre-trained model, such as the pre-trained Wen2 model, but other models can also be used; this embodiment is not limited to any particular model. The query results are input into the preset neural network model, and a financial attribution report is output.
[0059] In this embodiment, a preset neural network model is used to process the query results. The neural network model can deeply analyze the complex relationships in the data and improve the accuracy of the query results processing.
[0060] Optionally, a pre-defined neural network model is used to process the query results to generate a financial attribution report, including: Obtain the preset second prompt template, and fill in the second prompt template according to the question text, query results and preset reasoning requirements to obtain the second input data; The second input data is fed into a preset neural network model, which outputs a financial attribution report.
[0061] In this embodiment, the preset second prompt template is the corresponding prompt template, used to guide the preset neural network model to output the corresponding financial attribution report. The second prompt template may include a question text, query results, and preset inference requirements. The question text is a corresponding financial question, such as "Why did the sales expenses of the Guangdong branch increase by 15% year-on-year in December 2024?". The query results are inserted in the form of a structured list or natural language description, for example: "Relevant indicators include: total sales expenses of the Guangdong branch, sales expenses of its subordinate third-level institutions, advertising expenditure, number of marketing activities, and premium income during the same period, etc." The preset inference requirements instruct the neural network model to analyze step by step, requiring it to first describe the overall change, then analyze the changes and contributions of key driving indicators item by item, and finally summarize and generalize.
[0062] It should be noted that the second prompt template may also include system role settings, such as explicitly informing the model that its role is a "professional financial cost analysis expert". The second prompt template may also include other content, which is not limited in this embodiment.
[0063] It should be noted that when filling the second suggestion template based on the query results, the query results should be filled in the form of a structured list or a natural language description.
[0064] Based on the blanks in the second prompt template, the query text, query results, and preset inference requirements are filled into the corresponding parts to obtain the second input data. This second input data is then fed into a preset neural network model to output a financial attribution report. The financial attribution report is a well-organized and well-supported natural language attribution result.
[0065] In this embodiment, the neural network model performs analysis and processing based on the second prompt template. It can help the model understand user needs more accurately based on clear task instructions and contextual information, thereby generating more relevant and accurate output.
[0066] Optionally, the fine-tuning process of the preset neural network model includes: Obtain the initial neural network model, sample input data, and corresponding label reports. The sample input data consists of the sample question text, sample query results, and sample reasoning requirements filled in the sample prompt template. The initial neural network model is fine-tuned based on the sample input data and the corresponding label report to obtain the preset neural network model.
[0067] In this embodiment, an initial neural network model, sample input data, and a corresponding label report are obtained. The initial neural network model can be a Qwen2 model. The sample input data consists of sample question text, sample query results, and sample reasoning requirements filled into the sample prompt template. The sample question text is related to financial inquiries. The sample query results are obtained by querying the Hive table corresponding to the sample knowledge graph subgraph. The sample knowledge graph subgraph is part of the sample financial indicator knowledge graph. When constructing the sample financial indicator knowledge graph, a large number of documents, including financial textbooks, accounting standards (such as IFRS and GAAP), company internal financial systems, cost accounting manuals, and industry analysis reports, are collected and organized to determine the corresponding indicators. Based on the company's long-term accumulated business rules (such as "a decrease in the expense ratio usually first examines premium income and costs"), the weight values between related indicators are determined.
[0068] The method for obtaining the knowledge graph and sample knowledge graph subgraphs is the same as the method described above, but other methods can also be used, and this embodiment does not limit them.
[0069] The sample prompt template can include sample question text, sample query results, and sample inference requirements. The sample question text is a corresponding financial question, such as "Why did the sales expenses of the Guangdong branch increase by 15% year-on-year in December 2024?". Sample query results are inserted in the form of structured lists or natural language descriptions, such as: "Relevant indicators include: total sales expenses of the Guangdong branch, sales expenses of its subordinate third-level institutions, advertising expenditures, number of marketing activities, and premium income during the same period, etc." The sample inference requirements instruct the neural network model to analyze step by step, requiring it to first describe the overall changes, then analyze the changes and contributions of key driving indicators item by item, and finally summarize and generalize.
[0070] The initial neural network model is fine-tuned based on the sample input data and corresponding label reports to obtain a preset neural network model. The Qwen2 model can be fine-tuned using the LoRA (Low Rank Adaptation) method. LoRA adapts to specific tasks by adding low-rank matrices to specific layers of the model, efficiently adjusting model parameters while maintaining the model's generalization ability. Ultimately, a neural network model with deep financial knowledge is obtained.
[0071] In this embodiment, the initial neural network model is fine-tuned. During this fine-tuning, multi-source heterogeneous domain-specific data is integrated, including a financial expertise base, structured business rules, and historical cases. This fine-tuning approach allows the large model to internalize theoretical knowledge and practical business experience. The generated financial attribution report is not only based on data but also incorporates business insights, solving the problem of insufficient depth in traditional automated analysis.
[0072] In this application, a financial indicator knowledge graph is defined. The edges in the financial indicator knowledge graph include the relationship types between various indicators and the weight values of the corresponding relationships. The strength of the relationships between indicators is quantified to improve the accuracy of financial attribution results. Indicators associated with the query text are extracted, and subgraphs of the knowledge graph are defined to facilitate the determination of query results corresponding to financial queries based on the indicators in the knowledge graph. A pre-set neural network model is used to process the query results and generate a financial attribution report. The neural network model can deeply analyze the complex relationships in the data and improve the accuracy of query result processing.
[0073] Please see Figure 3 , Figure 3 This is a schematic diagram of a financial attribution generation device according to an embodiment of this application. This financial attribution generation device corresponds one-to-one with the loan scheme determination method in the above embodiments. Please refer to [link / reference] for details. Figure 2 as well as Figure 2 The relevant descriptions in the corresponding embodiments are shown below. For ease of explanation, only the parts relevant to this embodiment are shown. See also... Figure 3 The financial attribution generation device 30 includes: Module 31 is used to determine the financial indicator knowledge graph. The nodes in the financial indicator knowledge graph are the indicators of each dimension in the preset financial system. The edges in the financial indicator knowledge graph include the relationship type between each indicator and the weight value of the corresponding relationship. The weight value represents the relationship strength of the corresponding relationship.
[0074] Extraction module 32 is used to obtain the question text corresponding to the financial question, and extract the indicators associated with the question text based on the question text and the financial indicator knowledge graph to obtain the knowledge graph subgraph.
[0075] The query module 33 is used to perform queries in a preset Hive table based on the knowledge graph subgraph to determine the query results corresponding to the financial question.
[0076] The processing module 34 is used to process the query results using a preset neural network model and generate a financial attribution report.
[0077] Optionally, the extraction module 32 includes: The first determining unit is used to perform entity recognition on the question text using a preset entity recognition model to determine the initial index corresponding to the question text.
[0078] The search unit is used to obtain a preset number of steps and, based on the preset number of steps, search for related indicators associated with the initial indicator in the financial indicator knowledge graph.
[0079] Optionally, the extraction module 32 further includes: The adjustment unit is used to adjust the weight value of each relationship according to the preset business rules, so as to obtain the target weight value of each relationship.
[0080] The pruning unit is used to prune the associated indicators based on the target weight value, so as to obtain the pruned associated indicators.
[0081] Optionally, the query module 33 includes: The second determining unit is used to determine the table structure information of the Hive table.
[0082] The first processing unit is used to process the table structure information and knowledge graph subgraphs using a preset large language model to determine the target query statement.
[0083] The query unit is used to query the Hive table based on the target query statement and determine the query results corresponding to the financial query.
[0084] Optionally, the first processing unit includes: Obtain the sub-unit, which is used to obtain the preset first prompt template. Fill the first prompt template according to the table structure information and the knowledge graph subgraph to obtain the first input data.
[0085] The input subunit is used to input the first input data into the preset large language model and output the target query statement.
[0086] Optionally, the processing module 34 includes: The acquisition unit is used to acquire a preset second prompt template, and fill the second prompt template according to the question text, query results and preset reasoning requirements to obtain the second input data.
[0087] The input unit is used to input the second input data into a preset neural network model and output a financial attribution report.
[0088] Optionally, the financial attribution generation device 30 also includes: The acquisition module is used to acquire the initial neural network model, sample input data, and the label report corresponding to the sample input data. The sample input data consists of the sample question text, sample query results, and sample inference requirements filled in the sample prompt template.
[0089] The fine-tuning module is used to fine-tune the initial neural network model based on the sample input data and the corresponding label report to obtain the preset neural network model.
[0090] It should be noted that the information interaction and execution process between the above-mentioned units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0091] Figure 4 This is a schematic diagram of the structure of a computer device provided in one embodiment of this application. For example... Figure 4 As shown, the computer device of this embodiment includes: at least one processor ( Figure 4 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, which, when executed by the processor, implements the steps in any of the above-described financial attribution generation method embodiments.
[0092] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 4 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0093] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0094] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of the computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0095] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0096] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on a computer device, it enables the computer device to execute the steps in the above method embodiments.
[0097] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0098] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0099] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0100] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0101] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A financial attribution generation method, characterized in that, The financial attribution generation method includes: A financial indicator knowledge graph is defined, wherein the nodes in the financial indicator knowledge graph are various indicators of various dimensions in a preset financial system, and the edges in the financial indicator knowledge graph include the relationship type between various indicators and the weight value of the corresponding relationship, wherein the weight value represents the relationship strength of the corresponding relationship. Obtain the question text corresponding to the financial question; extract the indicators associated with the question text based on the question text and the financial indicator knowledge graph to obtain the associated indicators; prune the associated indicators based on the weight values of the relationship between the associated indicators and the corresponding associated indicators to determine the knowledge graph subgraphs. Based on the knowledge graph subgraph, a query is performed in a preset Hive table to determine the query result corresponding to the financial question; The query results are processed using a pre-defined neural network model to generate a financial attribution report.
2. The financial attribution generation method as described in claim 1, characterized in that, The step of extracting indicators associated with the question text based on the question text and the financial indicator knowledge graph to obtain associated indicators includes: The question text is identified using a preset entity recognition model to determine the initial index corresponding to the question text. Obtain a preset number of steps, and based on the preset number of steps, search for related indicators associated with the initial indicator in the financial indicator knowledge graph.
3. The financial attribution generation method as described in claim 1, characterized in that, The step of pruning the related indicators based on the weight values of the relationships between the related indicators and their corresponding related indicators to determine the knowledge graph subgraphs includes: Based on the preset business rules, the weight value of each relationship is adjusted to obtain the target weight value of each relationship; Based on the target weight value, the associated index is pruned to obtain the pruned associated index.
4. The financial attribution generation method as described in claim 1, characterized in that, The step of querying a preset Hive table based on the knowledge graph subgraph to determine the query result corresponding to the financial question includes: Determine the table structure information of the Hive table; The table structure information and the knowledge graph subgraph are processed using a pre-defined large language model to determine the target query statement; Based on the target query statement, the Hive table is queried to determine the query results corresponding to the financial question.
5. The financial attribution generation method as described in claim 4, characterized in that, The process of using a pre-defined large language model to process the table structure information and the knowledge graph subgraph to determine the target query statement includes: Obtain a preset first prompt template, and fill the first prompt template according to the table structure information and the knowledge graph subgraph to obtain the first input data; The first input data is input into the preset large language model, and the target query statement is output.
6. The financial attribution generation method as described in claim 1, characterized in that, The step of processing the query results using a preset neural network model to generate a financial attribution report includes: Obtain a preset second prompt template, and fill the second prompt template according to the question text, the query result and the preset reasoning requirements to obtain the second input data; The second input data is fed into the preset neural network model to output a financial attribution report.
7. The financial attribution generation method as described in claim 6, characterized in that, The fine-tuning process of the preset neural network model includes: Obtain the initial neural network model, sample input data, and label report corresponding to the sample input data. The sample input data consists of sample question text, sample query results, and sample reasoning requirements filled in the sample prompt template. The initial neural network model is fine-tuned based on the sample input data and the corresponding label report to obtain a preset neural network model.
8. A financial attribution generation device, characterized in that, The financial attribution generation device includes: The determination module is used to determine the financial indicator knowledge graph. The nodes in the financial indicator knowledge graph are the indicators of each dimension in the preset financial system. The edges in the financial indicator knowledge graph include the relationship type between each indicator and the weight value of the corresponding relationship. The weight value represents the relationship strength of the corresponding relationship. The extraction module is used to obtain the question text corresponding to the financial question, and extract the indicators associated with the question text based on the question text and the financial indicator knowledge graph to obtain a knowledge graph subgraph. The query module is used to perform queries in a preset Hive table based on the knowledge graph subgraph to determine the query results corresponding to the financial question. The processing module is used to process the query results using a preset neural network model to generate a financial attribution report.
9. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the financial attribution generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the financial attribution generation method as described in any one of claims 1 to 7.