Question and answer processing method, electronic device and readable storage medium

Through the structured sorting and retrieval of question statements, the use of generative models is enhanced, and combined with natural language models and multi-agent models, the mode switching of data between structured and unstructured data is realized, which solves the problem of inability to output in the existing technology. The problem of stabilizing structured results improves the accuracy and stability of information retrieval.

CN118503397BActive Publication Date: 2024-10-11WUXI XUELANG DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410962434.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-10-11
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

The existing technology cannot output stable structured results when faced with complex retrieval tasks, and large language models lack data computing capabilities and cannot implement data analysis and mathematical statistics. Natural language programming methods cannot directly process unstructured information. Agent technology has strong uncertainty and weak stability.

Method used

By structuring the question statements, we use the retrieval enhancement generation model and the natural language model to search in the unstructured database, generate structured target retrieval data, and combine it with the multi-agent model to analyze the data types in the output table. and integrated processing to achieve mode switching between structured and unstructured data.

Benefits of technology

It improves the accuracy and stability of information retrieval, meets the unstructured format requirements of large language models and the formatted data format requirements of natural language models, making the output data highly interpretable, and the overall process is clear and user-friendly. Check.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118503397B_ABST
    Figure CN118503397B_ABST
Patent Text Reader

Abstract

The present application provides a question-answering processing method, an electronic device, and a readable storage medium, wherein the method includes: structurally processing a question statement to obtain initial data, using a retrieval enhancement generation model to search in a database based on integrated target integrated data to generate target retrieval data, converting the target retrieval data into a table to be output, performing data analysis and integration processing on the table to be output based on a natural language model and a multi-agent model to obtain a target output table, and integrating the above process data and the target output table to obtain the target output data. The present application searches according to the sorted question statement, and inputs the target retrieval result into the natural language model and the multi-agent model after structural processing, thereby realizing the switching of data between structured and unstructured, meeting the format requirements of the large language model and the natural language model, and integrating the process data and the target output table to make the target output data interpretable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of retrieval processing, and in particular to a question and answer processing method, an electronic device and a readable storage medium. Background Art

[0002] Since the development of artificial intelligence, the existing large language models can be applied to ordinary information retrieval tasks and intelligent question-answering processing. However, for more complex situations, that is, when the retrieved data information is distributed in various unstructured materials, the large language model cannot use natural language for retrieval queries while performing certain data screening and structured output to meet user needs.

[0003] Therefore, the existing technology proposes to use retrieval enhancement generation technology in combination with a large language model, a natural language programming method based on a large language model, and multi-agent technology to cope with more complex retrieval tasks and question-answering needs.

[0004] However, in the prior art, although the retrieval enhancement generation technology can ensure the accuracy and reliability of the retrieval, the large language model combined with it, as a probabilistic statistical model, lacks data computing capabilities and cannot achieve strong computational goals such as data analysis and mathematical statistics. At the same time, the input and output of the large language model are both unstructured data, which cannot meet the needs of structured input and output. Natural language programming methods cannot directly process unstructured information. Multi-agent technology has strong uncertainty and weak stability. Therefore, when faced with more complex retrieval task requirements, the above-mentioned prior art cannot output stable structured results. Summary of the invention

[0005] The purpose of this application is to provide a question-answering processing method, an electronic device and a readable storage medium to address the deficiencies in the prior art, so as to solve the problems of insufficient accuracy and inability to meet complex user needs in the prior art.

[0006] To achieve the above objectives, the technical solutions adopted in this application are as follows:

[0007] In a first aspect, the present application provides a question-answering processing method, the method comprising:

[0008] Structuring the acquired question statements to obtain structured initial data, wherein the initial data includes subject data, condition data, and requirement data;

[0009] Integrate the initial data based on the prompt word engineering model to obtain target integrated data, use the retrieval enhancement generation model to search in an unstructured database based on the target integrated data to generate target retrieval data, the target integrated data includes target subject data, target condition data and target requirement data, the target retrieval data includes a plurality of structured character strings, the prompt word engineering model is a model that guides the large language model to generate expected output by setting specific inputs, and the retrieval enhancement generation model is a model formed by combining the retrieval enhancement generation algorithm with the large language model;

[0010] Convert the target search data into a table to be output by using regular matching;

[0011] Based on the natural language model and the multi-agent model, the table to be output is parsed and integrated according to the data type of each column of data in the table to be output and the initial data to obtain a target output table;

[0012] Integrate the initial data, the target search data, the table to be output and the target output table to obtain target output data;

[0013] The method of using the retrieval enhancement generation model to search the unstructured database based on the target integrated data to generate target retrieval data includes:

[0014] The retrieval enhancement generation model searches the unstructured database based on the target subject data in the target integrated data to obtain first retrieval data, wherein the first retrieval data includes a plurality of character strings;

[0015] The retrieval enhancement generation model searches the first retrieval data based on the target integrated data to obtain target retrieval data.

[0016] Optionally, performing data parsing and integration processing on the table to be output according to the data type of each column of data in the table to be output and the initial data to obtain a target output table includes:

[0017] Traversing each column of data in the table to be output, and determining the data type of the current column of data according to the traversed current column of data;

[0018] If the data type of the current column data is text data, determining text target data based on the natural language model, according to the initial data and the current column data;

[0019] If the data type of the current column data is numerical data, then based on the multi-agent model, output numerical target data according to the initial data and the current column data;

[0020] After the traversal of the table to be output is completed, the text-type target data and the numerical-type target data are integrated to obtain the target output table.

[0021] Optionally, the determining text-type target data based on the natural language model and according to the initial data and the current column data includes:

[0022] The natural language model is used to calculate the average semantic similarity between the initial data and each character string in the current column data, and the average semantic similarity of each character string is sorted, and the sorting result is used as text-type target data.

[0023] Optionally, the outputting numerical target data based on the multi-agent model and the initial data and the current column data includes:

[0024] The current column data and the initial data are input into the multi-agent model, and the multi-agent model analyzes and processes the input current column data and the initial data to output numerical target data.

[0025] Optionally, before inputting the current column data and the initial data into the multi-agent model, the method comprises:

[0026] Determine non-numeric elements in the current column data, and remove the non-numeric elements.

[0027] Optionally, the obtained question statements are structured to obtain structured initial data, including:

[0028] Using the prompt word engineering model, the question sentence is structured and organized to generate data to be integrated, wherein the data to be integrated includes subject data, condition data and requirement data;

[0029] The initial data is generated according to the data to be integrated.

[0030] Optionally, generating the initial data according to the data to be integrated includes:

[0031] Regular matching is performed on the subject data, the condition data and the requirement data to obtain the structured initial data.

[0032] In a second aspect, the present application provides a question-answer processing device, the device comprising:

[0033] An acquisition module, used for structuring the acquired question statements to obtain structured initial data, wherein the initial data includes subject data, condition data and requirement data;

[0034] A retrieval module is used to integrate the initial data based on the prompt word engineering model to obtain target integrated data, and use the retrieval enhancement generation model to search in an unstructured database based on the target integrated data to generate target retrieval data, wherein the target integrated data includes target subject data, target condition data and target requirement data, and the target retrieval data includes a plurality of structured character strings, the prompt word engineering model is a model that guides the large language model to generate expected outputs by setting specific inputs, and the retrieval enhancement generation model is a model formed by combining the retrieval enhancement generation algorithm with the large language model;

[0035] A conversion module, used for converting the target search data into a table to be output by using regular matching;

[0036] A parsing module is used to parse and integrate the data of the table to be output according to the data type of each column of data in the table to be output and the initial data based on the natural language model and the multi-agent model to obtain a target output table;

[0037] An integration module, used for integrating the initial data, the target search data, the table to be output and the target output table to obtain target output data;

[0038] The retrieval module is specifically used for:

[0039] The retrieval enhancement generation model searches the unstructured database based on the target subject data in the target integrated data to obtain first retrieval data, wherein the first retrieval data includes a plurality of character strings;

[0040] The retrieval enhancement generation model searches the first retrieval data based on the target integrated data to obtain target retrieval data.

[0041] Optionally, the parsing module is specifically used for:

[0042] Traversing each column of data in the table to be output, and determining the data type of the current column of data according to the traversed current column of data;

[0043] If the data type of the current column data is text data, determining text target data based on the natural language model, according to the initial data and the current column data;

[0044] If the data type of the current column data is numerical data, then based on the multi-agent model, output numerical target data according to the initial data and the current column data;

[0045] After the traversal of the table to be output is completed, the text-type target data and the numerical-type target data are integrated to obtain the target output table.

[0046] Optionally, the parsing module is specifically used for:

[0047] The natural language model is used to calculate the average semantic similarity between the initial data and each character string in the current column data, and the average semantic similarity of each character string is sorted, and the sorting result is used as text-type target data.

[0048] Optionally, the parsing module is specifically used for:

[0049] The current column data and the initial data are input into the multi-agent model, and the multi-agent model analyzes and processes the input current column data and the initial data to output numerical target data.

[0050] Optionally, the parsing module is specifically used for:

[0051] Determine non-numeric elements in the current column data, and remove the non-numeric elements.

[0052] Optionally, the acquisition module is specifically used for:

[0053] Using the prompt word engineering model, the question sentence is structured and organized to generate data to be integrated, wherein the data to be integrated includes subject data, condition data and requirement data;

[0054] The initial data is generated according to the data to be integrated.

[0055] Optionally, the acquisition module is specifically used for:

[0056] Regular matching is performed on the subject data, the condition data and the requirement data to obtain the structured initial data.

[0057] In a third aspect, the present application provides an electronic device comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the above-mentioned question and answer processing method.

[0058] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned question and answer processing method are executed.

[0059] The beneficial effects of the present application are: by converting the question statement into structured initial data, the core information in the question statement is extracted. And by using the retrieval enhancement generation model to retrieve the target integrated data in the unstructured database, the target retrieval data is structured, and then based on the natural language model and the multi-agent model, the data in each column of the output table is parsed and integrated. This process realizes the mode switching between structured and unstructured data, and at the same time meets the unstructured format requirements of the large language model and the formatted data format requirements of the natural language model. In addition, by including the initial data, target retrieval data and process data such as the table to be output in the target output data, the target output data has strong interpretability, the overall process is clear, and it is convenient for users to check. The above steps realize a fully automatic end-to-end information retrieval and question-answering processing process, which greatly improves the accuracy and stability of information retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0061] Figure 1 It is a flowchart of a question-and-answer processing method provided in an embodiment of the present application;

[0062] Figure 2 It is a flowchart of a target output table provided in an embodiment of the present application;

[0063] Figure 3 It is a flowchart of a target output table provided in an embodiment of the present application;

[0064] Figure 4 It is a flowchart of another question-and-answer processing method provided in an embodiment of the present application;

[0065] Figure 5 is a structural diagram of a question-and-answer processing device provided in an embodiment of the present application;

[0066] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme 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. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0068] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0069] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0070] Existing technologies propose to use retrieval enhancement generation technology combined with large language models, natural language programming methods based on large language models, and multi-agent technology to cope with more complex retrieval task requirements.

[0071] Specifically, the search enhancement generation technology combined with the large language model can achieve in-depth understanding and efficient answers to user questions through multiple steps such as query processing, data retrieval, document optimization, enhancement generation, semantic understanding, document structuring and self-enhancement. However, as a probabilistic statistical model, the large language model combined with the search enhancement generation technology itself lacks data computing capabilities and cannot achieve strong computational goals such as data analysis and mathematical statistics. At the same time, the input and output of the large language model are both unstructured data, which cannot meet the user's needs for structured input and output.

[0072] The natural language programming method based on the large language model uses deep learning and natural language processing to make the programming language closer to natural language, thereby lowering the programming threshold and improving programming efficiency. However, the natural language programming method cannot directly process unstructured information. Therefore, it cannot directly meet the user's structured input and output needs.

[0073] Multi-agent technology combines tools such as prompt word engineering and search enhancement generation to autonomously solve practical problems using artificial intelligence technology and non-artificial intelligence tools. However, multi-agent technology has strong uncertainty and weak stability.

[0074] In summary, the above-mentioned existing technologies cannot output stable structured results when facing more complex retrieval tasks and question-answering requirements.

[0075] Based on this, the present application proposes a question-answering processing method, which first structures the question sentence input by the user, and then uses the retrieval enhancement generation model to search the initial data integrated based on the prompt word engineering model in the unstructured database to generate target retrieval data, and after converting the target retrieval data into a table to be output, the data in each column of the table is parsed and integrated based on the natural language model and the multi-agent model to obtain the target output table. Then, the process data and the target output table obtained in each process are integrated to output the target output data. In the above process, the target integrated data is retrieved in the unstructured database by using the retrieval enhancement generation model, the target retrieval data is structured, and then the data in each column of the output table is parsed and integrated based on the natural language model and the multi-agent model. This process realizes the mode switching between structured and unstructured data, and meets the unstructured format requirements of the large language model and the formatted data format requirements of the natural language model, overcoming the defects that the large language model cannot input and output structured data, and the natural language model cannot input and output unstructured data. By including initial data, target retrieval data, and process data such as the table to be output in the target output data, the target output data has strong interpretability, the overall process is clear, and it is easy for users to check.

[0076] Optionally, the question-answer processing method can be applied to an electronic device. After a user inputs a question-answer statement to the electronic device, the electronic device retrieves the data required by the user from an unstructured database, and then integrates the data into structured data and displays it to the user.

[0077] Figure 1 is a flowchart of a question-answering processing method provided in an embodiment of the present application. Figure 1 The question and answer processing method is explained.

[0078] S101. Structuring the obtained question statements to obtain structured initial data, where the initial data includes subject data, condition data and requirement data.

[0079] The question statement may be a natural language input by the user, and the question statement may be structured and organized through a large language model to obtain data to be integrated in a structured form, and then the data to be integrated may be structured to generate initial data, wherein the initial data may be a Pandas DataFrame table, a csv file, or an excel file, etc.

[0080] Optionally, the initial data includes subject data, condition data and requirement data, wherein the subject data is the subject of the user's request for retrieval, the condition data is each parameter in the subject of the user's request for retrieval, and the requirement data is the specific parameter value corresponding to each condition data.

[0081] For example, if the question statement entered by the user is: looking for a motor, requiring an asynchronous generator with a power greater than 60 kilowatts, a frequency of 50 Hz, and a rated speed greater than 4000 rpm, then the main data is: asynchronous generator, the conditional data is: power, frequency and rated speed, and the required data is: greater than 60 kilowatts, 50 Hz and more than 4000 rpm. Figure 2 is a schematic diagram of data to be integrated provided in an embodiment of the present application, such as Figure 2 As shown, Figure 2 The data to be integrated in the example is structured data output by the electronic device. Taking the initial data as an Excel file as an example, it can be shown in Table 1:

[0082] Table 1 Initial data

[0083]

[0084] S102. Integrate the initial data based on the prompt word engineering model to obtain target integrated data, use the retrieval enhancement generation model to search in the unstructured database based on the target integrated data to generate target retrieval data, the target integrated data includes target subject data, target condition data and target requirement data, the target retrieval data includes multiple structured character strings, the prompt word engineering model is a model that guides the large language model to generate the expected output by setting specific inputs, and the retrieval enhancement generation model is a model formed by combining the retrieval enhancement generation algorithm and the large language model.

[0085] Optionally, the prompt word engineering model can be a model that guides a large language model to generate expected output by setting specific inputs. Based on the prompt word engineering model, the main data, condition data and requirement data in the initial data can be repackaged and integrated respectively to obtain target main data, target condition data and target requirement data, so that the retrieval enhancement generation model can screen out relevant character strings in the unstructured database based on the target integrated data.

[0086] The retrieval enhancement generation model is a model formed by combining the retrieval enhancement generation algorithm with the large language model. First, the retrieval enhancement generation model searches the unstructured database based on the target integrated data to generate the post-retrieval data, and then integrates the post-retrieval data through the large language model and the prompt word engineering model to obtain the target retrieval data.

[0087] It is worth mentioning that the target retrieval data is a string in structured form, such as a string in JSON format.

[0088] As an optional implementation, before searching the unstructured database based on the target integrated data using the retrieval enhancement generation model, external resources can also be configured. Specifically, the object storage database and the vectorized database are sorted, and the data provided by the user is received. The data can be a retrieval object, usually in the form of a document. The electronic device parses the data, and inputs the parsed data into the vectorized language model for vector encoding, and then stores the encoded data in unstructured databases such as the vector database and the object storage database to enrich the content of the structured database.

[0089] S103, using regular matching to convert the target search data into a table to be output.

[0090] Optionally, since the target search data is a string in a structured form, it is necessary to convert the target search data into a table to be output through regular matching, and the table to be output is structured data.

[0091] Optionally, each column in the table to be output is data that satisfies the main data and the required data corresponding to each conditional data.

[0092] S104, based on the natural language model and the multi-agent model, the data to be outputted is analyzed and integrated according to the data type of each column of data in the table to be outputted and the initial data, to obtain the target output table.

[0093] Among them, the natural language model is a large language model combined with a natural language processing method. This model is used in combination with a multi-agent model to perform data analysis on the output table according to the data type of each column of data in the output table and the initial data. Specifically, the natural language model can autonomously generate codes based on the natural language of the conditional data and requirement data in the initial data, and perform data analysis on the output table according to the data type of each column of data in the output table and the initial data, so as to achieve strong computational goals such as data analysis and mathematical statistics.

[0094] On the basis of generating the data analysis and processing results, the intermediate data and data analysis and processing structure of the above data analysis and processing are integrated and processed using the large language model to obtain the target output table. Specifically, since the data types of the columns of data in the output table are different, the data processing methods for different data types are different. The data type can be text data or numerical data. For text data, the semantic similarity can be analyzed and processed. For numerical data, the multi-agent model can be used for analysis and processing. The intermediate data is the analysis and processing results corresponding to the above different data types.

[0095] S105, integrating the initial data, the target search data, the table to be output and the target output table to obtain the target output data.

[0096] Optionally, the large language model can be used to integrate the initial data, target search data, process data such as the table to be output, and the target output table to output the target output data. The target output data reflects the process data and result data in the question-answering processing method, so that the output target output data has strong interpretability, and while achieving end-to-end, the user can monitor the entire processing process for easy troubleshooting.

[0097] As an optional implementation, the process data may not be limited to the initial data, target retrieval data and the table to be output, but may also include more detailed processing data in each step, which is not limited in this embodiment.

[0098] Specifically, the target output data may be output in a preset format. For example, the target output data may be in a plurality of tables.

[0099] It is worth noting that the question-answering processing method is an end-to-end processing method based on a large language model. After the user inputs a question statement, the electronic device can use the question-answering processing method to directly output target output data containing various process data to the user, thereby meeting complex retrieval tasks and user needs.

[0100] In this embodiment, the question sentence input by the user is firstly structured and sorted to obtain structured initial data, and then the initial data integrated by the prompt word engineering model is retrieved in the unstructured database by using the retrieval enhancement generation model to generate target retrieval data. After the target retrieval data is converted into a table to be output, the data in the table is parsed and integrated according to the data type of each column of data in the table to be output based on the natural language model and the multi-agent model to obtain the target output table. Finally, the initial data, the target retrieval data, the table to be output and the target output table are integrated to obtain the target output data. The core information in the question sentence is extracted by converting the question sentence into structured initial data. The target integrated data is retrieved in the unstructured database by using the retrieval enhancement generation model, the target retrieval data is structured, and then the data in each column of the table to be output is parsed and integrated based on the natural language model and the multi-agent model. This process realizes the mode switching between structured and unstructured data, and meets the unstructured format requirements of the large language model and the formatted data format requirements of the natural language model. In addition, by including the initial data, target search data, and process data such as the table to be output in the target output data, the target output data has strong interpretability, the overall process is clear, and it is easy for users to check. The above steps realize the fully automatic end-to-end information retrieval and question-answering processing process, greatly improving the accuracy and stability of information retrieval.

[0101] Next, the specific process of using the retrieval enhancement generation model in the above step S102 to search the unstructured database based on the target integrated data and generate the target retrieval data is explained:

[0102] Optionally, the retrieval enhancement generation model searches the unstructured database based on the target subject data in the target integrated data to obtain first retrieval data, where the first retrieval data includes a plurality of character strings.

[0103] Specifically, the repackaged target subject data is searched in the unstructured database. If there are multiple target subject data, the first search data is the relevant information of all target subject data.

[0104] Optionally, the retrieval enhancement generation model searches the first retrieval data based on the target integrated data to obtain target retrieval data.

[0105] Specifically, the search enhancement generation model searches the first search data based on the target subject data, target condition data and target requirement data in the target integrated data to obtain the target search data. Since the first search data is all the character strings related to the subject data in the unstructured database, this step is a further search based on the requirement data and condition data, that is, searching in the multiple character strings contained in the first search data to obtain a set containing multiple character strings.

[0106] As an optional implementation, the retrieval enhancement model may be replaced with a model based on keyword retrieval, or the retrieval enhancement model and the model based on keyword retrieval may be combined to perform retrieval processing.

[0107] In this embodiment, the retrieval enhancement generation model first searches in an unstructured database based on the target subject data to obtain first retrieval data, and then searches in the first retrieval data based on the target integrated data to obtain target retrieval data, thereby performing information retrieval in an orderly manner layer by layer, greatly improving the accuracy of information retrieval under complex conditions.

[0108] Figure 3 This is a flow chart of a target output table provided in an embodiment of the present application. Figure 3 The specific steps of performing data analysis and integration processing on the table to be output according to the data type of each column of data in the table to be output and the initial data to obtain the target output table in the above step S104 are introduced as follows:

[0109] S301, traversing each column of data in the table to be output, and determining the data type of the current column of data that has been traversed.

[0110] Specifically, the data type of the current column data can be determined based on regular matching. The current column data includes text data and numerical data according to data type. Text data does not contain numerical content, and numerical data can contain part of text data.

[0111] As an optional implementation, an intelligent judgment method based on a large language model may be used to judge the data type of the current column data.

[0112] S302: If the data type of the current column data is text data, determine text target data based on the natural language model, according to the initial data and the current column data.

[0113] Optionally, if the current column data is text data, it may include multiple character strings related to the main data and condition data. In step S302, data that meets the required data in the initial data can be screened out from the multiple character strings and used as text target data. This enables hierarchical retrieval and screening, and improves the accuracy of the question-answering results.

[0114] Among them, based on the natural language model, the text-type target data is determined according to the requirement data corresponding to each condition data contained in each initial data of the current column data and the initial data. Specifically, for the current column data, the semantic similarity is compared with the requirement data corresponding to the condition data contained in each initial data, and the semantic similarity comparison result is used as the text-type target data.

[0115] S303. If the data type of the current column data is numerical data, based on the multi-agent model, output numerical target data according to the initial data and the current column data.

[0116] Optionally, if the current column data is numerical data, it may include multiple character strings related to the main data and conditional data, and through step S302, data that meets the required data in the initial data can be screened out from the multiple character strings and used as numerical target data, thereby achieving hierarchical retrieval and screening and improving the accuracy of the question and answer results.

[0117] Optionally, if the data type of the current column data is numerical data, autonomous encoding is performed based on the initial data based on the multi-agent model, so as to perform data analysis and calculation on the current column data and realize complex operations such as data screening and judgment.

[0118] As an optional implementation, a pre-trained model can be learned based on a small sample to output numerical target data. This implementation can be applied to specific usage scenarios to improve screening accuracy.

[0119] S304: After the traversal of the table to be output is completed, the text-type target data and the numerical-type target data are integrated to obtain a target output table.

[0120] For the natural language model and the multi-agent model, the input and output are both structured data, so the text target data and the numerical target data are both structured data. In step S304, the text target data and the numerical target data are integrated to generate a target output table.

[0121] As an optional implementation, the target output table may include not only text target data and numerical target data, but also intermediate data in the natural language model processing process and intermediate data of the multi-agent model. This embodiment is not limited here.

[0122] In this embodiment, by traversing each column of data in the table to be output, the data type of the current column data is determined for the traversed current column data. If it is numerical data, the numerical target data is output based on the multi-agent model according to the initial data and the current column data. If it is numerical data, the numerical target data is output based on the multi-agent model according to the initial data and the current column data. The above method is used to further search and filter column data of different data types to improve the accuracy of the output results. After the traversal of the table to be output is completed, the text target data and the numerical target data are integrated to obtain the target output table. Since the target output table contains the intermediate data in the processing process, it has strong interpretability and is convenient for users to check.

[0123] Next, the specific steps of determining the text-type target data based on the natural language model in step S302 according to the initial data and the current column data are introduced:

[0124] Optionally, a natural language model is used to calculate the average semantic similarity between the initial data and each character string in the current column data, and the average semantic similarity of each character string is sorted, and the sorting result is used as the text-type target data.

[0125] Specifically, the natural language processing programming capability of the large language model is used to calculate the average semantic similarity between the requirement data corresponding to each condition data contained in the initial data and each character string. Specifically, the higher the average semantic similarity, the more the current character string meets the requirements of the requirement data corresponding to the condition data. Conversely, the lower the average semantic similarity, the less the current character string meets the requirements of the requirement data corresponding to the condition data.

[0126] As an optional implementation, the average semantic similarity of each character string is sorted, and the character strings within a preset range are used as text-type target data. Specifically, the similarity can be sorted from high to low, and the character strings sorted in the front preset range are used as text-type target data. Exemplarily, the preset range can be 1, that is, the character string that best meets the required data is used as the text-type target data.

[0127] In this embodiment, by utilizing a natural language model, the average semantic similarity between the initial data and each character string in the current column data is calculated, and the average semantic similarity of each character string is sorted. The sorting result is used as text target data, thereby screening each character string in the current column data to obtain more accurate text target data.

[0128] Next, the specific steps of outputting numerical target data based on the multi-agent model according to the initial data and the current column data in step S303 are introduced:

[0129] Optionally, the current column data and the initial data are input into the multi-agent model, and the multi-agent model analyzes and processes the input current column data and the initial data to output numerical target data.

[0130] Among them, the multi-agent model can perform autonomous intelligent coding according to the initial data. Specifically, the screening and judgment codes are set according to the required data corresponding to each conditional data in the initial data. When the current column data is received, the current column data is analyzed and screened, and the data that meets the required data is used as the numerical target data.

[0131] It is worth noting that before inputting the current column data and the initial data into the multi-agent model, it is necessary to pre-build a multi-agent model that can input and output structured data. Structured data can be in the form of pandas, csv or json, for example.

[0132] As an optional implementation, in the multi-agent model processing process, the intermediate processing data and the final processing data can also be integrated as numerical target data. The intermediate processing data can be a string that is filtered out. It is worth noting that the intermediate processing data and the final processing data need to be marked separately to facilitate the user to distinguish them.

[0133] In this embodiment, the current column data and initial data are input into the multi-agent model, and the multi-agent model analyzes and processes the input current column data and initial data, outputs numerical target data, and thus filters each character string in the current column data to obtain more accurate numerical target data.

[0134] As an optional implementation, before inputting the current column data and the initial data into the multi-agent model, the following steps may be performed: determining the non-numeric elements in the current column data and removing the non-numeric elements.

[0135] Optionally, the non-numeric elements in the numerical data may be elements such as text and letters, and the non-numeric elements are removed so that the multi-agent model analyzes and screens the numerical elements in the numerical data to obtain numerical target data.

[0136] In this embodiment, non-numeric elements in the numerical data are eliminated, so that the obtained numerical target data is more accurate.

[0137] Next, the specific process of how to structure the obtained question sentence in the above step S101 to obtain structured initial data is introduced:

[0138] Optionally, the prompt word engineering model is used to structure the question sentence to generate data to be integrated, and the data to be integrated includes main body data, condition data and requirement data.

[0139] Specifically, the prompt word engineering model combined with small sample learning technology is used to structure the question sentences. Among them, the use of the prompt word engineering model can improve the effect obtained by directly using a large language model for processing. Combining small sample learning technology can speed up model training and improve the processing efficiency of the question-answering processing method.

[0140] As another optional implementation, the prompt word engineering model of zero-sample information technology may be used to replace the prompt word engineering model combined with small-sample learning technology to structure the question sentences.

[0141] Optionally, initial data is generated according to the data to be integrated.

[0142] Among them, the data to be integrated obtained after being processed by the prompt word engineering model contains a structured form, but it is not structured data and cannot be displayed to the user as a part of the target output data. Therefore, the data to be integrated needs to be integrated into the initial data.

[0143] It is worth noting that in the initial data obtained through integration, the subject data, condition data and requirement data do not change.

[0144] In this embodiment, the prompt word engineering model is used to structure the question statement to generate data to be integrated, and then initial data is generated according to the data to be integrated, thereby outputting structured data, so that the target output data containing the initial data is more intuitive and meets user needs.

[0145] As an optional implementation manner, the specific method of generating the initial data according to the data to be integrated in the above steps includes:

[0146] Optionally, regular matching is performed on the main data, condition data and requirement data to obtain structured initial data.

[0147] Exemplarily, a regular matching method may be used to generate initial data in a tabular form according to the subject data, condition data, and requirement data.

[0148] In this embodiment, structured initial data is obtained by performing regular matching on the subject data, condition data and requirement data, so that the target output data including the initial data is more intuitive and meets the needs of users.

[0149] As an optional implementation, Figure 4 This is a flow chart of another question-answering processing method provided by an embodiment of the present application. Figure 4 This section describes the overall steps of the question-and-answer processing process in this application.

[0150] First, the question sentence input by the user is obtained, and then the question sentence is structured to obtain the initial data. Then, the main data in the initial data is integrated based on the prompt word engineering model to obtain the target main data. The retrieval enhancement generation model is used to search in the unstructured database based on the target main data to obtain the first retrieval data. Then, the main data, condition data and requirement data in the initial data are integrated based on the prompt word engineering model to obtain the target integrated data. Then, the retrieval enhancement generation model is used to search in the first retrieval data based on the target integrated data to obtain the target retrieval data. The target retrieval data is converted into a table to be output using regular matching. At this time, the table to be output is structured data. Each column of data in the table to be output is traversed, and for the current column data traversed, it is determined whether the data type of the current column data is text data. If so, the natural language model is used to determine the text target data according to the average semantic similarity of each string in the initial data and the current column data. If not, the current column data is input into the multi-agent model, and the multi-agent model analyzes and processes the input initial data and the current column data to output the numerical target data. The text target data and the numerical target data are integrated to determine the target output table. Finally, the initial data, target search data, the table to be output and the target output table are integrated to obtain the target output data.

[0151] Based on the same inventive concept, a question and answer processing device corresponding to the question and answer processing method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned question and answer processing method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0152] Reference Figure 5 As shown, it is a structural schematic diagram of a question-answer processing device provided in an embodiment of the present application, the device comprises: an acquisition module 501, a retrieval module 502, a conversion module 503, a parsing module 504 and an integration module 505; wherein:

[0153] The acquisition module 501 is used to structure the acquired question statements to obtain structured initial data, wherein the initial data includes subject data, condition data and requirement data;

[0154] A retrieval module 502 is used to integrate the initial data based on the prompt word engineering model to obtain target integrated data, and use the retrieval enhancement generation model to search in an unstructured database based on the target integrated data to generate target retrieval data, wherein the target integrated data includes target subject data, target condition data, and target requirement data, and the target retrieval data includes multiple structured character strings. The prompt word engineering model is a model that guides the large language model to generate expected outputs by setting specific inputs, and the retrieval enhancement generation model is a model formed by combining the retrieval enhancement generation algorithm with the large language model;

[0155] A conversion module 503, used to convert the target search data into a table to be output by using regular matching;

[0156] The parsing module 504 is used to perform data parsing and integration processing on the table to be output according to the data type of each column of data in the table to be output and the initial data based on the natural language model and the multi-agent model to obtain a target output table;

[0157] An integration module 505 is used to integrate the initial data, the target search data, the table to be output and the target output table to obtain target output data;

[0158] The retrieval module 502 is specifically used for:

[0159] The retrieval enhancement generation model searches the unstructured database based on the target subject data in the target integrated data to obtain first retrieval data, wherein the first retrieval data includes a plurality of character strings;

[0160] The retrieval enhancement generation model searches the first retrieval data based on the target integrated data to obtain target retrieval data.

[0161] Optionally, the parsing module 504 is specifically used for:

[0162] Traversing each column of data in the table to be output, and determining the data type of the current column of data according to the traversed current column of data;

[0163] If the data type of the current column data is text data, determining text target data based on the natural language model, according to the initial data and the current column data;

[0164] If the data type of the current column data is numerical data, then based on the multi-agent model, output numerical target data according to the initial data and the current column data;

[0165] After the traversal of the table to be output is completed, the text-type target data and the numerical-type target data are integrated to obtain the target output table.

[0166] Optionally, the parsing module 504 is specifically used for:

[0167] The natural language model is used to calculate the average semantic similarity between the initial data and each character string in the current column data, and the average semantic similarity of each character string is sorted, and the sorting result is used as text-type target data.

[0168] Optionally, the parsing module 504 is specifically used for:

[0169] The current column data and the initial data are input into the multi-agent model, and the multi-agent model analyzes and processes the input current column data and the initial data to output numerical target data.

[0170] Optionally, the parsing module 504 is specifically used for:

[0171] Determine non-numeric elements in the current column data, and remove the non-numeric elements.

[0172] Optionally, the acquisition module 501 is specifically used for:

[0173] Using the prompt word engineering model, the question sentence is structured and organized to generate data to be integrated, wherein the data to be integrated includes subject data, condition data and requirement data;

[0174] The initial data is generated according to the data to be integrated.

[0175] Optionally, the acquisition module 501 is specifically used for:

[0176] Regular matching is performed on the subject data, the condition data and the requirement data to obtain the structured initial data.

[0177] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0178] The present application also provides an electronic device, such as Figure 6 6, which is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, including: a processor 601, a memory 602 and a bus. The memory 602 stores machine-readable instructions executable by the processor 601 (for example, Figure 5The device acquires the execution instructions corresponding to the module 501, the retrieval module 502, the conversion module 503, the parsing module 504 and the integration module 505, etc.), when the computer device is running, the processor 601 communicates with the memory 602 through a bus, and when the machine-readable instructions are executed by the processor 601, the above-mentioned question and answer processing method is executed.

[0179] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned question and answer processing method are executed.

[0180] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0181] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.

[0182] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.

Claims

1. A question-answering processing method, characterized in that: The method comprises: Structuring the acquired question statements to obtain structured initial data, wherein the initial data includes subject data, condition data, and requirement data; Integrate the initial data based on the prompt word engineering model to obtain target integrated data, use the retrieval enhancement generation model to search in an unstructured database based on the target integrated data to generate target retrieval data, the target integrated data includes target subject data, target condition data and target requirement data, the target retrieval data includes a plurality of structured character strings, the prompt word engineering model is a model that guides the large language model to generate expected output by setting specific inputs, and the retrieval enhancement generation model is a model formed by combining the retrieval enhancement generation algorithm with the large language model; Convert the target search data into a table to be output by using regular matching; Based on the natural language model and the multi-agent model, the table to be output is parsed and integrated according to the data type of each column of data in the table to be output and the initial data to obtain a target output table; Integrate the initial data, the target search data, the table to be output and the target output table to obtain target output data; The method of using the retrieval enhancement generation model to search the unstructured database based on the target integrated data to generate target retrieval data includes: The retrieval enhancement generation model searches the unstructured database based on the target subject data in the target integrated data to obtain first retrieval data, wherein the first retrieval data includes a plurality of character strings; The retrieval enhancement generation model searches the first retrieval data based on the target integrated data to obtain target retrieval data; The step of performing data analysis and integration processing on the table to be output according to the data type of each column of data in the table to be output and the initial data to obtain a target output table includes: Traversing each column of data in the table to be output, and determining the data type of the current column of data according to the traversed current column of data; If the data type of the current column data is text data, determining text target data based on the natural language model, according to the initial data and the current column data; If the data type of the current column data is numerical data, then based on the multi-agent model, output numerical target data according to the initial data and the current column data; After the traversal of the table to be output is completed, the text-type target data and the numerical-type target data are integrated to obtain the target output table; The obtained question statements are structured to obtain structured initial data, including: Using the prompt word engineering model, the question sentence is structured and organized to generate data to be integrated, wherein the data to be integrated includes subject data, condition data and requirement data; Generate the initial data according to the data to be integrated; The generating the initial data according to the data to be integrated includes: Regular matching is performed on the subject data, the condition data and the requirement data to obtain the structured initial data.

2. The question-answer processing method according to claim 1, characterized in that: The determining of text-type target data based on the natural language model and according to the initial data and the current column data includes: The natural language model is used to calculate the average semantic similarity between the initial data and each character string in the current column data, and the average semantic similarity of each character string is sorted, and the sorting result is used as text-type target data.

3. The question-answer processing method according to claim 1, characterized in that: The method of outputting numerical target data based on the multi-agent model and the initial data and the current column data includes: The current column data and the initial data are input into the multi-agent model, and the multi-agent model analyzes and processes the input current column data and the initial data to output numerical target data.

4. The question-answer processing method according to claim 3, characterized in that: Before inputting the current column data and the initial data into the multi-agent model, the method comprises: Determine non-numeric elements in the current column data, and remove the non-numeric elements.

5. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor executes the machine-readable instructions to perform the steps of the question-answering processing method as described in any one of claims 1 to 4.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the question-answering processing method as claimed in any one of claims 1 to 4 are executed.