Question answering system and method based on data, electronic equipment and storage medium
By introducing problem acquisition, information extraction, step planning and execution modules into the question-and-answer system, the problem of low compatibility between the answers of the existing question-and-answer system and user needs is solved, and more accurate and detailed answer generation is achieved, improving the user experience.
Patent Information
- Application Number
- CN202411439217.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-17
AI Technical Summary
The existing data-based question-and-answer system has low answers to user needs when dealing with professional questions, especially in the financial industry and steel plants. Due to insufficient experience, staff members find it difficult to obtain detailed solutions and steps.
A data-based question-and-answer system is designed, including a question acquisition module, an information extraction module, a step planning module, a step execution module and an answer formation module. By extracting and decomposing the questions, sub-steps arranged in sequence are generated and executed. These steps are used to form answers and improve the fit between the answer and user needs.
Through in-depth analysis of the questions and step execution, the degree of fit between the answer results and user needs is improved, and answers that are only fed back through search methods are avoided, which improves the user experience.
Smart Images

Figure CN119323258A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis technology, and in particular to a data-based question-answering system, method, electronic device and storage medium. Background Art
[0002] A data-based question-answering system is a system that analyzes and processes the data involved in questions entered by users and returns an answer. This question-answering system is widely used in various industries. For example, users inquire about the latest economic situation in the financial industry and consumers inquire about information related to commodities.
[0003] In the related art, the working mode of the question-answering system is that after the user inputs a question, the system first understands the question input by the user, then searches for the question input by the user, and finally generates an answer based on the search results. However, the answer obtained by this working mode is only obtained by understanding and searching the question input by the user. For some professional questions, the answer given by the question-answering system is less consistent with the user's needs. For example, in the financial industry, the staff's in-depth analysis of financial data, etc., in steel plants, due to lack of work experience, the staff want to query the solution of professional problems and detailed solution steps.
[0004] Therefore, there is a need to improve the data-based question-answering system in the related art. Summary of the invention
[0005] In view of the above-mentioned shortcomings of the prior art, the present application provides a data-based question-answering system, method, electronic device and storage medium to solve the above-mentioned technical problems.
[0006] The present invention provides a data-based question-answering system, and the method includes: the system includes: a question acquisition module, which is used to obtain a question description; the question description includes a data description required to solve the problem; an information extraction module, which is used to extract information from the question description to obtain question extraction information; a step planning module, which is used to plan the steps for solving the problem according to the question extraction information to obtain planning steps; a step execution module, which is used to execute the planning steps to obtain execution results; and an answer formation module, which is used to form an answer result of the question based on the execution result.
[0007] In one embodiment of the present invention, the step planning module includes: an information reading module for reading the problem extraction information; a data acquisition module for acquiring target data based on the problem extraction information, wherein the target data includes data required to solve the problem; a prompt word generation module for decomposing the problem extraction information and generating sub-step prompt words based on the decomposition results; the sub-step prompt words are used to indicate the execution process of the sub-steps; a step generation module for generating sub-steps arranged in sequence based on the sub-step prompt words and the target data, and using the sub-steps arranged in sequence as the planning steps.
[0008] In one embodiment of the present invention, the step execution module includes: a function acquisition module, which is used to acquire the function description required to solve the problem, and extract information from the function description to obtain function extraction information; a sub-step selection module, which is used to select the first sub-step from the planning step as the current sub-step; a sub-step conversion module, which is used to convert the current sub-step into the current execution code according to the function extraction information; a sub-step execution module, which is used to execute the current execution code to obtain the current execution result; a sub-step determination module, which is used to redetermine the subsequent sub-steps of the current sub-step according to the current execution result and the current sub-step prompt word to obtain the target sub-step; a loop execution module, which is used to select the first sub-step from the target sub-step as the update sub-step, and execute the update sub-step until all sub-steps are executed to obtain the execution result.
[0009] In one embodiment of the present invention, the sub-step conversion module includes: a type acquisition module, used to obtain the operation type of the function extraction information on the target data; the operation types include averaging, maximum value, data sorting and data grouping; a code conversion module, used to convert the current sub-step into a code for executing the operation type on the target data when the operation type is consistent with the prompt word of the current sub-step, so as to obtain the current execution code.
[0010] In one embodiment of the present invention, the sub-step determination module includes: a result comparison module, which is used to compare the current execution result with the execution result of the execution process corresponding to the prompt word of the current sub-step to obtain a comparison result; a sub-step maintenance module, which is used to use the subsequent sub-step of the current sub-step as the target sub-step when the comparison result is consistent; a sub-step addition module, which is used to add a sub-step before the subsequent sub-step of the current sub-step when the current execution result is the execution result obtained before the execution process corresponding to the prompt word of the current sub-step, and use the added sub-step and the subsequent sub-step of the current sub-step as the target sub-step; the execution result of the added sub-step is consistent with the execution result of the execution process corresponding to the prompt word of the current sub-step; a sub-step deletion module, which is used to delete the sub-step that implements the execution process corresponding to the prompt word of the current sub-step after the current sub-step from the subsequent sub-steps of the current sub-step when the current execution result is the execution result obtained after the execution process corresponding to the prompt word of the current sub-step, and obtain the target sub-step.
[0011] In one embodiment of the present invention, the system also includes: a question input module, used to input the question in a preset language format to obtain the problem description; a storage module, used to store at least one of the problem description, the problem extraction information, the planning steps, the execution results and the answer results; and a result display module, used to display at least one of the problem description, the problem extraction information, the planning steps, the execution results and the answer results.
[0012] In one embodiment of the present invention, the answer formation module includes: a similarity calculation module, used to calculate the similarity between the execution result of the sub-step and the question extraction information; a similarity screening module, used to take the similarity greater than a preset similarity threshold as the target similarity; a result selection module, used to take the execution result of the sub-step that calculates the target similarity as the target execution result; and a result combination module, used to combine the target execution results to obtain the answer result.
[0013] According to one aspect of an embodiment of the present invention, a data-based question-answering method is provided, the method comprising: obtaining a problem description; the problem description comprising a data description required to solve the problem; extracting information from the problem description to obtain problem extraction information; planning steps for solving the problem according to the problem extraction information to obtain planning steps; executing the planning steps to obtain an execution result; and forming an answer result to the question based on the execution result.
[0014] According to one aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the data-based question-and-answer method as described above.
[0015] According to one aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the data-based question-answering method as described above.
[0016] Beneficial effects of the present invention: The present invention obtains the problem description through the problem acquisition module, the information extraction module extracts information from the problem description to obtain the problem extraction information, the step planning module plans the steps for solving the problem according to the problem extraction information to obtain the planning steps, the step execution module executes the planning steps to obtain the execution results, and the answer formation module forms the answer result of the question based on the execution result. In the above process, after obtaining the problem description and the problem extraction information, by planning and executing the steps for solving the problem and forming the answer result according to the execution result, the fit between the answer result and the user demand is improved, and the situation that the answer result is fed back only by retrieval is avoided, which reduces the user experience.
[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0019] Figure 1 is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application;
[0020] Figure 2 is a block diagram of a data-based question-answering system shown in an exemplary embodiment of the present application;
[0021] Figure 3 is a flow chart of a data-based question-answering method shown in an exemplary embodiment of the present application;
[0022] Figure 4 is a flow chart of a data-based question-answering method shown in another exemplary embodiment of the present application;
[0023] Figure 5 is a logic diagram of a data-based question-answering method shown in another exemplary embodiment of the present application;
[0024] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0026] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0027] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0028] Figure 1 It is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application.
[0029] Reference Figure 1As shown, the system architecture may include an input device 101 and a computer device 102. The computer device 102 may be at least one of a desktop graphics processing unit (GPU) computer, a GPU computing cluster, a neural network computer, etc. Relevant technicians may use the computer device 102 to obtain a problem description through a problem acquisition module, an information extraction module to extract information from the problem description, obtain problem extraction information, a step planning module to plan the steps for solving the problem according to the problem extraction information, obtain planning steps, a step execution module to execute the planning steps, obtain execution results, and an answer formation module to form an answer result for the problem based on the execution results. The input device 101 is used to input a problem description. In this embodiment, the input device 101 may use a voice input device, a touch screen input device, etc. to input the problem, and provide it to the computer device 102 for processing.
[0030] Illustratively, after the computer device 102 obtains the problem description from the input device 101, the information extraction module extracts information from the problem description to obtain problem extraction information; the step planning module plans the steps for solving the problem based on the problem extraction information to obtain planning steps; the step execution module executes the planning steps to obtain execution results; and the answer formation module forms an answer result for the problem based on the execution results. In the above process, after obtaining the problem description and problem extraction information, the steps for solving the problem are planned and executed, and the answer result is formed according to the execution result, so as to improve the fit between the answer result and the user needs and avoid the situation where the answer result is fed back only through retrieval, thereby reducing the user experience.
[0031] It should be noted that the data-based question-and-answer system provided in the embodiment of the present application is generally arranged in the computer device 102 , and accordingly, the data-based question-and-answer method is generally executed by the computer device 102 .
[0032] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0033] Figure 2 is a block diagram of a data-based question-answering system shown in an exemplary embodiment of the present application. The data-based question-answering system can be set in a computing and processing device, which can be Figure 1 The computer device 102 shown in the figure may also be applicable to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment applicable to the system. Figure 2 As shown, the data-based question answering system includes:
[0034] The problem acquisition module 201 is used to acquire a problem description.
[0035] The information extraction module 202 is used to extract information from the problem description to obtain problem extraction information.
[0036] The step planning module 203 is used to plan the steps for solving the problem according to the problem extraction information to obtain the planning steps.
[0037] The step execution module 204 is used to execute the planning steps and obtain execution results.
[0038] The answer forming module 205 is used to form an answer result of the question based on the execution result.
[0039] In one embodiment of the present application, the problem description includes a description of data required to solve the problem, such as the average deposit balance in different countries, the net profit of a certain enterprise in the previous year, etc. The user describes the problem to be solved in a preset language format, obtains the problem description through the problem acquisition module, the information extraction module extracts information from the problem description to obtain problem extraction information, the step planning module plans the steps to solve the problem according to the problem extraction information to obtain the planning steps, the step execution module executes the planning steps to obtain the execution results, and the answer formation module forms the answer result of the problem based on the execution results. In the above process, after obtaining the problem description and problem extraction information, by planning and executing the steps to solve the problem, and forming the answer result according to the execution result, the fit between the answer result and the user needs is improved, and the situation of only feeding back the answer result through the retrieval method is avoided, which reduces the user experience.
[0040] In an exemplary embodiment of the present application, the preset language format can be a Chinese expression, or a preset programming language format, etc. The information extraction module can be an extractor big model, or it can be other models that process and analyze data and extract useful information. The step planning module can be a planner big model, or it can be other models that plan data. The step execution module can be an executor big model, or it can be other models that execute the planned steps. The extractor big model, the planner big model, and the executor big model are all part of the big language model, and the functions implemented by the extractor big model, the functions implemented by the planner big model, and the functions implemented by the executor big model are all partial functions in the big language model.
[0041] In another exemplary embodiment of the present application, the large language model is an artificial intelligence system based on deep learning technology. It understands and generates natural language by training a large amount of text data. It can analyze context, generate coherent sentences, and complete tasks such as translation, dialogue, and summary. This type of model uses billions or even trillions of parameters to capture complex patterns in language, so it performs well in a variety of language processing tasks. At the same time, the training corpus of the large language model also includes code language, so the large language model can also handle some code writing work. The application of the large language model improves the question analysis ability, information extraction ability, step planning ability, and step execution ability of the data-based question-answering system, and improves the accuracy of the answer results output by the data-based question-answering system.
[0042] In one embodiment of the present application, the step planning module includes:
[0043] The information reading module is used to read the question extraction information.
[0044] The data acquisition module is used to extract information based on the problem and acquire target data, where the target data includes data required to solve the problem.
[0045] The prompt word generation module is used to decompose the question extraction information and generate sub-step prompt words according to the decomposition results; the sub-step prompt words are used to indicate the execution process of the sub-steps.
[0046] The step generation module is used to generate sub-steps arranged in sequence based on sub-step prompt words and target data, and use the sub-steps arranged in sequence as planning steps.
[0047] In one embodiment of the present application, the target data can be obtained by pre-input by the user, or by searching and querying from available databases, available data platforms or available data websites based on the problem extraction information through the planner large model. After obtaining the problem extraction information and the target data, the problem extraction information is decomposed, and sub-step prompt words are generated according to the decomposition results. Sub-steps arranged in sequence are generated based on the sub-step prompt words and the target data. A problem solution is provided to the user through the sub-steps arranged in sequence, avoiding the situation where the answer result is fed back only through the retrieval method, which reduces the user experience.
[0048] In an exemplary embodiment of the present application, problem extraction information, target data, sub-step prompt words and sub-steps arranged in sequence can all be displayed to users through a display device to facilitate viewing by users; problem extraction information, target data, sub-step prompt words and sub-steps arranged in sequence can all be stored through a storage device, and the storage method is at least one of a relational database and a table format. The relational database can select a mySQL relational database, and the table format can be a CSV (Comma-Separated Values) file format, an excel table format, etc.
[0049] In another exemplary embodiment of the present application, if the extractor model determines that data in a MySQL relational database is needed, the extractor model will generate corresponding SQL (Structured Query Language) statements to extract information based on the problem description; if the extractor model determines that CSV format data or Excel format data is needed, the extractor model will generate corresponding Python code to extract data information. In the extracted information, the table header and a small amount of sample data need to be stored to facilitate the subsequent planner model to obtain feasible sub-steps.
[0050] In another exemplary embodiment of the present application, the problem description may be "how many customers are there in the target data, and what is the proportion of lost customers" or "from the perspective of average deposit balances in different countries, is there a large gap between the first and second place", etc., and the sub-step prompt words include "grouping data sets, calculating average balances, sorting countries, comparing gaps and judging gaps", etc., and the sub-steps arranged in order include "1. Grouping data sets according to geographic location fields; 2. Calculating the average of the balance field in each country group; 3. Arranging in descending order according to the average balance of each country; 4. Calculating the difference in average balance between the first and second countries; 5. If the gap is large, it means that there is a large gap between the first and second place, otherwise it means that the gap is small", etc. The example data of the target data is shown in Table 1:
[0051] Table 1
[0052]
[0053] By processing the target data in Table 1 through the sub-steps arranged in sequence, we get the answer result. The answer result is that the average balance of the first place is 119730.1161339179, and the second place is 62092.63651575588. The difference between them is 57637.47961816201, which exceeds the difference threshold of 10000. Therefore, it is determined that the average balance gap between the first and second countries is large.
[0054] In one embodiment of the present application, the step execution module includes:
[0055] The function acquisition module is used to obtain the function description required to solve the problem and extract information from the function description to obtain function extraction information.
[0056] The sub-step selection module is used to select the first sub-step from the planning step as the current sub-step.
[0057] The sub-step conversion module is used to extract information based on the function and convert the current sub-step into the current execution code.
[0058] The sub-step execution module is used to execute the current execution code and obtain the current execution result.
[0059] The sub-step determination module is used to redetermine the subsequent sub-steps of the current sub-step according to the current execution result and the current sub-step prompt word to obtain the target sub-step.
[0060] The loop execution module is used to select the first sub-step from the target sub-step as the update sub-step, and execute the update sub-step until all sub-steps are executed and the execution result is obtained.
[0061] In one embodiment of the present application, the functions required to solve the problem are described in a preset language format to obtain a function description, which includes a function function for grouping target data in an Excel table, a function function for sorting target data in an Excel table, a function code for grouping target data in a preset platform, a function code for sorting target data in a preset platform, etc. After obtaining the function description, information is extracted from the function description to obtain function extraction information, and the process of extracting information from the function description to obtain function extraction information is implemented by an extractor macro model, and the function extraction information includes keywords, tag numbers, etc. for characterizing the function description. According to the function extraction information, the process of converting the current sub-step into the current execution code includes: if there is function extraction information that is consistent with the execution process corresponding to the prompt word of the current sub-step, the function function or function code corresponding to the function extraction information is used to convert the current sub-step into the current execution code; if there is no function extraction information that is consistent with the execution process corresponding to the prompt word of the current sub-step, the conversion function in the executor macro model is used to convert the current sub-step into the current execution code. The process of judging whether there is function extraction information that is consistent with the execution process corresponding to the prompt word of the current sub-step is implemented in the reasoner model, which is the function model in the large language model. The process of re-determining the subsequent sub-steps of the current sub-step according to the current execution result and the prompt word of the current sub-step and obtaining the target sub-step is implemented in the planner model.
[0062] In another exemplary embodiment of the present application, the process of executing the update sub-step includes: according to the function extraction information, converting the update sub-step into an update execution code, executing the update execution code, and obtaining an update execution result. After obtaining the update execution result, according to the update execution result and the update sub-step prompt word, re-determine the subsequent sub-step of the update sub-step, obtain the re-determined subsequent sub-step, select the first sub-step from the re-determined subsequent sub-step, and execute the first sub-step in the re-determined subsequent sub-step until all sub-steps are executed. The process of re-determining the subsequent sub-step of the update sub-step according to the update execution result and the update sub-step prompt word is the same as the process of determining the subsequent sub-step of the current sub-step according to the current execution result and the current sub-step prompt word.
[0063] In one embodiment of the present application, the sub-step conversion module includes:
[0064] The type acquisition module is used to obtain the operation type of the function extraction information on the target data; the operation types include averaging, finding the maximum value, data sorting and data grouping.
[0065] The code conversion module is used to convert the current sub-step into a code for executing the operation type on the target data to obtain the current execution code when the operation type is consistent with the prompt word of the current sub-step.
[0066] In one embodiment of the present application, the operation type is determined according to the problem to be solved, and the operation type also includes fitting the target data, finding the peak value, finding the extreme value, etc., which are not listed here one by one. When the operation type is to find the average value and the prompt word of the current sub-step is to find the average value, the current sub-step is converted into a code for calculating the average value of the target data, and the code for calculating the average value of the target data is used as the current execution code; when the operation type is to find the maximum value, the current sub-step is converted into a code for calculating the maximum value of the target data, and the code for calculating the maximum value of the target data is used as the current execution code; when the operation type is data sorting, the current sub-step is converted into a code for sorting the target data, and the code for sorting the target data is used as the current execution code; when the operation type is data grouping, the current sub-step is converted into a code for grouping the target data, and the code for grouping the target data is used as the current execution code.
[0067] In one embodiment of the present application, the sub-step determination module includes:
[0068] A result comparison module is used to compare the current execution result with the execution result of the execution process corresponding to the prompt word of the current sub-step to obtain a comparison result;
[0069] A sub-step maintaining module, used for taking the subsequent sub-step of the current sub-step as the target sub-step when the comparison result is a consistent comparison;
[0070] A sub-step adding module is used to add a sub-step before the subsequent sub-step of the current sub-step when the current execution result is the execution result obtained before the execution process corresponding to the prompt word of the current sub-step, and use the added sub-step and the subsequent sub-step of the current sub-step as the target sub-step; the execution result of the added sub-step is consistent with the execution result of the execution process corresponding to the prompt word of the current sub-step;
[0071] The sub-step deletion module is used to delete the sub-steps that implement the execution process corresponding to the current sub-step prompt word after the current sub-step when the current execution result is the execution result obtained after the execution process corresponding to the current sub-step prompt word, from the subsequent sub-steps of the current sub-step to obtain the target sub-step.
[0072] In one embodiment of the present application, the planner large model is used to redetermine the subsequent sub-steps of the current sub-step according to the current execution result and the current sub-step prompt word, and obtain the target sub-step. By redetermining the subsequent sub-steps of the current sub-step, the effect of flexibly adjusting the planning steps can be achieved.
[0073] In one embodiment of the present application, the data-based question-answering system further includes:
[0074] The question input module is used to input questions in a preset language format to obtain a question description.
[0075] The storage module is used to store at least one of the problem description, problem extraction information, planning steps, execution results and answer results.
[0076] The result display module is used to display at least one of the problem description, problem extraction information, planning steps, execution results and answer results.
[0077] In an exemplary embodiment of the present application, the problem that the user needs to solve and the functional description required to solve the problem can be input through the problem input module. The problem input module can be a touch screen for manual input or a touch screen with a voice input function, which is not specifically limited here. The storage module is a RAM (Random Access Memory) or other memory, and the result display module can be a touch screen or a liquid crystal screen. The way to display the problem description, problem extraction information, planning steps, execution results and answer results can be displayed separately through the result display module, or the problem description, problem extraction information, planning steps, execution results or answer results can be displayed simultaneously, or part of the problem description, problem extraction information, planning steps, execution results and answer results can be displayed simultaneously.
[0078] In another exemplary embodiment of the present application, the input interface displayed by an LCD screen or a touch screen is as follows: You are an expert in data analysis. For given target data, you need to propose a simple problem to be solved. This problem contains multiple sub-steps arranged in sequence. If these sub-steps arranged in sequence are executed correctly, the correct answer will be obtained. Do not add any unnecessary steps. The output result of the last sub-step should be the final answer result.
[0079] Enter target data: {all or part of the target data};
[0080] Note: You only need to state the problem to be solved, you do not need to propose a solution to the problem.
[0081] Enter the problem: {the problem you want to solve}.
[0082] In another exemplary embodiment of the present application, the sub-steps arranged in sequence are given in the form of a list:
[0083] ["1. Grouping datasets: Group datasets by the Geography field";
[0084] "2. Calculate the average balance: Calculate the average of the Balance field in each country group";
[0085] "3. Sort countries: Sort by average balance of each country in descending order";
[0086] "4. Compare the gap: Calculate the difference in average balances between the first and second place countries";
[0087] "5. Determine the gap: If the gap is large, it means there is a large gap between the first and second place, otherwise it means the gap is small"].
[0088] In another exemplary embodiment of the present application, during the execution of the planning step, the display format of the target data, the executed sub-steps, the obtained execution results, the selectable function and the next sub-step to be executed is as follows:
[0089] Display format of target data: {all or part of the target data};
[0090] The sub-steps that have been executed so far are: {executed sub-steps and obtained execution results};
[0091] Optional tools: {tool information or function information};
[0092] Now you need to proceed to the next substep and output how you implement the next substep:
[0093] {Next sub-step: Group datasets - group target data by the Geography field};
[0094] {How to implement the next sub-step: Output the code to group the target data according to the Geography field}.
[0095] In one embodiment of the present application, the answer formation module includes:
[0096] The similarity calculation module is used to calculate the similarity between the execution results of the sub-steps and the question extraction information.
[0097] The similarity screening module is used to take the similarity greater than a preset similarity threshold as the target similarity.
[0098] The result selection module is used to use the execution result of the sub-step of calculating the target similarity as the target execution result.
[0099] The result combination module is used to combine the target execution results to obtain the answer result.
[0100] In one embodiment of the present application, the similarity between the execution results of the sub-steps and the question extraction information can be achieved by calculating cosine similarity, Pearson correlation coefficient, etc. The preset similarity threshold is set according to the actual situation and is not specifically limited here. After obtaining the similarity, the target similarity is screened out, and the execution results of the sub-steps that calculate the target similarity are used as the target execution results. The target execution results are combined to obtain the answer results, and the answer results are displayed through a display device to facilitate user viewing. After the answer result is formed, it can also be fed back to the user through voice broadcast, short message sending, etc.
[0101] In an exemplary embodiment of the present application, the problem to be solved is to determine whether the average balance difference between the first and second countries is large, and set the average balance difference to be greater than 10,000, then the difference is considered large; the average balance difference is less than 10,000, then the difference is considered small. The example of displaying the answer result in a display interface is as follows:
[0102] First place average balance: 119730.1161339179;
[0103] Second place average balance: 62092.63651575588;
[0104] Difference between first and second place: 57637.47961816201
[0105] According to the results, the average balance of the first place is 119730.1161339179, and the second place is 62092.63651575588. The gap between them is 57637.47961816201, which exceeds 10000. Therefore, it is determined that the average balance gap between the first and second place countries is large.
[0106] In another exemplary embodiment of the present application, after the user inputs the problem to be solved, the sub-steps of solving the problem (including executed sub-steps, execution results of executed sub-steps, and unexecuted sub-steps, etc.) can be displayed, and the specific process of solving the problem can be given. This not only makes it convenient for the user to understand the progress of solving the problem, but also makes it convenient for the user to learn the method to solve the problem, especially providing a feasible reference solution for users who lack experience in work and life.
[0107] The following describes a method embodiment of the present application, which can be applied to the data-based question-answering system in the above-mentioned embodiment of the present application. For details not disclosed in the method embodiment of the present application, please refer to the above-mentioned embodiment of the data-based question-answering system in the present application.
[0108] Figure 3 is a block diagram of a data-based question-answering method shown in an exemplary embodiment of the present application. The data-based question-answering method can be executed by a computing processing device, which can be Figure 1 The computer device 102 shown in FIG.
[0109] like Figure 3 As shown, the exemplary data-based question-answering method includes at least steps S310 to S350, which are described in detail as follows:
[0110] In step S310, a problem description is obtained. In one embodiment of the present application, the problem description includes a description of data required to solve the problem, such as the average deposit balance in different countries, the net profit of a certain enterprise in the previous year, etc. The user describes the problem to be solved in a preset language format, and the preset language format can be displayed on an LCD screen, a touch screen, etc. The user or user fills in the problem to be solved in the preset language format.
[0111] In step S320, information is extracted from the problem description to obtain problem extraction information. In one embodiment of the present application, information is extracted from the problem description to obtain problem extraction information in an extractor model or other model that processes and analyzes data and extracts useful information.
[0112] In step S330, the steps of solving the problem are planned according to the problem extraction information to obtain the planning steps. In one embodiment of the present application, the process of planning the steps of solving the problem according to the problem extraction information to obtain the planning steps is implemented in a planner big model or other models with data planning.
[0113] In step S340, the planning step is executed to obtain an execution result. In an embodiment of the present application, the process of executing the planning step can be executed in the actuator large model or other models that execute the planning step.
[0114] In step S350, an answer result of the question is formed based on the execution result. In one embodiment of the present application, the process of forming an answer result of the question based on the execution result includes: calculating the similarity between the execution result of the sub-step and the question extraction information; taking the similarity greater than the preset similarity threshold as the target similarity; taking the execution result of the sub-step that calculates the target similarity as the target execution result; combining the target execution results to obtain the answer result, which is convenient for the user to view. After the answer result is formed, it can also be fed back to the user through voice broadcast, short message sending, etc.
[0115] Figure 4 is a flowchart of a data-based question-answering method shown in an exemplary embodiment of the present application, such as Figure 4 As shown, the data-based question-answering method includes: (1) obtaining the problem to be solved and the functional description required to solve the problem input by the user; (2) the extractor model extracts information according to the problem to be solved to obtain problem extraction information, the extractor model obtains target data according to the problem extraction information, and stores the problem extraction information and target data; (3) the planner model obtains all sub-steps for solving the problem according to the problem extraction information and the target data; (4) for each sub-step, the reasoner model determines the method for implementing the sub-step and whether functional tools need to be used, etc.; the executor model is used to convert each sub-step into the current execution code and run the current execution code to obtain the current execution result; (5) according to the current execution result, the planner model determines whether it is necessary to add or reduce subsequent sub-steps; (6) after all sub-steps are executed, the answer formation module in the large language model determines the final answer result according to all execution results and the problem description.
[0116] Figure 5is a logic diagram of a data-based question-answering method shown in another exemplary embodiment of the present application, such as Figure 5 As shown, the data-based question-answering method includes: (1) the user inputs the problem to be solved to obtain a problem description; (2) the extractor model extracts information from the problem description to obtain problem extraction information; (3) the planner model plans the sub-steps of solving the problem to obtain sub-steps arranged in sequence; (4) it is determined whether all the sub-steps arranged in sequence have been executed. If all the sub-steps arranged in sequence have been executed, the answer result is obtained; if all the sub-steps arranged in sequence have not been executed, the first sub-step that has not been executed is used as the current sub-step, and the reasoner model is used to determine the method for implementing the current sub-step and whether a functional tool is needed to implement the current sub-step, etc. The current sub-step is converted into the current execution code through the executor model, and the current execution code is executed to obtain the current execution result; the planner model re-determines the subsequent sub-steps of the current sub-step according to the current execution result and the prompt word of the current sub-step to obtain the target sub-step; the first sub-step is selected from the target sub-step as the update sub-step, and the update sub-step is executed until all the sub-steps are executed to obtain the execution result.
[0117] It should be noted that the data-based question-and-answer method provided in the above embodiment and the data-based question-and-answer system provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here. In practical applications, the data-based question-and-answer method provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the method into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0118] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the data-based question-and-answer system provided in the above-mentioned embodiments.
[0119] Figure 6 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0120] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603, such as executing the method in the above embodiment. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602 and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0121] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.
[0122] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the system of the present application are executed.
[0123] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, method or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, method or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0124] The flowchart and block diagram in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0125] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0126] Another aspect of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, causes the computer to execute the data-based question-answering system as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0127] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the data-based question-answering system provided in each of the above embodiments.
[0128] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A data-based question-answering system, characterized in that: The system comprises: A problem acquisition module, used to acquire a problem description; the problem description includes a data description required to solve the problem; An information extraction module, used to extract information from the problem description to obtain problem extraction information; A step planning module is used to plan the steps for solving the problem according to the problem extraction information to obtain the planning steps; A step execution module, used to execute the planning steps and obtain execution results; An answer forming module is used to form an answer result of the question based on the execution result.
2. The data-based question-answering system according to claim 1, characterized in that: The step planning module includes: An information reading module, used for reading the question extraction information; A data acquisition module, used to extract information from the problem and acquire target data, wherein the target data includes data required to solve the problem; A prompt word generation module, used to decompose the question extraction information and generate sub-step prompt words according to the decomposition results; the sub-step prompt words are used to indicate the execution process of the sub-steps; A step generation module is used to generate sub-steps arranged in sequence based on the sub-step prompt words and the target data, and use the sub-steps arranged in sequence as the planning steps.
3. The data-based question-answering system according to claim 2, characterized in that: The step execution module includes: A function acquisition module is used to acquire the function description required to solve the problem, and extract information from the function description to obtain function extraction information; A sub-step selection module, used for selecting the first sub-step from the planning step as the current sub-step; A sub-step conversion module, used to convert the current sub-step into a current execution code according to the function extraction information; A sub-step execution module is used to execute the current execution code to obtain the current execution result; A sub-step determination module, used to re-determine the subsequent sub-step of the current sub-step according to the current execution result and the current sub-step prompt word, and obtain the target sub-step; The loop execution module is used to select the first sub-step from the target sub-step as the update sub-step, and execute the update sub-step until all sub-steps are executed to obtain the execution result.
4. The data-based question-answering system according to claim 3, characterized in that: The sub-step conversion module includes: A type acquisition module, used to acquire the type of operation of the function extraction information on the target data; the operation type includes averaging, maximum value, data sorting and data grouping; The code conversion module is used to convert the current sub-step into a code for executing the operation type on the target data to obtain the current execution code when the operation type is consistent with the prompt word of the current sub-step.
5. The data-based question-answering system according to claim 3, characterized in that: The sub-step determining module comprises: A result comparison module, used for comparing the current execution result with the execution result of the execution process corresponding to the prompt word of the current sub-step to obtain a comparison result; A sub-step maintaining module, used for taking the subsequent sub-step of the current sub-step as the target sub-step when the comparison result is a consistent comparison; A sub-step adding module, used for adding a sub-step before a subsequent sub-step of the current sub-step when the current execution result is an execution result obtained before the execution process corresponding to the prompt word of the current sub-step, and taking the added sub-step and the subsequent sub-step of the current sub-step as the target sub-step; the execution result of the added sub-step is consistent with the execution result of the execution process corresponding to the prompt word of the current sub-step; A sub-step deletion module is used to delete the sub-steps that implement the execution process corresponding to the current sub-step prompt word after the current sub-step when the current execution result is the execution result obtained after the execution process corresponding to the current sub-step prompt word, from the subsequent sub-steps of the current sub-step to obtain the target sub-step.
6. The data-based question-answering system according to any one of claims 1 to 5, characterized in that: The system further comprises: A question input module, used to input the question in a preset language format to obtain the question description; A storage module, used to store at least one of the problem description, the problem extraction information, the planning steps, the execution result and the answer result; The result display module is used to display at least one of the problem description, the problem extraction information, the planning steps, the execution result and the answer result.
7. The data-based question-answering system according to any one of claims 2 to 5, characterized in that: The answer formation module comprises: A similarity calculation module, used to calculate the similarity between the execution result of the sub-step and the question extraction information; A similarity screening module, used for taking a similarity greater than a preset similarity threshold as a target similarity; A result selection module, used for taking the execution result of the sub-step of calculating the target similarity as the target execution result; The result combination module is used to combine the target execution results to obtain the answer result.
8. A data-based question-answering method, characterized in that: The method comprises: Get a description of the problem; Extract information from the problem description to obtain problem extraction information; the problem description includes a data description required to solve the problem; Extracting information from the problem to plan steps for solving the problem, thereby obtaining planning steps; Execute the planning steps to obtain execution results; An answer result to the question is formed based on the execution result.
9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the data-based question-and-answer method as claimed in claim 8.
10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the data-based question-answering method according to claim 8.