Financial index data question and answer method and device based on intention recognition and algorithm parameter extraction
This financial indicator data question-and-answer method, which utilizes intent recognition and algorithmic parameter extraction, addresses the shortcomings of existing technologies in financial indicator querying and question-and-answering. It achieves accurate extraction of financial indicator data and precise identification of user intent, ensuring the accuracy of data operations.
Patent Information
- Application Number
- CN202510875583.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-11-07
AI Technical Summary
Existing technologies are inadequate for querying and answering questions related to key financial indicators, are prone to creating illusions, and lack effective data question-answering methods and equipment.
A question-answering method for financial indicator data, which utilizes intent recognition and algorithmic parameter extraction, including semantic completion, intent recognition, agent invocation, multi-dimensional matching, and confidence selection, generates a structured query language to accurately extract financial indicator data.
It enables accurate question-and-answer processing of financial indicator data, reduces the probability of outputting incorrect indicators due to illusions, and ensures accurate identification of user intent and accurate execution of data operations.
Smart Images

Figure CN120910189A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language processing, and in particular to a financial indicator data question and answer method and device based on intent recognition and algorithm parameter extraction. BACKGROUND
[0002] In enterprise expense customer service, traditional customer service answers mainly rely on manual customer service personnel. These customer service personnel master the company's products, services and solutions to common problems through training and learning, thereby providing support and answers for users. This manual customer service mode can consider the personalized needs of users and provide a personalized service experience. However, with the expansion of the scale of enterprises and the increase of customer demand, the traditional manual customer service mode faces many challenges.
[0003] Chinese patent application publication No. CN110188163A discloses an intelligent data processing system based on natural language. Through the intelligent data processing system based on natural language, the user's problem is understood by using voice and text input, and the data is analyzed and visualized in real time. The deficiencies of the business intelligence system in flexibility, convenience and mobility are solved, the analysis needs of the user at any place and time are realized, and the IT operation and maintenance cost is reduced. However, it mainly faces a wide range of natural language interaction scenes, and lacks in query and question and answer for key financial indicators, which is easy to produce illusion.
[0004] In summary, there is currently a lack of a data question and answer method and device for query and question and answer for key indicators. SUMMARY
[0005] The present application is to overcome the defects of the prior art and provide a financial indicator data question and answer method and device based on intent recognition and algorithm parameter extraction to solve or partially solve the problem of lack of query and question and answer for key financial indicators and easy to produce illusion.
[0006] The object of the present application can be achieved by the following technical solutions:
[0007] In one aspect of the present application, a financial indicator data question and answer method based on intent recognition and algorithm parameter extraction is provided, comprising the following steps:
[0008] Obtaining an original indicator data query question text;
[0009] Based on the historical dialogue text, the semantic completion processing is performed on the indicator data query question text;
[0010] Based on the semantic completion of the indicator data query question text, the indicator query intent label is obtained through intent recognition;
[0011] Query the intention label based on the index, call the corresponding Agent to query data and / or report forms;
[0012] Based on the data query and / or report form query result, a plurality of recall candidate sets are formed through multi-dimensional matching;
[0013] Through interaction with the user, confidence selection information corresponding to the plurality of recall candidate sets is obtained;
[0014] Based on the plurality of recall candidate sets and the corresponding confidence selection information, elements of the structured query language are generated;
[0015] The elements of the structured query language are combined into a query statement, and the target index data is queried.
[0016] As a preferred technical solution, the process of forming a plurality of recall candidate sets based on the data query and / or report form query result through multi-dimensional matching includes the following steps:
[0017] Based on the pre-established index of indicators, dimensions and code values, a plurality of candidate sets corresponding to each recall branch are obtained through string matching, vector matching and rule matching;
[0018] All recall branches are combined and the recall candidate sets are sorted as a whole through the ranking function, and a plurality of recall candidate sets are obtained.
[0019] As a preferred technical solution, the process of obtaining confidence selection information corresponding to the plurality of recall candidate sets through interaction with the user includes the following steps:
[0020] Based on the plurality of recall candidate sets and the corresponding ranking score, the number of user selections is determined through threshold truncation;
[0021] Determine whether the number of recall candidate sets remaining after threshold truncation is greater than 1, if yes, obtain confidence selection information corresponding to the plurality of recall candidate sets through interaction with the user, if no, do not perform confidence selection.
[0022] As a preferred technical solution, the process of generating elements of the structured query language based on the plurality of recall candidate sets and the corresponding confidence selection information includes the following steps:
[0023] The index name, company name, time, sorting flag and grouping flag in the index data query problem text are extracted using the fine-tuned large model, and are mapped to the corresponding structured query language to obtain elements of the structured query language.
[0024] As a preferred technical solution, the Agent includes:
[0025] Data query Agent: for processing structured data retrieval;
[0026] NL2 report Agent: for converting natural language into queries for fixed reports;
[0027] Metadata query Agent: for parsing index / dimension definitions.
[0028] As a preferred technical solution, the index query intention label comprises one or more of the following: ask index, ask code value, ask dimension, need sorting, need comparison, need distribution, continuous ask, formula description, selected scene, element missing, index filtering, and multiple indexes.
[0029] As a preferred technical solution, the semantic completion processing is performed by using the fine-tuned large language model, wherein the input of the large language model is the original index data query question text and historical dialogue text, and the output is the index data query question text after semantic completion, and the completed content includes an index name and / or an account set name.
[0030] As a preferred technical solution, after obtaining the original index data query question text, the method further comprises:
[0031] The index data query question text is added to the historical dialogue text.
[0032] As a preferred technical solution, the method further comprises:
[0033] The target index data is rendered in the form of a table or an icon on the front end.
[0034] In another aspect of the application, an electronic device is provided, comprising one or more processors, a memory, and one or more programs stored in the memory, the one or more programs comprising instructions for performing the aforementioned financial index data question and answer method based on intention recognition and algorithm parameter extraction.
[0035] Compared with the prior art, the application has at least one of the following beneficial effects:
[0036] (1) Realize accurate question and answer for financial index data: the application realizes accurate question and answer for financial index data through intention recognition-Agent query retrieval-confidence selection-element extraction of structured query language, finally forms a structured query statement, accurately extracts the financial index data expected by the user, fully guarantees the correspondence between the output index and the expected index, reduces the probability of outputting wrong index due to illusion, and avoids affecting the decision of the user.
[0037] (2) Realize accurate identification of user intention: the application first performs semantic completion on the original index data query problem text, then obtains an index query intention label through intention recognition, and then calls the corresponding Agent to perform data query and / or report query, so as to ensure accurate data operation and accurate identification of user intention. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 Flowchart of the financial index data question and answer method based on intention recognition and algorithm parameter extraction in the embodiment;
[0039] Figure 2 Schematic diagram of the financial index data question and answer process in the embodiment;
[0040] Figure 3 Schematic diagram of user intention recognition label classification in the embodiment;
[0041] Figure 4 Schematic diagram of the data rendering step in the embodiment;
[0042] Figure 5 Schematic diagram of the electronic device in the embodiment. DETAILED DESCRIPTION
[0043] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the application.
[0044] Embodiment 1
[0045] In view of the problems in the prior art, the embodiment provides a financial index data question and answer method based on intention recognition and algorithm parameter extraction, as shown in Figure 1 and Figure 2 The method comprises the following steps:
[0046] Step S1, user question input.
[0047] The user submits a question on the front-end page, for example Figure 2 “what about April this year?” in the above example, the user question is transmitted from the front-end page to the background for semantic analysis. At the same time, the historical question and answer of the user and the system are recorded in the session database.
[0048] Step S2, question rewriting.
[0049] The purpose of question rewriting is to perform semantic completion on the question. From Figure 2As can be seen in the question, the user asks "What about April this year?" only the time is specified, and no index, account name is specified. The question rewriting part will take the history conversation from the session database and try to complete the basic information.
[0050] For the example of Figure 2 , the final question is completed as "Total amount of comprehensive income of A Group in April this year", where the index name (total amount of comprehensive income) and the account name (A Group) are both from the history conversation.
[0051] Specifically, this step uses the glm4-9b large language model for fine-tuning, the input is the user's history conversation and the submitted question, and the output is the synthesized new question. Through pre-training of multiple samples, the model can accurately synthesize questions and complete semantics.
[0052] Step S3, user intent recognition.
[0053] User intent recognition aims to label user questions with various labels. According to the major categories, it can be divided into intent classification, demand elements, question methods, ambiguities, and technical classification. Each major category is further divided into several subcategories, as shown in Figure 3 .
[0054] Some examples are as follows:
[0055] Ask index: the question asks for an index, such as "What is the profit of each first-level company of the group in August?"
[0056] Ask code value: the question asks for a code value, such as "Please list the top five companies with the highest inventory occupancy."
[0057] Ask dimension: the question asks for metadata, such as "Which indicators of the group company have a significant decline compared to the same period last year?"
[0058] Need sorting: the question needs to use the order_by sorting function, such as "Please list the top five companies with the highest inventory."
[0059] Need comparison: the question needs to compare multiple indicators, accounts, and times, such as "Which indicators of the group company have a significant decline compared to the same period last year?"
[0060] Need distribution: the question needs to calculate the distribution of data, such as "How is the educational background distribution of the group employees?"
[0061] Continuous question: there are more than one question in one question, such as "Which company has the highest two gold occupancy? How much is the amount?"
[0062] Formula description: the user describes a calculation formula, such as "The proportion of junior college is the number of junior college employees divided by the total number of employees. Ask what is the proportion of junior college in the group?"
[0063] Selected scenario: The user actively specifies a scenario, such as "In the financial scenario, help me analyze the group's profit in August."
[0064] Element missing: There is information missing, such as "Please list the top five companies with the highest inventory occupancy." Here, "company" is missing, and "top five" should be "top five companies."
[0065] Indicator filtering: The indicator needs to appear in the filter condition, such as "Which companies are in loss this year?" The "loss" implies a filter condition on the "operating profit" indicator.
[0066] Multiple indicators: The question involves multiple indicators, such as "What are the group's profit and employee count in August this year?"
[0067] For different combinations of labels, the system will use different methods for subsequent processing. The main methods for subsequent processing are as follows:
[0068] (1) For categories that cannot be processed temporarily, prompt the problem out of scope;
[0069] (2) For categories such as element missing and element ambiguity, subsequent information will be completed through confidence selection, i.e., step S6;
[0070] (3) The categories in the technical classification can be used for result verification and subsequent parameter model prompts, i.e., step S7;
[0071] (4) Different agents need to be selected for subsequent processing, and the logic of agent selection also relies on the intent recognition label, i.e., step S4.
[0072] The user intent recognition model uses the glm4-9b large language model for fine-tuning. The input is the rewritten question obtained in step S2, and the output is various intent labels. Through pre-training with multiple samples, the accuracy of model classification is guaranteed.
[0073] Step S4, AGENT tool invocation: The system calls corresponding tools according to the intent, such as data query Agent, NL2 report Agent, or metadata query Agent.
[0074] According to the user intent classification, dynamically call special Agent to process tasks, and ensure accurate execution of data operations:
[0075] Data query Agent: Process structured data retrieval (such as SQL query results).
[0076] NL2 report Agent: Convert natural language into queries for fixed reports.
[0077] Metadata query Agent: parse the definition of metrics / dimensions (e.g. the formula of "total comprehensive income", data sources).
[0078] Step S5, algorithm recall: recall the candidates of metrics, dimensions, and code values according to the user's question and metadata.
[0079] Algorithm recall aims to preliminarily screen the metrics, dimensions, and code values through rules or algorithms with high efficiency, so as to prepare for the parameter setting of the large model in step S7.
[0080] Specifically, step S5 has established an index of metrics, dimensions, and code values in advance, and uses a matching function match() to match the user's question, to find a candidate set with relatively high relevance.
[0081] The matching function match() includes:
[0082] (1) String matching function: the matching degree of the candidate metrics, dimensions, and code values and the question is determined by counting the number of literal hits.
[0083] (2) Vector matching function: the matching degree is determined by calculating the vector similarity after vectorizing the question, metrics, dimensions, and code values.
[0084] (3) Rule matching function: the system formulates a series of strong business rules, and when a rule is hit, the rule recall method is used. These rules include synonym replacement, black and white lists, etc.
[0085] Each matching function corresponds to a recall branch, which can recall a certain number of candidate sets, and then a ranking function is used to merge all recall branches and sort the recalled candidate sets as a whole.
[0086] Step S6, confidence selection.
[0087] Confidence selection aims to introduce user interaction, allowing the user to verify multiple results in the recall candidate set. For example, in the example in Figure 2 , the top three metrics recalled are "total comprehensive income", "other comprehensive income", and "net amount of other comprehensive income after tax", which may all be related to "total comprehensive income" mentioned in the question. The top three dimensions recalled are "A Group Co., Ltd. - management consolidation", "A Group Co., Ltd. - asset consolidation", and "A Group Co., Ltd. - legal person", corresponding to different calculation scopes. At this time, the system gives the confidence selection of metrics and dimensions, and after collecting the user's feedback, the ambiguous user's intention can be determined.
[0088] The key point of this step is the calculation of the confidence score and whether the confidence selection criteria are met. The score is based on the ranking score in step S5, and the number of candidates selected by the user is determined by threshold truncation. If only one candidate remains after threshold truncation, there is no need for confidence selection.
[0089] The confidence selection only involves the indicator and dimension code values.
[0090] Step S7, X-Engine algorithm parameter extraction.
[0091] The algorithm parameter extraction aims to determine the elements in the SQL using a large model, including SELECT, WHERE, GROUP BY, ORDER BY, etc.
[0092] The input of the parameter extraction module is the user question, the recall information, the user's confidence selection information, the table structure schema, etc. The output is the basic elements in the SQL, represented in json format.
[0093] For example, for the question "Which are the top ten subsidiaries of the group in terms of non-operating income this year?"
[0094] The model extracts the indicator name and determines that the relevant segment is "non-operating income" and translates it into "metrics":["SUMI6301"].
[0095] The model extracts the company name and determines that the relevant segment is "group subsidiaries" and translates it into "COMPANY_INNER_CODE_DES='A group'", isSub=True.
[0096] The model extracts the time and determines that the relevant segment is "this year" and translates it into:
[0097] "timeStartFunction":{"year":2025,"month":1,"day":1},"timeEndFunction":{"year":2025,"month":12,"day":31},"timeGranularity":"total".
[0098] The model extracts the sorting flag and determines that the relevant segment is "top ten non-operating income" and translates it into "orderBys":["SUMI6301 desc"],"limit":10.
[0099] The model extracts the grouping flag to determine the relevant segment "which companies are they" and translates it into "groupBys":["COMPANY_INNER_CODE_DES"].
[0100] Step S7 uses the qwen2.5-32b large model for fine-tuning, and artificial and automated construction of multiple samples to enable the large model to learn the writing of SQL elements.
[0101] Step S8, SQL generation and execution.
[0102] The system dynamically generates a query statement according to the X-Engine parameters and runs the SQL in the middle-layer database (such as db2, Hive).
[0103] After obtaining the result, it is returned to the front end for rendering and display.
[0104] Step S9, data rendering.
[0105] The system displays tables, charts, or additional explanations on the front end according to the query results.
[0106] Referring to Figure 4 , according to the type of query results, the rendering decision engine uses different display methods. For single indicators, use table / value card display; for multiple indicators + time, use line chart / column chart display; for comparison queries, use comparison table / radar chart display; for metadata, use additional explanation display.
[0107] Users can save the results as CSV, PDF, and other formats.
[0108] Embodiment 2
[0109] On the basis of the foregoing embodiment, the present embodiment provides an electronic device, comprising: one or more processors and a memory, the memory having one or more programs stored therein, the one or more programs including instructions for executing the financial indicator data question and answer method based on intent recognition and algorithm parameter extraction as described in Embodiment 1.
[0110] As Figure 5 described, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course can also include other hardware required by the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to implement the above Figure 1The method described above. Of course, in addition to the software implementation, the present application does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but also can be hardware or logic device.
[0111] The memory can include non-persistent memory in computer readable media, random access memory (RAM), and / or non-volatile memory such as read only memory (ROM) or flash memory (flash RAM). The memory is an example of computer readable media.
[0112] The computer readable media includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition in this paper, computer readable media does not include transitory computer readable media, such as modulated data signals and carriers.
[0113] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any skilled person in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A financial index data question and answer method based on intent recognition and algorithm parameter extraction, characterized in that, The method comprises the following steps: obtaining an original index data query question text; performing semantic completion processing on the index data query question text based on historical dialogue text; obtaining an index query intent label through intent recognition based on the index data query question text after semantic completion; calling a corresponding Agent for data query and / or report query based on the index query intent label; forming a plurality of recall candidate sets through multi-dimensional matching based on the data query and / or report query result; obtaining confidence selection information corresponding to the plurality of recall candidate sets through user interaction; generating elements of a structured query language based on the plurality of recall candidate sets and the corresponding confidence selection information; forming a query statement by combining the elements of the structured query language to obtain target index data.
2. The financial indicator data question answering method based on intent recognition and algorithm parameter extraction according to claim 1, characterized in that, The process of forming a plurality of recall candidate sets through multi-dimensional matching based on the data query and / or report query result comprises the following steps: obtaining a plurality of candidate sets corresponding to each recall branch through string matching, vector matching and rule matching based on a pre-established index of indexes, dimensions and code values; merging all recall branches through a ranking function and performing overall sorting on the recalled candidate sets to obtain a plurality of recall candidate sets. 3.The financial index data question answering method based on intent recognition and algorithm parameter extraction of claim 1, wherein, The process of obtaining confidence selection information corresponding to the plurality of recall candidate sets through user interaction comprises the following steps: determining the number of selections by a user through threshold truncation based on the plurality of recall candidate sets and the corresponding ranking scores; determining whether the number of recall candidate sets remaining after threshold truncation is greater than 1, if yes, obtaining confidence selection information corresponding to the plurality of recall candidate sets through user interaction, and if no, not performing confidence selection.
4. The financial indicator data question answering method based on intent recognition and algorithm parameter extraction according to claim 1, characterized in that, The process of generating elements of a structured query language based on the plurality of recall candidate sets and the corresponding confidence selection information comprises the following steps: extracting index names, company names, times, sorting flags and grouping flags in the index data query question text using a fine-tuned large model, and mapping them to corresponding structured query languages to obtain elements of a structured query language.
5. The financial indicator data question answering method based on intent recognition and algorithm parameter extraction according to claim 1, characterized in that, The Agent comprises: a data query Agent for processing structured data retrieval; an NL2 report Agent for converting natural language into queries for fixed reports; a metadata query Agent for parsing index / dimension definitions.
6. The financial indicator data question answering method based on intent recognition and algorithm parameter extraction according to claim 1, characterized in that, The index query intent label comprises one or more of the following: asking for an index, asking for a code value, asking for a dimension, needing sorting, needing comparison, needing distribution, asking for a continuous, formula description, selecting a scene, missing elements, index filtering, and multiple indexes.
7. The financial indicator data question answering method based on intent recognition and algorithm parameter extraction according to claim 1, characterized in that, The fine-tuned large language model is used for semantic completion processing, wherein the input of the large language model is the original index data query question text and the historical dialogue text, and the output is the index data query question text after semantic completion, and the completed content includes index names and / or account set names. 8.The financial index data question answering method based on intent recognition and algorithm parameter extraction of claim 1, wherein, After obtaining the original index data query question text, the method further comprises: adding the index data query question text to the historical dialogue text.
9. The financial indicator data question answering method based on intent recognition and algorithm parameter extraction according to claim 1, characterized in that, The method further comprises: The target index data is rendered in the form of a table or an icon on the front end.
10. An electronic device, comprising: The apparatus includes one or more processors, memory, and one or more programs stored in the memory, the one or more programs including instructions for performing the method of any of claims 1-9.
Citation Information
Patent Citations
Intelligent data processing system based on natural language
CN110188163A