A method, device, equipment and storage medium for processing user questions
By correcting and decomposing user questions, generating sub-tasks, and performing checksum processing, the problem of user questions in the prior art is solved, and higher query accuracy and user-friendliness are achieved.
Patent Information
- Application Number
- CN202411528101.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-30
AI Technical Summary
When handling user questions, it is difficult to effectively correct non-professional nouns and expression errors, resulting in the inability of intelligent interactive software or machine learning algorithm platforms to accurately respond to users' real needs.
By receiving user questions, correcting and decomposing problems, several subtasks are generated, and these subtasks are checksum processed, and finally the processing results are visually displayed.
It improves the professionalism and accuracy of user questions, enhances user friendliness and query efficiency, reduces the burden and error rate of user manual operations, and makes data analysis more intuitive through visual presentation.
Smart Images

Figure CN119046443B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a method, device, equipment and storage medium for processing user questions. Background Art
[0002] With the rapid development of information technologies such as artificial intelligence and the Internet of Things, the application scenarios of human-computer interaction are becoming more and more extensive. Various intelligent interactive software, devices, and machine learning algorithm platforms have appeared in people's lives and work, such as Chat Generative Pre-trained Transformer (ChatGPT) and smart speakers, which can provide people with intelligent interactive functions in many application scenarios such as information query and knowledge question and answer.
[0003] At present, in response to user questions (e.g., economic questions, etc.) input by users into intelligent interactive software or machine learning algorithm platforms, it is common to directly answer the user questions to answer the user questions. However, there may be non-professional terms and incorrect or unclear expressions in user questions, which will cause the intelligent interactive software or machine learning algorithm platform to have a deviation in understanding the user questions, and thus fail to respond to the user's real needs.
[0004] Therefore the prior art still needs to be improved and enhanced. Summary of the invention
[0005] The technical problem to be solved by the present application is to provide a method, device, equipment and storage medium for processing user questions in view of the deficiencies in the prior art.
[0006] In order to solve the above technical problems, the first aspect of the present application provides a method for processing user questions, wherein the method for processing user questions specifically includes:
[0007] receiving a user question, and correcting the user question to obtain a corrected user question;
[0008] Decomposing the corrected user question to obtain a number of subtasks;
[0009] Verifying the plurality of subtasks to obtain verification results of the plurality of subtasks;
[0010] The plurality of subtasks are processed according to the verification results, and the processing results are visually displayed.
[0011] The method for processing user questions, wherein the step of receiving user questions and correcting the user questions to obtain the corrected user questions specifically includes:
[0012] receiving the user's question and identifying the question category corresponding to the user's question;
[0013] The user question is modified based on the question classification to obtain a modified user question.
[0014] The method for processing user questions, wherein the step of receiving the user questions and identifying the question classification corresponding to the user questions specifically includes:
[0015] Receive a user's question, and construct a first prompt word for the user's question, wherein the first prompt word includes a first preset instruction and a first example, and the first example includes a classification example and a question classification corresponding to the classification example;
[0016] Based on the first prompt word and the user question, a classification of the question asked by the user is determined by a large language model.
[0017] The method for processing user questions, wherein the step of correcting the user questions based on the question classification to obtain the corrected user questions specifically includes:
[0018] Based on the question classification and the user question, determine the first object information in the user question through a large language model, and modify the first object name in the first object information to obtain a first modified user question;
[0019] Based on the question classification and the first modified user question, second object information in the user question is determined through a large language model, and the object value in the second object information is modified to obtain a modified user question.
[0020] The method for processing user questions, wherein the step of determining the first object information in the user question through a large language model based on the question classification and the user question specifically includes:
[0021] Selecting a second example corresponding to the user's question according to the question classification, wherein the second example includes a first input and a first output, the first input includes a plurality of first preset questions, the first output includes first object information of each first preset question, and the first object information includes a first object name and a first object type;
[0022] Determining a second prompt word according to the second example and the second preset instruction, wherein the second preset instruction is used to describe the need to extract the first object information;
[0023] The user question and the second prompt word are input into a large language model, and the first object information in the user question is output through the large language model.
[0024] In the method for processing user questions, the step of correcting the first object name in the first object information to obtain a first corrected user question specifically includes:
[0025] Matching the first object name in the first object information with a standard name in a preset standard name library;
[0026] If the standard name is not matched, a preset number of standard names with the highest matching degree with the first object name are selected from the preset standard name library, and the first object name is corrected based on the selected preset number of standard names to obtain a first corrected user question.
[0027] The method for processing user questions, wherein the user questions after the question classification and the object name correction are determined by a large language model, the second object information in the user questions specifically comprises:
[0028] Selecting a third example corresponding to the user's question according to the question classification, wherein the third example includes a second input and a second output, the second input includes a plurality of second preset questions, the second output includes second object information of each second preset question, and the second object information includes a second object name, a second object type, and an object value;
[0029] Determining a third prompt word according to the third example and a third preset instruction, wherein the third preset instruction is used to describe the need to extract the second object information;
[0030] The first modified user question and the third prompt word are input into a large language model, and the second object information in the user question is output through the large language model.
[0031] In the method for processing user questions, when the numerical unit of the object value in the second object information in the second preset question is inconsistent with the standard numerical unit, the second output also includes a problem; and the correcting the object value in the second object information to obtain the corrected user question specifically includes:
[0032] If the second object information in the user's question includes an existence question, determining a modification reference value of the object value of the second object information;
[0033] The object value in the second object information is modified based on the modification reference value to obtain a revised user question.
[0034] The method for processing user questions, wherein the step of decomposing the corrected user questions to obtain a number of subtasks specifically includes:
[0035] Selecting a fourth example, and constructing a fourth prompt word based on the fourth example and a fourth preset instruction, wherein the fourth example includes a third input and a third output, the third input includes a third preset question, and the third output includes a plurality of subtasks decomposed according to the third preset question;
[0036] Based on the fourth prompt word and the corrected user question, the corrected user question is decomposed by a large language model to obtain a plurality of subtasks.
[0037] In the method for processing user questions, the task content of the subtask includes data requirements; and verifying the plurality of subtasks to obtain verification results of the plurality of subtasks specifically includes:
[0038] Verifying the decomposition correctness of each of the plurality of subtasks to obtain a first verification result of each of the subtasks;
[0039] The data requirements of each subtask are verified respectively according to the first verification result of each subtask to obtain the verification result of each subtask.
[0040] The method for processing user questions, wherein the task content of the subtask also includes a task description, a result name, and a result content; and the correctness of the decomposition of each of the plurality of subtasks is verified respectively to obtain a first verification result of each subtask, specifically including:
[0041] Performing a first verification on the decomposition correctness of each subtask according to the integrity of the task content of each subtask to obtain a first decomposition verification result;
[0042] Performing a second decomposition check on the decomposition correctness of each subtask according to the data requirement of each subtask to obtain a second decomposition check result;
[0043] Performing a third decomposition check on the decomposition correctness of each subtask according to the data requirement and the result name of each subtask to obtain a third decomposition check result;
[0044] The first verification result of each subtask is determined according to the first decomposition verification result, the second decomposition verification result and the third decomposition verification result of each subtask.
[0045] The method for processing user questions, wherein the step of verifying the data requirements of each subtask according to the first verification result of each subtask, and obtaining the verification result of each subtask specifically includes:
[0046] If the first verification results of all subtasks are that the decomposition is correct, verify whether the data requirement of each subtask is database data to obtain the verification result of each subtask;
[0047] If the first verification result of at least one subtask is incorrect decomposition, the corrected user question is decomposed again to obtain a number of re-decomposed subtasks; the re-decomposed subtasks are verified to obtain verification results of the re-decomposed subtasks.
[0048] The method for processing user questions, wherein the processing of the plurality of subtasks according to the verification results comprises:
[0049] For the subtask whose verification result is a database query, the object name and query condition in the task description of the subtask are obtained, and the result content of the subtask is searched in the database based on the object name and the query condition to obtain the processing result corresponding to the subtask.
[0050] In the method for processing user questions, the step of searching the database for the result of the subtask based on the object name and the query condition specifically includes:
[0051] Reading a preset template instruction, adding the object name and the query condition to the template instruction to form a query instruction for the subtask;
[0052] Execute the query instruction of the subtask and query the result content of the subtask in the database.
[0053] The method for processing user questions, wherein before obtaining the object name and query condition in the task description of the subtask, the method further comprises:
[0054] For the subtask whose verification result is a database query, a fifth prompt word is constructed based on a fifth preset instruction and a fifth example, wherein the fifth example includes a fourth input and a fourth output, the fourth input is a fourth preset question, the fourth output includes a start time and an end time, and the fifth preset instruction is used to describe the need to extract the time and convert the time into a standard time range;
[0055] Inputting the fifth prompt word and the task description of the subtask into a large language model, and converting the time description in the task description into a standard time range through the large language model;
[0056] The object name in the subtask is obtained, a mapping name corresponding to the object name is searched in a preset mapping database, and the object name is converted into the mapping name.
[0057] The method for processing user questions, wherein the processing of the plurality of subtasks according to the verification results further comprises:
[0058] For the subtask whose verification result is data processing, the result name of the required associated subtask is determined according to the data requirement of the subtask, the result content of all the associated subtasks is determined according to the result name of the associated subtask, and the result content of the subtask is determined based on the result content of all the associated subtasks and the task description of the subtask, so as to obtain the processing result corresponding to the subtask.
[0059] The method for processing user questions, wherein determining the result content of the subtask based on the result content of all the associated subtasks and the task description of the subtask specifically includes:
[0060] constructing a sixth prompt word based on the result contents of all the associated subtasks, the task descriptions of the subtasks, and a sixth preset instruction, wherein the sixth preset instruction is used to require the large language model to write a preset code;
[0061] Inputting the sixth prompt word into the large language model, and outputting a preset code of the subtask through the large language model;
[0062] Execute the preset code to obtain the result content of the subtask.
[0063] The method for processing user questions, wherein the visual display of the processing results specifically includes:
[0064] When the processing result of each subtask is obtained, the processing result of each subtask is visualized;
[0065] When the processing results of all subtasks are obtained, the last processing result of the obtained subtask is used as the processing result of the user's question, and the processing result of the user's question is visualized.
[0066] The method for processing user questions, wherein the visual display of the processing results specifically includes:
[0067] Obtaining the data format of the processing result of the user's question;
[0068] Detecting whether the data form belongs to a preset data form set, and obtaining a detection result;
[0069] Determine, according to the detection result, a presentation method of the processing result of the user's question;
[0070] The processing result of the user's question is presented according to the determined presentation method.
[0071] The method for processing user questions, wherein the method for presenting the processing result of the user questions according to the detection result specifically includes:
[0072] If the detection result belongs to the preset data form set, then detecting the data volume of the processing result of the user's question, and determining the presentation method of the processing result of the user's question according to the relationship between the data volume and the preset threshold;
[0073] If the detection result does not belong to the preset data form set, the processing result of the user's question is directly presented.
[0074] A second aspect of the present application provides a device for processing user questions, wherein the device for processing user questions specifically includes:
[0075] A correction module, used for receiving a user question and correcting the user question to obtain a corrected user question;
[0076] A decomposition module, used for decomposing the corrected user question into a plurality of subtasks;
[0077] A verification module, used to verify the plurality of subtasks and obtain verification results of the plurality of subtasks;
[0078] The processing module is used to process the plurality of subtasks according to the verification results and to visually display the processing results.
[0079] A third aspect of the present application provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in any of the above-mentioned methods for processing user questions.
[0080] A fourth aspect of the present application provides a terminal device, comprising: a processor and a memory;
[0081] The memory stores a computer-readable program executable by the processor;
[0082] When the processor executes the computer-readable program, the processor implements the steps in any of the above-mentioned methods for processing user questions.
[0083] Beneficial effects:
[0084] 1. This application can accurately understand the intention of users' questions by identifying their intentions and correcting their questions, and automatically correct errors, ambiguities or non-professional names that do not conform to the technical field in users' questions, so as to accurately respond to users' real needs and improve user-friendliness and query accuracy.
[0085] 2. This application decomposes the corrected user questions into several sub-questions, thereby decomposing complex queries into a series of simple sub-tasks, without the need for users to manually query step by step. This not only improves query efficiency and accuracy, but also reduces the burden and error rate of user manual operations.
[0086] 3. After obtaining the processing results of the user's questions, this application automatically selects the appropriate chart type for display according to the characteristics of the data, making the data presentation more intuitive, facilitating users to quickly understand the meaning and trends of the data, and improving the efficiency and accuracy of data analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0088] Figure 1 A flowchart of a method for processing user questions provided in an embodiment of the present application.
[0089] Figure 2 FIG. 4 is a flowchart of a specific implementation process of step S10.
[0090] Figure 3 Flow chart of the specific implementation process of step S12.
[0091] Figure 4 FIG. 4 is a flowchart of a specific implementation process of step S30 .
[0092] Figure 5 A schematic diagram of the structure of a device for processing user questions provided in an embodiment of the present application.
[0093] Figure 6 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0094] The embodiments of the present application provide a method, device, equipment and storage medium for processing user questions. In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
[0095] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0096] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0097] It should be understood that the sequence numbers and sizes of the steps in this embodiment do not mean the order of execution. The execution order of each process is determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0098] After research, it is found that with the rapid development of information technologies such as artificial intelligence and the Internet of Things, the application scenarios of human-computer interaction are becoming more and more extensive. Various intelligent interactive software, devices, and machine learning algorithm platforms have appeared in people's lives and work, such as Chat Generative Pre-trained Transformer (ChatGPT) and smart speakers, which can provide people with intelligent interactive functions in many application scenarios such as information query and knowledge question and answer.
[0099] At present, for user questions (e.g., economics questions, etc.) input by users into intelligent interactive software or machine learning algorithm platforms, it is common to directly input the user questions into the intelligent interactive software or machine learning algorithm platform, and then process the user questions through the intelligent interactive software or machine learning algorithm platform to obtain the processing results of the user questions corresponding to the user questions. Although the processing results of the user questions can be queried in this way, the following problems may exist:
[0100] 1. Lack of effective problem correction mechanism leads to misunderstanding of user questions and inability to respond to users' real needs;
[0101] 2. For complex questions, users need to manually query step by step, and lack the ability to automatically decompose and process complex queries, resulting in low query efficiency and prone to errors;
[0102] 3. The lack of intuitive visualization means makes it difficult for users to quickly understand the meaning and trends of the data, which is not conducive to data analysis, especially when dealing with large amounts of data.
[0103] In order to solve the above problems, in an embodiment of the present application, a user question is received, and the user question is corrected to obtain a corrected user question; the corrected user question is decomposed to obtain several subtasks; the several subtasks are verified to obtain the verification results of the several subtasks; the several subtasks are processed according to the verification results, and the processing results are visualized. The embodiment of the present application will first correct the user question to automatically entangle the errors, ambiguities or non-professional names in the user question that do not conform to the technical field, and improve the professionalism of the user question, so as to accurately respond to the real needs of the user, improve user friendliness and query accuracy. At the same time, the corrected user question will be split into several subtasks, and then each subtask will be processed, which can not only improve the query efficiency and accuracy, but also reduce the burden and error rate of manual operation of the user. At the same time, after obtaining the processing results, the present application will visualize the processing results, so that the user can quickly understand the meaning and trend of the processing results.
[0104] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0105] This embodiment provides a method for processing user questions, such as Figure 1 As shown, the method includes:
[0106] S10: receiving a user question, and correcting the user question to obtain a corrected user question.
[0107] Specifically, the user's question is a text question or voice question that needs to be answered, and the content of the user's question can involve various technical fields, such as the economic field, the medical field, the industrial field, etc. In addition, the embodiment of the present application does not limit the language type of the user's question, for example, the user's question can be a Chinese question or an English question, etc. This embodiment also does not limit the way the user asks questions, for example, it can be sent through an external device, or obtained by picking up the user's voice, or obtained by performing text recognition on a user-specified video, etc.
[0108] The corrected user question is obtained by correcting the user question, wherein the corrected user question may be obtained by correcting the object in the user question, and the object may include entities, proper nouns, etc. in the prompt question. In an embodiment of the present application, the corrected user question is obtained by correcting the object name and / or object value in the user question to correct errors or ambiguities in the question. When correcting the user question, the question category to which the user question belongs may be obtained first, and then the user question may be corrected based on the question category to improve the accuracy of the correction of the user question.
[0109] For example, Figure 2 As shown, the receiving of the user's question and the correction of the user's question to obtain the corrected user's question specifically include:
[0110] S11, receiving the user's question, and identifying the question category corresponding to the user's question;
[0111] S12: Modify the user question based on the question classification to obtain a modified user question.
[0112] Specifically, in step S11, the question classification is used to reflect the business type of the user's question, where the business type can be macroeconomic inquiry, listed company finance inquiry, and industrial and commercial data inquiry, etc. In the embodiment of the present application, after receiving the user's question, the question type of the user's question is identified to clarify the business type to be conducted, so that the answer requirements of the user's question can be more clearly defined, so as to better automatically correct errors or ambiguities in the question.
[0113] Exemplarily, the receiving of a question from a user and identifying a category of the question asked by the user specifically includes:
[0114] Receiving a user's question and constructing a first prompt word for the user's question;
[0115] Based on the first prompt word and the user question, a classification of the question asked by the user is determined by a large language model.
[0116] Specifically, the first prompt word is used as a prompt word for the user to ask a question, and the first prompt word includes a first preset instruction and a first example, the first preset instruction is used to reflect the need to identify the problem classification, and the first example is sample information for identifying the problem classification. The first example includes a classification example and a problem classification corresponding to the classification example, wherein each classification example in the first example corresponds to a problem classification, and the classification example carries a question prompt word corresponding to the problem classification, and the problem classification is the data type of the processing result of the user's question required for the problem classification corresponding to the classification example.
[0117] It should be noted that the first example may include classification examples of all question categories that can be recognized by the large language model, and may also include classification examples of some question categories among all question categories that can be recognized by the large language model. For example, all question categories that can be recognized by the large language model include querying macroeconomic data, querying financial and industrial and commercial data of listed companies, and no processing of user questions is required. The first example may include a classification example of querying macroeconomic data, or the preset question categories include classification examples of querying macroeconomic data and querying financial and industrial and commercial data of listed companies.
[0118] In the embodiment of the present application, the user's question and the first prompt word are input into the large language model. The large language model will classify the user's question according to the first example, and output the problem classification corresponding to the user's question. The problem classification is the problem classification of the user's question. Among them, by adopting the preset question classification and the first example to construct the first prompt word for the user's question, the first prompt word can provide prior knowledge for the large language model, so that the large language model can combine the learned prior knowledge to identify the business type of the user's question, and improve the accuracy of question classification and recognition. Of course, in practical applications, other methods can also be used to identify the problem classification of user questions, for example, directly inputting the user's question into the large language model, and performing problem classification and recognition through the large language model, or dividing the user's question into several question segments, and then performing text classification on each question segment for problem classification and recognition, etc.
[0119] In order to further illustrate the first prompt word in the embodiment of the present application, Example 1 is given below as an example of the first prompt word.
[0120] Example 1: Assume that the preset question categories include querying macroeconomic data, querying financial and industrial and commercial data of listed companies, and no processing of user questions is required. The question category corresponding to querying macroeconomic data is "macroeconomics", the question category corresponding to querying financial and industrial and commercial data of listed companies is "listed companies", and the question category corresponding to no processing of user questions is "not relevant". Then, the first prompt word can be:
[0121] First default instruction: Please determine which of the following types the user's query belongs to:
[0122] 1. If it is related to the city's macroeconomics (prompt words: GDP, three major industries and major sectors, social consumption and retail, imports and exports, etc.), then it returns "macroeconomics";
[0123] 2. If it is related to the stock price, financial indicators and registered city of listed companies (prompt words: stock price, financial data, profit, liabilities, assets, cash flow, investment, etc.), then "listed companies" will be returned;
[0124] 3. If the query is not relevant to either of the above two items, then return "not relevant".
[0125] Further, in step S12, when the user question is corrected based on the question classification, the user question can be corrected through the large language model, that is, a first example can be selected according to the question classification, and then a first prompt word can be constructed based on the first example, and finally the first prompt word and the user question are input into the large language model, and the corrected user question is output through the large language model. Based on this, Figure 3 As shown, the user question is corrected based on the question classification, and the corrected user question specifically includes:
[0126] S121. Based on the question classification and the user question, determine the first object information in the user question through a large language model, and modify the first object name in the first object information to obtain a first modified user question.
[0127] S122: Based on the question classification and the first modified user question, determine the second object information in the user question through a large language model, and modify the object value in the second object information to obtain a modified user question.
[0128] Specifically, in step S121, the first object information may be entity information in the user's question, or may be indicator information in the user's question, etc. For example, the first object information is information about listed companies, etc. The first object information may be obtained by performing object extraction on the user's question through a large language model, and the first object information includes a first object name and a first object type, and the first object information may include a first object name and an object type of the first object name, or may include multiple first object names and a first object type of each first object name. The first object name may be a person's name, organization / institution name, geographic location, time / date, character value, amount value, etc. in the user's question. The first object type may be a listed company, a city, an economic indicator, a financial indicator, etc.
[0129] Furthermore, when performing entity extraction through a large language model based on the question classification and the user question, a second prompt word can be constructed for the user question based on the question classification, and then the user question and the second prompt word are used as input items of the large language model, and the first object information corresponding to the user question is output through the large language model. Based on this, determining the first object information in the user question through a large language model based on the question classification and the user question specifically includes:
[0130] Selecting a second example corresponding to the user's question according to the question classification;
[0131] Determining a second prompt word according to the second example and the second preset instruction, wherein the second preset instruction is used to describe the need to extract the first object information;
[0132] The user question and the second prompt word are input into a large language model, and the first object information in the user question is output through the large language model.
[0133] Specifically, the second example can be pre-set, and the second example is used as prior knowledge for extracting the first object information. The second example can include several first preset questions and the answer results corresponding to each first preset question, wherein the several first preset questions are questions that need to extract the first object information, and the answer results corresponding to the first preset questions are the first object information. In other words, several first preset questions can be used as the first input in the second example, and the first object information can be used as the first output in the second example, that is, the second example includes the first input and the first output, the first input includes several first preset questions, the first output includes the first object information, and the first object information includes the first object name and the first object type. The question classification of each first preset question in the several first preset questions included in the first input is the same as the question classification of the user's question. For example, if the question classification of the user's question is macroeconomics, then the question classification of each first preset question is macroeconomics.
[0134] The second preset instruction is used to describe the need to extract the first object information, that is, the second preset instruction informs the large language model of the operation to be performed, that is, the second preset instruction informs the large language model of the need to perform entity extraction operation to output the first object information of the user's question. After obtaining the second example and the second preset instruction, the second example and the second preset instruction are spliced to obtain the second prompt word, and then the second prompt word and the user's question are input into the large language model, triggering the large language model to extract the entity of the user's question with the second example as prior knowledge to output the first object information of the user's question. In addition, in an embodiment of the present application, in order to facilitate the extraction of the first object information from the output of the large language model, the second example is written in json format, and the large language model will answer in json format, so that the output first object information is also in json format. In this way, the json format string can be matched by parsing the regular expression, and then the first object information can be parsed from the json format string by the json parser, thereby improving the speed and accuracy of identifying the first object information from the output item of the large language model.
[0135] In order to further illustrate the second prompt word in the embodiment of the present application, Example 2 is given below as an example of the second prompt word.
[0136] Example 2:
[0137] Second preset instruction: Please extract the key information (including company, index, city, etc.) from the input sentence and output it in json format;
[0138] Second example:
[0139] First input: Calculate the price-to-earnings ratio of XX company based on its recent stock price
[0140] First output:
[0141] json [
[0143] {
[0144] "Object Name": "XX Company",
[0145] "Object Type": "Public Company"
[0146] }
[0147] {
[0148] "Object Name": "Stock Price",
[0149] "Object Type": "Financial Indicator"
[0150] }
[0151] {
[0152] "object name": "PE ratio",
[0153] "Object Type": "Financial Indicator (need to be calculated)"
[0154] } ]
[0156] First input: What is the total GDP of XX city in 2022?
[0157] First output:
[0158] json [
[0160] {
[0161] "Object Name": "XX City",
[0162] "object type": "city",
[0163] }
[0164] {
[0165] "Object Name": "Total GDP",
[0166] "Object Type": "Economic Indicator"
[0167] }
[0168] ].
[0169] It should be noted that when determining the first object information through a large language model based on question classification and user questions, the question classification and user questions can also be directly used as inputs of the large language model, and then the first object information is output through the large language model.
[0170] In the embodiment of the present application, the second example is determined based on question classification, and then the second example is used to provide a large language model with a number of questions and corresponding answer results, so that the large language model can use the second example as prior knowledge, and then complete the entity extraction in the user's question by analogy, which can improve the accuracy of the first object information extracted by the large language model.
[0171] Further, when the first object information is obtained, the first object name in the first object information can be name standardized to obtain a first corrected user question, wherein, when the first object name is name standardized, each first object name in the first object information can be matched with a preset standard name library to obtain a standard name corresponding to each first object name; or, the first object name in the first object information is displayed to the user, and a name correction operation input by the user is received, and when the name correction operation is received, the corrected name corresponding to the name correction operation is used as the standard name of the first object name; or, the name is first matched with the standard name library, and the first object name that is not successfully matched is displayed to the user so that the user can perform manual correction, etc.
[0172] Exemplarily, the modifying the first object name in the first object information to obtain the first modified user question specifically includes:
[0173] Matching the first object name in the first object information with a standard name in a preset standard name library;
[0174] If the standard name is not matched, a preset number of standard names with the highest matching degree with the first object name are selected from the preset standard name library, and the first object name is corrected based on the selected preset number of standard names to obtain a first corrected user question.
[0175] Specifically, the preset standard name library is preset and includes several standard names, for example, standard indicator names and listed company names, and the standard indicator names may include standard economic indicator names and standard financial indicator names, etc. The first object information may include multiple object names, so that when matching the first object name in the first object information with the standard name in the preset standard name library, each object name in the first object information is matched with the standard name in the preset standard name library respectively to determine whether there is a standard name matching the first object name in the preset standard name library.
[0176] The match between the first object name and the preset standard name can be determined by using the matching degree between the first object name and the standard name as a measurement standard, and the matching degree can be the similarity between the character encoding of the first object name and the character encoding of the standard name, or the similarity between the semantic information of the first object name and the semantic information of the standard name, etc. Specifically, when the matching degree between the first object name and the standard name is greater than the preset matching degree threshold, it means that the first object name matches the standard name, and conversely, when the matching degree between the first object name and the standard name is less than or equal to the preset matching degree threshold, it means that the first object name does not match the standard name.
[0177] Further, when the first object name matches the standard name, the matched standard name is directly used to standardize the first object name. When the first object name does not match the standard name, a preset number of preset standard names are selected in descending order according to the matching degree, and the first object name is corrected based on the selected preset number of standard names. Wherein, when correcting the first object name based on the selected preset number of standard names, the selected preset number of standard names can be provided to the user to correct the first object name, and then the first object name is corrected according to the standard name determined by the user's selection. Of course, in actual applications, for the first object name that does not match the standard name in the preset standard name library, the user can select a standard name as the first object name from the displayed preset number of preset standard names, or output a user-specified name for the first object name. After receiving the user-specified name, the user-specified name can be directly used to correct the first object name, or the user-specified name can be used as the first object name, and the first object name in the first object information can be re-matched with the standard name in the preset standard name library until the standard name is matched in the preset standard name library, or the number of re-executions reaches the preset number of times. When the number of re-executions reaches a preset number, the user can be prompted to select only one standard name from a preset number of preset standard names. This ensures that each object name in the first revised user's question is a standard name in the preset standard name library, thereby improving the standardization effect of the object name.
[0178] Further, in step S122, the second object information is obtained by extracting the object and attribute of the user's question through the large language model, and the second object information includes a second object name, a second object type, and an object value, wherein the second object name in the second object information corresponds to the first object name of the first object information one by one, and the second object name is the name after the first object name corresponding to it is corrected, that is, the second object name is included in the preset standard name library. The object value is obtained by attribute extraction, and the object value includes the numerical index or numerical index range of the second object name. For example, the second object information is profit margin information, the second object name can be profit margin, the second object type can be a financial indicator, and the object value can be less than 10 million yuan, etc.
[0179] When entities and attributes are extracted through a large language model based on the question classification and the first revised user question, a third prompt word can be constructed based on the question classification, and then the user question and the third prompt word are used as input items of the large language model, and the second object information corresponding to the user question is output through the large language model. Based on this, the second object information in the user question is determined through a large language model based on the question classification and the first revised user question, specifically including:
[0180] Selecting a third example corresponding to the user's question according to the question classification;
[0181] Determining a third prompt word according to the third example and a third preset instruction, wherein the third preset instruction is used to describe the need to extract the second object information;
[0182] The first modified user question and the third prompt word are input into a large language model, and the second object information in the user question is output through the large language model.
[0183] Specifically, the third example may be pre-set, and the third example is used as prior knowledge for extracting the second object information. The third example may include a number of second preset questions and the answer results (i.e., the second object information) corresponding to each second preset question. Among them, the number of second preset questions are questions that need to extract the second object information, and the answer results are the second object information in the second preset questions. In other words, the number of second preset questions can be used as the second input in the third example, and the second object information can be used as the second output in the third example, that is, the third example includes a second input and a second output, the second input includes a number of second preset questions, the second output includes the second object information, and the second object information includes the second object name, the second object type, and the object value. The question classification of each second preset question in the number of second preset questions included in the second input is the same as the question classification of the user's question. For example, if the question classification of the user's question is macroeconomics, then the question classification of each second preset question is macroeconomics. In addition, in order to determine whether the object value needs to be corrected, a problem field may also exist in the second object information, and when the numerical unit of the object value in the second object information in the second preset question is inconsistent with the standard numerical unit of the object value, the output also includes a problem, so that when the large language model recognizes that the numerical unit of the object value is incorrect, it outputs a problem in the second object information.
[0184] The third preset instruction is used to describe the need to extract the second object information, that is, the third preset instruction is used to inform the large language model of the operation to be performed, that is, the third preset instruction is used to tell the large language model that it is necessary to perform entity and attribute extraction operations to output the second object information of the first modified user question. After obtaining the third example and the third preset instruction, the third example and the third preset instruction are spliced to obtain the third prompt word, and then the third prompt word and the first modified user question are input into the large language model, triggering the large language model to extract entities and attributes of the user question using the third example as prior knowledge to output the second object information of the user's question. In addition, the third example also uses the json format, and the large language model will answer in the json format.
[0185] In order to further illustrate the third prompt word in the embodiment of the present application, Example 3 is given below as an example of the third prompt word.
[0186] Example 3:
[0187] The third preset instruction: Please extract the key information (including company, indicator, city, etc.) in the input sentence and determine whether there is any ambiguity or contradiction (such as inconsistent numerical units. If there is no problem, please do not output "there is a problem") and what needs to be calculated, and output in json format.
[0188] Second input: Search for companies whose retained profits in 2022 exceed 50%, whose profit margin is less than 10 million yuan, whose cumulative dividend amount in the past three years is less than 50 million yuan, and whose registered city is XX city.
[0189] Second output:
[0190] json [
[0192] {
[0193] "Second object name": "Retained profits",
[0194] "Second object type": "Financial indicators",
[0195] "Object value": "More than 50%",
[0196] "Problem": "Wrong unit, the unit of retained earnings should not be a percentage"
[0197] }
[0198] {
[0199] "Second Object Name": "Profit Rate",
[0200] "Second object type": "Financial indicators",
[0201] "Object value": "less than 10 million yuan",
[0202] "Problem": "Unit error, the unit of profit margin should not be 10,000 yuan"
[0203] }
[0204] {
[0205] "Second object name": "Dividend amount",
[0206] "Second object type": "Financial indicators",
[0207] "Object value": "Less than 50 million yuan"
[0208] }
[0209] {
[0210] "Second Object Name": "Registration City",
[0211] "Second Object Type": "City",
[0212] "Object Value": "XX City"
[0213] }
[0214] ].
[0215] It should be noted that when determining the second object information through a large language model based on question classification and the first revised user question, the question classification and the first revised user question can also be directly used as the input of the large language model, and then the second object information is output through the large language model.
[0216] In the embodiment of the present application, the third example is determined based on the question classification, and then the third example is used to provide a large language model with several questions and corresponding answer results, so that the large language model can use the third example as prior knowledge, and then complete the second object information extraction in the user's question by analogy, which can improve the accuracy of the second object information extracted by the large language model. At the same time, since each object name in the first revised user question is standardized, the numerical unit of the object value can be used as the standard of the numerical unit in the first revised user question, so as to identify whether there is a problem with the numerical unit in the first revised user question. When there is a problem, a problem field will be added to the second object information, and the cause of the error will be stored in the problem field, so that the user can quickly know the object value that needs to be corrected.
[0217] Further, after obtaining the second object information, the name of the second object that needs to be standardized and corrected can be determined according to the problematic field in the second object information, and then the second object value can be standardized and corrected to obtain a corrected user question. Exemplarily, the correcting of the object value in the second object information to obtain the corrected user question specifically includes:
[0218] If the second object information in the user's question includes an existence question, determining a modification reference value of the object value of the second object information;
[0219] The object value in the second object information is modified based on the modification reference value to obtain a revised user question.
[0220] Specifically, the modified reference value is a reference value after the object value is corrected by the standard, which can be determined by counting the median or quartile of the object name, or obtained by searching a preset database, etc. After obtaining the modified reference value, the modified reference value can be directly used to correct the object value; or, the modified reference value can be provided to the user for user confirmation; or, the user can be directly prompted to enter the modified reference value of the object value, etc. In an embodiment of the present application, after determining the modified reference value of the object value with a problem, the modified reference value is displayed to the user so that the user can confirm the modified reference value. Among them, when the user confirms the modified reference value, the modified reference value is directly used to correct the object value. When the user does not confirm, the user can be prompted to enter the modified reference value, and the modified reference value entered by the user is used to correct the object value.
[0221] The embodiment of the present application standardizes, amends and confirms object names and object values, which is beneficial for querying correct data from the database on the one hand, and corrects the mismatch between indicators and values in user questions on the other hand, so as to better screen out entities that meet the requirements of the user questions and improve the query accuracy.
[0222] It should be noted that when correcting the user question to obtain the corrected user question, it is possible to directly correct the user question without classifying the user question. The above-mentioned correction process can be used to directly correct the user question, but when selecting examples, the preset examples can be directly used without selecting the corresponding examples according to the question classification. The other processes are the same and will not be repeated here.
[0223] S20, decomposing the corrected user question to obtain a plurality of subtasks.
[0224] Specifically, the plurality of subtasks are obtained by splitting the corrected user question into a plurality of sub-questions, and some of the plurality of subtasks may have a collaborative relationship, while some of the subtasks may not have a collaborative relationship. Of course, it is also possible that there is no collaborative relationship between all the subtasks. In addition, for subtasks with a collaborative relationship, the subtasks that require assistance will be processed later than the subtasks that provide assistance, and for subtasks without a collaborative relationship, the processing order between the subtasks is not limited, and they can be executed in parallel to improve the processing efficiency of user questions.
[0225] Each subtask includes a task description, which reflects the specific tasks and usage methods of the subtask so that each subtask can be executed. At the same time, in order to ensure that the decomposed subtasks can cooperate with each other, that is, the result content of a subtask can be called by other subtasks, data requirements will be configured for each subtask, and the data requirements will reflect the data source of the data required by the subtask, where the data source can be a database or the task result of the subtask. In order to facilitate the task results of a subtask to be called by other subtasks, the result name and result content can also be configured for each subtask. The result name is used as a unique identifier for the result content, and the result content is used to store the actual meaning of the task result. In this way, the assisted subtask can use the result name of the subtask that provides assistance as the data source, and then call the data content included in the result content of the subtask that provides assistance through the result name.
[0226] In addition, since the subtasks contain complex information content and the subtasks may also have coordination relationships, the large language model may misunderstand the problem decomposition task. To this end, in the embodiment of the present application, in order to facilitate the large language model to understand the problem decomposition task, when the large language model is used to decompose the problem, several decomposition examples are provided to the large language model, so that the large language model can use the decomposition examples as prior knowledge to decompose the corrected user questions, so as to improve the accuracy of the several subtasks obtained by decomposition.
[0227] Exemplarily, decomposing the corrected user question to obtain several subtasks specifically includes:
[0228] Selecting a fourth example, and constructing a fourth prompt word based on the fourth example and a fourth preset instruction, wherein the fourth example includes a third input and a third output, the third input includes a third preset question, and the third output includes a plurality of subtasks decomposed according to the third preset question;
[0229] Based on the fourth prompt word and the corrected user question, the corrected user question is decomposed by a large language model to obtain a plurality of subtasks.
[0230] Specifically, the fourth example is pre-set and used as prior information for problem decomposition. The fourth example is used to guide the large language model to decompose the corrected user question. Among them, the fourth example includes a third preset question that needs to be decomposed and several subtasks corresponding to the third preset question. The third preset question can be used as the third input in the fourth example, and the several subtasks corresponding to the third preset question can be used as the third output in the fourth example. That is to say, the fourth example includes a third input and a third output, the third input includes a third preset question, and the third output includes several subtasks obtained by decomposing the third preset question. The subtask includes a task description, data requirements, result name, and result content. The task description is used to reflect the specific task and usage method of the subtask, the data requirement is used to reflect the source of the data required for the subtask, the result content is used to reflect the actual meaning of the task result of the subtask, and the result name is a unique identifier for the result content.
[0231] After obtaining the fourth example, the fourth example is concatenated with the fourth preset instruction to obtain a fourth prompt word, wherein the fourth preset instruction is used to describe the need to decompose the corrected user question into subtasks. Then, the fourth prompt word and the corrected user question are input into the large language model as a large language model, and the corrected user question is decomposed by the large language model to obtain the output result of the large language model, and then the output result is parsed to obtain a number of subtasks corresponding to the corrected user question.
[0232] It should be noted that the fourth example and several subtasks can all be in JSON format, and then the subtasks decomposed by the large language model are matched through regular expressions to obtain JSON format results, and then the JSON format results are parsed by JSON to obtain several subtasks decomposed from the corrected user questions.
[0233] In order to further illustrate the fourth prompt word in the embodiment of the present application, Example 4 is given below as an example of the fourth prompt word.
[0234] Example 4:
[0235] Fourth preset instruction: Please refer to the following decomposition method to decompose the question. Each step should be as simple as possible and contain only one operation.
[0236] {
[0237] "Corrected user question": "Search for companies whose asset impairment loss to total operating costs ratio in 2022 is less than 5% or whose inventory turnover days are less than 90 days.",
[0238] "Decomposition steps": [
[0239] {
[0240] "Task Description": "Retrieve the asset impairment loss values of each company in 2022 from the database",
[0241] "Required data": "df1",
[0242] "Result content": "Asset impairment loss values of each company in 2022"
[0243] }
[0244] {
[0245] "Task Description": "Retrieve the total operating cost values of each company in 2022 from the database",
[0246] "Data requirements": ["Database"],
[0247] "result name": "df2",
[0248] "Result content": "Total operating cost value of each company in 2022"
[0249] }
[0250] {
[0251] "Task Description": "Calculate the ratio of asset impairment loss to total operating costs for the corresponding companies in df1 and df2",
[0252] "Data requirements": ["df1", "df2"],
[0253] "result name": "df3",
[0254] "Result content": "Ratio of asset impairment losses to total operating costs of each company in 2022"
[0255] }
[0256] {
[0257] "Task Description": "Filter out companies with a ratio lower than 5% from df3",
[0258] "data required": ["df3"],
[0259] "result name": "df4",
[0260] "Result content": "Companies whose ratio of asset impairment losses to total operating costs in 2022 is less than 5%"
[0261] }
[0262] {
[0263] "Task Description": "Retrieve the inventory turnover days of each company in 2022 from the database",
[0264] "Data requirements": ["Database"],
[0265] "result name": "df5",
[0266] "Result content": "Inventory turnover days of each company in 2022"
[0267] }
[0268] {
[0269] "Task Description": "Filter out companies with inventory turnover days less than 90 days from df5",
[0270] "data required": ["df5"],
[0271] "result name": "df6",
[0272] "Result content": "Companies with inventory turnover days less than 90 days in 2022"
[0273] }
[0274] {
[0275] "Task Description": "Unionize the companies that meet the requirements in df4 and df6",
[0276] "Data requirements": ["df4", "df6"],
[0277] "result name": "df7",
[0278] "Result content": "Companies whose ratio of asset impairment loss to total operating costs in 2022 is less than 5% or whose inventory turnover days are less than 90 days"
[0279] } ]
[0281] }.
[0282] S30: Verify the plurality of subtasks to obtain verification results of the plurality of subtasks.
[0283] Specifically, the verification result is used to determine the method to be used to obtain the data requirement of the subtask. The verification result can be obtained by verifying the data requirement of the subtask, wherein the verification result can be a database query or data processing.
[0284] Based on this, Figure 4 As shown, the verification of the plurality of subtasks to obtain the verification results of the plurality of subtasks specifically includes:
[0285] S31, verifying the decomposition correctness of each of the plurality of subtasks to obtain a first verification result of each of the subtasks;
[0286] S32. Verify the data requirements of each subtask according to the first verification result of each subtask to obtain the verification result of each subtask.
[0287] Specifically, in step S31, the decomposition correctness is used to verify the integrity of the subtasks to determine whether each subtask obtained by decomposition meets the integrity, where the integrity can include one or more of the integrity of the task content, the integrity of the data source, and the integrity of the assistance relationship. That is to say, when performing the decomposition correctness verification, the verification can be performed from three perspectives: the integrity of the task content, the integrity of the data source, and the integrity of the assistance relationship.
[0288] Based on this, in one implementation, the correctness of the decomposition of each of the plurality of subtasks is verified respectively to obtain a first verification result of each of the subtasks, specifically including:
[0289] Performing a first verification on the decomposition correctness of each subtask according to the integrity of the task content of each subtask to obtain a first decomposition verification result;
[0290] Performing a second decomposition check on the decomposition correctness of each subtask according to the data requirement of each subtask to obtain a second decomposition check result;
[0291] Performing a third decomposition check on the decomposition correctness of each subtask according to the data requirement and the result name of each subtask to obtain a third decomposition check result;
[0292] The first verification result of each subtask is determined according to the first decomposition verification result, the second decomposition verification result and the third decomposition verification result of each subtask.
[0293] Specifically, the first decomposition verification result is the decomposition verification result of the integrity of the task content, the second decomposition verification result is the decomposition verification result of the data source integrity, and the third decomposition verification result is the decomposition verification result of the assistance relationship integrity. Among them, the verification condition corresponding to the integrity of the task content can be that the subtask includes task description, data requirements, result name and result content; the verification condition corresponding to the data source integrity can be whether the data requirements in each subtask come from the database or the subtask before the subtask; the verification condition corresponding to the assistance relationship integrity can be that the result name of each subtask except the last subtask is used as a data requirement by at least one subtask, which is used to verify the assistance relationship between subtasks.
[0294] To this end, the process of obtaining the first decomposition verification result can be: check whether each subtask includes "task description", "data requirements", "result name" and "result content". For subtasks that include "task description", "data requirements", "result name" and "result content", the first decomposition verification result is verification passed; for subtasks that lack one or more of "task description", "data requirements", "result name" and "result content", the first decomposition verification result is verification failed.
[0295] The process of obtaining the second decomposition verification result can be: for each subtask, check whether the "data requirement" of the subtask is obtained from the "database", or is the "result name" of the subtask located before it, that is, check whether the value corresponding to the "data requirement" is "database". If not, traverse each value name in the value of the "data requirement" (such as "df4", "df6"), and determine whether each value name is the value name of the "result name" of the preceding subtask of the subtask (such as "df4" is the result name of the subtask "screening out companies with a ratio lower than 5% from df3"). For the subtask whose "data requirement" is "database" or is the "result name" of the subtask located before it, the second decomposition verification result is verification passed. For the subtask whose "data requirement" is not "database" and is not the "result name" of the subtask located before it, the second decomposition verification result is verification failed.
[0296] The process of obtaining the third decomposition verification result can be: for each subtask except the last subtask, check whether the result name of the subtask is called by the subtask located after it is processed, that is, check whether the value corresponding to the "result name" of the subtask (such as the "result name" of the subtask "filter out companies with ratios lower than 5% from df3" is "df4") is the value name taken in the "data requirements" of the subtask located after it is processed (such as "df4" appears in the subtask "union of companies that meet the requirements in df4 and df6"). For the subtask whose result name is called by the subtask located after it is processed, the third decomposition verification result is verification passed; for the subtask whose result name is not called by the subtask located after it is processed, the third decomposition verification result is verification failed.
[0297] Further, after the first decomposition verification result, the second decomposition verification result, and the third decomposition verification result are obtained, the first verification result of the subtask will be determined based on the first decomposition verification result, the second decomposition verification result, and the third decomposition verification result. Specifically, when the first decomposition verification result, the second decomposition verification result, and the third decomposition verification result are all verified to pass, the first verification result is in compliance with integrity; conversely, when the first decomposition verification result, the second decomposition verification result, and the third decomposition verification result are all verified to pass but one or more of them are verified to fail, the first verification result is incompliance with integrity.
[0298] The embodiment of the present application decomposes complex questions into multiple simple and easy-to-handle subtasks, and verifies the decomposed subtasks, which not only helps to improve the accuracy of answers, but also ensures the correctness of each subtask. At the same time, it can also cooperate with subsequent real-time visualization to enable users to understand the execution process and progress of the questions, and can view the execution results of each subtask in real time, which brings convenience to users.
[0299] It should be noted that other methods may also be used when verifying the correctness of the decomposition of several subtasks. For example, several subtasks may be presented to the user, confirmation information from the user on the correctness of the decomposition of the several subtasks may be received, and the verification results of the correctness of the decomposition of the several subtasks may be determined based on the confirmation information. Specifically, when the user's confirmation information is confirmation, it indicates that the verification has passed. Conversely, when the user's confirmation information is rejection, it indicates that the verification has failed.
[0300] Further, in step S32, the first verification result of each subtask is used to reflect the decomposition correctness of each subtask. To this end, after obtaining the first verification results of all subtasks, the data requirements of each subtask can be verified according to the first verification results of all subtasks to determine the data source of the data required by each subtask.
[0301] Exemplarily, verifying the data requirement of each subtask according to the first verification result of each subtask, and obtaining the verification result of each subtask specifically includes:
[0302] If the first verification results of all subtasks are that the decomposition is correct, verify whether the data requirement of each subtask is database data to obtain the verification result of each subtask;
[0303] If the first verification result of at least one subtask is incorrect decomposition, the corrected user question is decomposed again to obtain a number of re-decomposed subtasks; the re-decomposed subtasks are verified to obtain verification results of the re-decomposed subtasks.
[0304] Specifically, when the first verification results of all subtasks are correct decomposition, it means that several subtasks corresponding to the corrected user questions meet the requirements, so that the verification results of the subtasks can be determined according to the data requirements of each subtask, wherein the verification results include database query and data processing, that is, the subtask can be a subtask of data processing, or a subtask of database query, database query is used to indicate that the database needs to be queried to process the subtask, and data processing is used to indicate that the result content of other subtasks needs to be called to process the subtask. In other words, when the data source is a database, it means that the database needs to be queried to process the subtask, and for this reason, the verification result of the subtask is a database; when the data source is a subtask with the result name of at least one subtask among several subtasks, it means that the result content of other subtasks needs to be called to process the subtask, and for this reason, the verification result of the subtask is data processing.
[0305] S40: Process the plurality of subtasks according to the verification result, and visualize the processing result.
[0306] Specifically, the processing result is the task result of the last executed subtask, that is, the subtasks are processed according to the verification result, and after the last subtask is executed, the task result of the last subtask is used as the processing result of the user's question. In addition, since the data source of the data requirements of each subtask can be a database or other subtasks, when the subtasks are processed according to the verification result, the data source of the data requirements of the subtasks can be first determined, and then the subtasks with collaborative relationships between the subtasks can be processed according to the data source, and then the execution order of the subtasks with collaborative relationships can be configured. For example, several subtasks include subtask 1, subtask 2, subtask 3 and subtask 4. Subtask 2 requires the assistance of subtask 1, and subtask 4 requires the assistance of subtask 2 and subtask 3. Then the execution order of subtask 2 is after subtask 1, and the execution order of subtask 4 is after subtask 2 and subtask 3. There is no collaborative relationship between subtask 3 and subtask 1 and subtask 2. Therefore, the execution order of subtask 1, subtask 2 and subtask 3 may not be set. For example, subtask 3 may be executed after subtask 1 is executed, or subtask 3 may be executed after subtask 2 is executed. Subtask 1 and subtask 3 may also be executed in parallel, or subtask 2 and subtask 3 may be executed in parallel, etc.
[0307] Exemplarily, the processing the plurality of subtasks according to the verification result further includes:
[0308] For the subtask whose verification result is a database query, the object name and query condition in the task description of the subtask are obtained, and the result content of the subtask is searched in the database based on the object name and the query condition to obtain the processing result corresponding to the subtask.
[0309] Specifically, for the subtask whose verification result is a database query, the query condition is a restriction condition of the result content, and the data satisfying the query condition is queried in the database by the object name, and the queried data is used as the result content of the subtask. Among them, the database can be a relational database, a non-relational database, a key-value database, etc., and the query method for querying data in the database can adopt an existing method, or a corresponding query method can be selected according to the database type of the database. Here, taking the database as a relational database as an example, the process of searching the result of the subtask in the database based on the object name and the query condition is explained.
[0310] Exemplarily, the result content of searching the database for the subtask based on the object name and the query condition specifically includes:
[0311] Reading a preset template instruction, adding the object name and the query condition to the template instruction to form a query instruction for the subtask;
[0312] Execute the query instruction of the subtask and query the result content of the subtask in the database.
[0313] Specifically, the query condition may be a task restriction condition obtained from the task description, for example, the query condition may be a time range, a stock code, a standard indicator name, etc. The template instruction may be set according to a database, that is, the template instruction may be set according to the database, and then when a query is required in the database, the template instruction corresponding to the database may be called first, and then a query instruction may be generated for the subtask based on the template instruction, and the database query may be performed based on the query instruction. For example, if the database is an SQL database, then the template instruction is a template SQL instruction.
[0314] Furthermore, the template instruction may include an object name, a database name and a query condition, and after obtaining the object name and the query condition, the object name, the query condition and the database name are added to the template instruction to form the query instruction of the subtask.
[0315] For example, the query conditions include time range and stock code, and the table name corresponding to XX Company is t_enterprise_is. The template instruction can be "SELECT{column name}FROM{table name}WHERE TICKER_SYMBOL={stock code}ANDDATE>={start time}AND DATE<={end time}". Then, when the task description of the subtask is to query the operating income data of XX Company in 2023, the query instruction of the subtask is:
[0316] "SELECT the column name corresponding to XX company FROM t_enterprise_is WHERE TICKER_SYMBOL=600519 AND DATE>='2023-01-01'AND DATE<='2023-12-31'".
[0317] The embodiment of the present application can make the database query process simpler while ensuring the correctness and reliability of the database query by setting template instructions and filling the time range and object name (including indicator name and enterprise name) in the subtask into the template instructions.
[0318] It should be noted that before querying data information for each subtask, the time information and object name in the task description of the subtask can be converted so that the time information matches the time information in the database, and the object name corresponds to the column name and table name in the database, so as to improve the success rate of querying data information from the database. To this end, before obtaining the object name and query condition in the task description of the subtask, the method also includes:
[0319] For each subtask, construct a fifth prompt word based on a fifth preset instruction and a fifth example;
[0320] Inputting the fifth prompt word and the task description of the task into a large language model, and converting the time description in the task description into a time range through the large language model;
[0321] The object name in the subtask is read, a mapping name corresponding to the object name is searched in a preset mapping database, and the object name is converted into the mapping name.
[0322] Specifically, the fifth example is pre-set, including the fourth preset question that needs to be converted to time and the conversion result (i.e., the start time and the end time) corresponding to the fourth preset question, wherein the fourth preset question can be used as the fourth input, and the start time and the end time are used as the output of the fourth preset question. That is to say, the fifth example can include the fourth input and the fourth output, the fourth input is the fourth preset question, the fourth output includes the start time and the end time, and the start time and the end time are used to represent the time range of the data requirement. The fifth preset instruction is used to describe the need to extract the time and convert the time into the time range. After obtaining the fifth preset instruction and the fifth example, the fifth example is written in json format to obtain the fifth example in json format, and then the fifth example in json format and the fifth preset instruction are spliced to obtain the fifth prompt word. Then, the fifth prompt word and the task description of the task are input into the large language model, and the time description in the task description (such as "2023" and "nearly half a year") is converted into a specific time range (such as "2023" is converted to "2023-01-01—2023-12-31") through the large language model. Finally, the time range is processed by a regular expression to obtain a corresponding JSON format result, and then the JSON format result is parsed by JSON, that is, the time description in the task description is converted into a time range.
[0323] Furthermore, the preset mapping database is pre-built, which includes the mapping of listed company names to stock codes (such as mapping "Kweichow Moutai" to "600519"), and the mapping of standard indicator names to corresponding column names and table names of SQL data tables (such as naming the column corresponding to "operating income" as "REVENUE" and the table name as "t_enterprise_is"). After obtaining the preset mapping database, the stock code, column name, and table name corresponding to the object name can be determined according to the object name and the preset mapping database.
[0324] To further illustrate the sixth prompt word in the embodiment of the present application, an example 5 is given below as an example of the fifth prompt word.
[0325] Example 5:
[0326] The fifth prompt word is designed as follows:
[0327] Please return the corresponding json data according to the following example (the parameters can only contain "start_date (start time)", "end_date (end time)")
[0328] {
[0329] "Request": "Retrieve 2022 GDP data for all cities from the database",
[0330] "parameter":{
[0331] "start_date": "2022-12-31",
[0332] "end_date": "2022-12-31",
[0333] }
[0334] }.
[0335] In one implementation, the processing the plurality of subtasks according to the verification result further includes:
[0336] For the subtask whose verification result is data processing, the result name of the required associated subtask is determined according to the data requirement of the subtask, the result content of all the associated subtasks is determined according to the result name of the associated subtask, and the result content of the subtask is determined based on the result content of all the associated subtasks and the task description of the subtask, so as to obtain the processing result corresponding to the subtask.
[0337] Specifically, for the subtask whose verification result is a database query, the result name of the other subtask (one or more) required to obtain is determined according to the data requirements in the subtask, and then the result content of the corresponding subtask is obtained according to the result name to obtain the data requirements of the subtask. After obtaining the data requirements of the subtask, the result content of the subtask is determined according to the task description and the data requirements. When determining the result content of the subtask, it can be obtained by directly calculating according to the task description, or by generating an execution code through a large language model, and then determining the result content of the subtask by executing the execution code.
[0338] Exemplarily, determining the result content of the subtask based on the result content of all the associated subtasks and the task description of the subtask specifically includes:
[0339] constructing a sixth prompt word based on the result contents of all the associated subtasks, the task descriptions of the subtasks, and a sixth preset instruction;
[0340] Inputting the sixth prompt word into the large language model, and outputting a preset code of the subtask through the large language model;
[0341] Execute the preset code to obtain the result content of the subtask.
[0342] Specifically, the sixth preset instruction is used to require the large language model to write a preset code, and the sixth prompt word is obtained by splicing all the result contents, the task description of the subtask and the sixth preset instruction, which is used as a detailed description of the task content of the subtask, so that the large language model can well understand the subtask to be executed. The preset code can be Python code or other code, such as C++, Java, etc.
[0343] To further illustrate the sixth prompt word in the embodiment of the present application, an example 6 is given below as an example of the sixth prompt word.
[0344] Example 6: Taking "calculate the ratio of asset impairment loss to total operating cost of the corresponding companies in df1 and df2" as an example, the sixth prompt word can be as follows:
[0345] "Given that DataFrame df1 is the numerical data of asset impairment losses of each company in 2022, and DataFrame df2 is the numerical data of total operating costs of each company in 2022, please write a Python code, take df1 and df2 as input, calculate the ratio of asset impairment losses to total operating costs of the corresponding companies in df1 and df2, and get the ratio of asset impairment losses to total operating costs of each company in 2022. Name the final result df3."
[0346] The embodiment of the present application can make full use of the code writing ability of the large language model, and through the sixth prompt word, the description of the input and output data and the content of the subtask can be clearly informed of the task that needs to be performed by the large language model, so that the large language model can better generate execution code for executing the subtask, thereby improving the execution efficiency of the subtask and the accuracy of the results.
[0347] Furthermore, in the process of processing the several subtasks according to the verification results and visually displaying the processing results, the task results of each subtask can also be visualized in real time, so that the user can understand the execution process and progress of the question and can view the execution results of each subtask in real time. To this end, the visual display of the processing results specifically includes:
[0348] When the processing result of each subtask is obtained, the processing result of each subtask is visualized;
[0349] When the processing results of all subtasks are obtained, the processing results of the obtained subtasks are used as the processing results of the user's questions, and the processing results are visualized.
[0350] Specifically, data visualization of the processing results of each subtask refers to displaying the result content to the user so that the user can obtain the result content of each subtask. Of course, in actual applications, after obtaining the processing results of all subtasks, the result content of all subtasks can be displayed at the same time, or, after obtaining the processing results of all subtasks, only the processing results of the user's question can be displayed.
[0351] In addition, in order to make the processing results of user questions more intuitively presented to users, it is convenient for users to quickly understand the meaning and trend of data, and improve the efficiency and accuracy of data analysis. When visualizing the processing results of user questions, the presentation form can be determined according to the data form of the processing results of user questions, and the processing results of user questions can be presented to users according to the presentation form. To this end, the visual display of the processing results specifically includes:
[0352] Obtaining the data format of the processing result of the user's question;
[0353] Detecting whether the data form belongs to a preset data form set, and obtaining a detection result;
[0354] Determine, according to the detection result, a presentation method of the processing result of the user's question;
[0355] The processing result of the user's question is presented according to the determined presentation method.
[0356] Specifically, the presentation method is the display form of the processing result of the user's question. Specifically, the corresponding relationship between the presentation method and the data form can be pre-set. After obtaining the data form of the processing result of the user's question, the presentation method of the processing result of the user's question is determined according to the corresponding relationship. For example, the corresponding relationship can be that the presentation method corresponding to the single-digit form is to answer the user's question through the large language model according to the processing result of the user's question; the presentation method corresponding to the percentage form is a pie chart; the presentation method corresponding to the time period form is a line chart; the presentation method corresponding to the time point form is a bar chart, etc.
[0357] It can be seen that when the processing result of the user's question is in the form of a single number, there is no need to visualize the processing result of the user's question, and the user's question can be answered directly through the large language model. When the processing result of the user's question is not in the form of a single number, the presentation method is determined according to the data form, so that it can be visualized according to the data characteristics of the processing result of the user's question, so that the data can be better visualized and presented, which is convenient for users to view and analyze. In addition, when the data is in the form of a time period or a time point, in addition to being visualized through its corresponding presentation method, the processing result of the user's question can also be presented synchronously. For example, the processing result of the user's question is standardized into a data structure with the city / enterprise as the column index and the date as the row index, and the data structure is visualized synchronously.
[0358] It should be noted that when the amount of data is large, some data presentation methods cannot well present the processing results of the user's question. To this end, in one implementation, presenting the processing results of the user's question in the presentation method of the processing results of the user's question specifically includes:
[0359] If the detection result belongs to the preset data form set, then detecting the data volume of the processing result of the user's question, and determining the presentation method of the processing result of the user's question according to the relationship between the data volume and the preset threshold;
[0360] If the detection result does not belong to the preset data form set, the processing result of the user's question is directly presented.
[0361] Specifically, the preset data form set is pre-set, and the preset data form set stores the data form that needs to be presented in a preset presentation mode when the amount of data is greater than or equal to a preset threshold, for example, a time period form or a time point form, etc. For this reason, after obtaining the data form of the processing result of the user's question, it can be detected whether the data form of the processing result of the user's question belongs to the preset data form set, and then, for the data form belonging to the preset data form set, the final presentation mode of the processing result of the user's question is determined based on the data amount, wherein when the amount of data is greater than or equal to the preset threshold, the processing result of the user's question is presented in a preset presentation mode; if the amount of data is less than the preset threshold, the processing result of the user's question is presented in accordance with the presentation mode of the processing result of the user's question. In this way, the presentation mode of the processing result of the user's question can be determined in combination with the amount of data included in the processing result of the user's question, so as to improve the presentation effect of the processing result of the user's question. In addition, both the preset threshold and the preset presentation mode can be pre-set, for example, the preset presentation mode is a table mode, etc.
[0362] In summary, the present embodiment provides a method for processing user questions, the method comprising receiving user questions, correcting the user questions, and obtaining corrected user questions; decomposing the corrected user questions to obtain a number of subtasks; verifying the several subtasks to obtain the verification results of the several subtasks, processing the several subtasks according to the verification results, and visually displaying the processing results. The embodiment of the present application will correct user questions to automatically resolve errors, ambiguities or non-professional names that do not conform to the technical field in the user questions, and improve the professionalism of the user questions, so as to accurately respond to the real needs of the user, improve user friendliness and query accuracy. At the same time, the corrected user questions will be split into a number of subtasks, and then each subtask will be processed, which can not only improve the query efficiency and accuracy, but also reduce the burden and error rate of manual operations of users.
[0363] Based on the above method for processing user questions, this embodiment provides a device for processing user questions, such as Figure 5 As shown, the user question processing device specifically includes:
[0364] The correction module 100 is used to receive a user question and correct the user question to obtain a corrected user question;
[0365] A decomposition module 200 is used to decompose the corrected user question to obtain a plurality of subtasks;
[0366] A verification module 300 is used to verify the plurality of subtasks and obtain verification results of the plurality of subtasks;
[0367] The processing module 400 is used to process the plurality of subtasks according to the verification result and to visually display the processing result.
[0368] Based on the above-mentioned method for processing user questions, this embodiment provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in the method for processing user questions as described in the above-mentioned embodiment.
[0369] Based on the above method for processing user questions, the present application also provides a terminal device, such as Figure 6As shown, it includes at least one processor 20; a display screen 21; and a memory 22, and may also include a communications interface 23 and a bus 24. The processor 20, the display screen 21, the memory 22, and the communications interface 23 may communicate with each other through the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setting mode. The communications interface 23 may transmit information. The processor 20 may call the logic instructions in the memory 22 to execute the method in the above embodiment.
[0370] In addition, the logic instructions in the memory 22 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0371] The memory 22 is a computer-readable storage medium that can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 22, that is, implementing the methods in the above embodiments.
[0372] The memory 22 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 22 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, may also be a transient storage medium.
[0373] In addition, the specific process of loading and executing the multiple instruction processors in the above-mentioned storage medium and the terminal device has been described in detail in the above-mentioned method, and will not be described one by one here.
[0374] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing user questions, characterized in that: The method for processing user questions specifically includes: receiving a user question, and correcting the user question to obtain a corrected user question; Decomposing the corrected user question to obtain a number of subtasks; Verifying the plurality of subtasks to obtain verification results of the plurality of subtasks; Processing the plurality of subtasks according to the verification results, and visually displaying the processing results; The receiving of the user's question and correcting the user's question to obtain the corrected user's question specifically includes: receiving the user's question and identifying the question category corresponding to the user's question; Selecting a second example corresponding to the user's question according to the question classification, wherein the second example includes a first input and a first output, the first input includes a plurality of first preset questions, the first output includes first object information of each first preset question, and the first object information includes a first object name and a first object type; Determining a second prompt word according to the second example and the second preset instruction, wherein the second preset instruction is used to describe the need to extract the first object information; Inputting the user question and the second prompt word into a large language model, outputting the first object information in the user question through the large language model, and modifying the first object name in the first object information to obtain a first modified user question; Based on the question classification and the first modified user question, second object information in the user question is determined through a large language model, and the object value in the second object information is modified to obtain a modified user question.
2. The method for processing user questions according to claim 1, characterized in that: The receiving the user's question and identifying the question category corresponding to the user's question specifically includes: Receive a user question, and construct a first prompt word for the user question, wherein the first prompt word includes a first preset instruction and a first example, and the first example includes a classification example and a question classification corresponding to the classification example; Based on the first prompt word and the user question, a classification of the question asked by the user is determined by a large language model.
3. The method for processing user questions according to claim 1, characterized in that: The step of modifying the first object name in the first object information to obtain a first modified user question specifically includes: Matching the first object name in the first object information with a standard name in a preset standard name library; If the standard name is not matched, a preset number of standard names with the highest matching degree with the first object name are selected from the preset standard name library, and the first object name is corrected based on the selected preset number of standard names to obtain a first corrected user question.
4. The method for processing user questions according to claim 1, characterized in that: The determining the second object information in the user question by using a large language model based on the question classification and the first modified user question specifically includes: Selecting a third example corresponding to the user's question according to the question classification, wherein the third example includes a second input and a second output, the second input includes a plurality of second preset questions, the second output includes second object information of each second preset question, and the second object information includes a second object name, a second object type, and an object value; Determining a third prompt word according to the third example and a third preset instruction, wherein the third preset instruction is used to describe the need to extract the second object information; The first modified user question and the third prompt word are input into a large language model, and the second object information in the user question is output through the large language model.
5. The method for processing user questions according to claim 4, characterized in that: When the numerical unit of the object value in the second object information in the second preset question is inconsistent with the standard numerical unit, the second output further includes a problem; Modifying the object value in the second object information to obtain a modified user question specifically includes: If the second object information in the user's question includes an existence question, determining a modification reference value of the object value of the second object information; The object value in the second object information is modified based on the modification reference value to obtain a revised user question.
6. The method for processing user questions according to claim 1, characterized in that: Decomposing the corrected user question to obtain several subtasks specifically includes: Selecting a fourth example, and constructing a fourth prompt word based on the fourth example and a fourth preset instruction, wherein the fourth example includes a third input and a third output, the third input includes a third preset question, and the third output includes a plurality of subtasks decomposed according to the third preset question; Based on the fourth prompt word and the corrected user question, the corrected user question is decomposed by a large language model to obtain a plurality of subtasks.
7. The method for processing user questions according to claim 1, characterized in that: The task content of the subtask includes data requirements; the verifying the subtasks to obtain the verification results of the subtasks specifically includes: Verifying the decomposition correctness of each of the plurality of subtasks to obtain a first verification result of each of the subtasks; The data requirements of each subtask are verified respectively according to the first verification result of each subtask to obtain the verification result of each subtask.
8. The method for processing user questions according to claim 7, characterized in that: The task content of the subtask also includes a task description, a result name, and a result content; the decomposition correctness of each of the plurality of subtasks is verified respectively to obtain a first verification result of each subtask specifically including: Performing a first verification on the decomposition correctness of each subtask according to the integrity of the task content of each subtask to obtain a first decomposition verification result; Performing a second decomposition check on the decomposition correctness of each subtask according to the data requirement of each subtask to obtain a second decomposition check result; Performing a third decomposition check on the decomposition correctness of each subtask according to the data requirement and the result name of each subtask to obtain a third decomposition check result; The first verification result of each subtask is determined according to the first decomposition verification result, the second decomposition verification result and the third decomposition verification result of each subtask.
9. The method for processing user questions according to claim 7, characterized in that: Verifying the data requirements of each subtask according to the first verification result of each subtask to obtain the verification result of each subtask specifically includes: If the first verification results of all subtasks are that the decomposition is correct, verify whether the data requirement of each subtask is database data to obtain the verification result of each subtask; If the first verification result of at least one subtask is incorrect decomposition, the corrected user question is decomposed again to obtain a number of re-decomposed subtasks; the re-decomposed subtasks are verified to obtain verification results of the re-decomposed subtasks.
10. The method for processing user questions according to claim 1, characterized in that: The processing of the plurality of subtasks according to the verification result includes: For the subtask whose verification result is a database query, the object name and query condition in the task description of the subtask are obtained, and the result content of the subtask is searched in the database based on the object name and the query condition to obtain the processing result corresponding to the subtask.
11. The method for processing user questions according to claim 10, characterized in that: The result content of searching the database for the subtask based on the object name and the query condition specifically includes: Obtaining a preset template instruction, and adding the object name and query condition to the template instruction to form a query instruction for the subtask; Execute the query instruction of the subtask and query the result content of the subtask in the database.
12. The method for processing user questions according to claim 10 or 11, characterized in that: Before obtaining the object name and query condition in the task description of the subtask, the method further includes: For the subtask whose verification result is a database query, a fifth prompt word is constructed based on a fifth preset instruction and a fifth example, wherein the fifth example includes a fourth input and a fourth output, the fourth input is a fourth preset question, the fourth output includes a start time and an end time, and the fifth preset instruction is used to describe the need to extract the time and convert the time into a standard time range; Inputting the fifth prompt word and the task description of the subtask into a large language model, and converting the time description in the task description into a standard time range through the large language model; The object name in the subtask is obtained, a mapping name corresponding to the object name is searched in a preset mapping database, and the object name is converted into the mapping name.
13. The method for processing user questions according to claim 1, characterized in that: The processing of the plurality of subtasks according to the verification result further includes: For the subtask whose verification result is data processing, the result name of the required associated subtask is determined according to the data requirement of the subtask, the result content of all the associated subtasks is determined according to the result name of the associated subtask, and the result content of the subtask is determined based on the result content of all the associated subtasks and the task description of the subtask, so as to obtain the processing result corresponding to the subtask.
14. The method for processing user questions according to claim 13, characterized in that: Determining the result content of the subtask based on the result content of all the associated subtasks and the task description of the subtask specifically includes: constructing a sixth prompt word based on the result contents of all the associated subtasks, the task descriptions of the subtasks, and a sixth preset instruction, wherein the sixth preset instruction is used to require the large language model to write a preset code; Inputting the sixth prompt word into a large language model, and outputting a preset code of the subtask through the large language model; Execute the preset code to obtain the result content of the subtask.
15. The method for processing user questions according to claim 1, characterized in that: The visual display of the processing results specifically includes: When the processing result of each subtask is obtained, the processing result of each subtask is visualized; When the processing results of all subtasks are obtained, the last processing result of the obtained subtask is used as the processing result of the user's question, and the processing result of the user's question is visualized.
16. The method for processing user questions according to claim 1 or 15, characterized in that: The visual display of the processing results specifically includes: Obtaining the data format of the processing result of the user's question; Detecting whether the data form belongs to a preset data form set, and obtaining a detection result; Determine, according to the detection result, a presentation method of the processing result of the user's question; The processing result of the user's question is presented according to the determined presentation method.
17. The method for processing user questions according to claim 16, characterized in that: The method of presenting the processing result of the user's question determined according to the detection result specifically includes: If the detection result belongs to the preset data form set, then detecting the data volume of the processing result of the user's question, and determining the presentation method of the processing result of the user's question according to the relationship between the data volume and the preset threshold; If the detection result does not belong to the preset data form set, the processing result of the user's question is directly presented.
18. A device for processing user questions, characterized in that: The user question processing device specifically includes: A correction module, used for receiving a user question and correcting the user question to obtain a corrected user question; A decomposition module, used for decomposing the corrected user question into a plurality of subtasks; A verification module, used to verify the plurality of subtasks and obtain verification results of the plurality of subtasks; A processing module, used to process the plurality of subtasks according to the verification result and to visually display the processing result; The receiving of the user's question and correcting the user's question to obtain the corrected user's question specifically includes: receiving the user's question and identifying the question category corresponding to the user's question; Selecting a second example corresponding to the user's question according to the question classification, wherein the second example includes a first input and a first output, the first input includes a plurality of first preset questions, the first output includes first object information of each first preset question, and the first object information includes a first object name and a first object type; Determining a second prompt word according to the second example and the second preset instruction, wherein the second preset instruction is used to describe the need to extract the first object information; Inputting the user question and the second prompt word into a large language model, outputting the first object information in the user question through the large language model, and modifying the first object name in the first object information to obtain a first modified user question; Based on the question classification and the first modified user question, second object information in the user question is determined through a large language model, and the object value in the second object information is modified to obtain a modified user question.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the method for processing user questions as described in any one of claims 1-17.
20. A terminal device, characterized in that: include: Processor and memory; The memory stores a computer-readable program executable by the processor; When the processor executes the computer-readable program, the processor implements the steps in the method for processing user questions as described in any one of claims 1 to 17.
Citation Information
Patent Citations
Problem generation method and system based on text content and related equipment
CN118378597A
Rational thinking method
CN118821941A