Table processing method and device, table training method and device, electronic equipment and storage medium
By matching natural language with the atomization capabilities of table operations, high-quality data sets are generated, and transfer learning is carried out on large-scale language models, proprietary AI models are trained, and the applicability of general AI models in vertical scenarios is solved. The problem of insufficient improvements in task accuracy and user experience.
Patent Information
- Application Number
- CN202310535853.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2024-11-12
AI Technical Summary
The existing general AI model is not effective in task execution in vertical fields, and cannot meet the complex interactiveness and data type requirements in vertical scenarios. The applicability and accuracy of large-scale language models in table vertical scenarios are insufficient. .
By matching the target text of natural language with the atomization capabilities of table operations, high-quality vertical data sets are generated and transfer learning is carried out on the basis of large-scale language models, proprietary AI models are trained to improve vertical classification in tables. Performance in the scene.
It improves the applicability and task accuracy of AI models in vertical scenarios, lowers the threshold for users to use table products, enhances office efficiency, and protects the privacy of table data.
Smart Images

Figure CN118939644A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to but is not limited to the field of information technology, and in particular to a table processing method, a model training method, a device, an electronic device and a storage medium. Background Art
[0002] With the development of artificial intelligence (AI) models, the execution capabilities of AI models are getting stronger and stronger. For example, AI models are becoming more and more capable of recognizing natural languages. For another example, AI models can be used as chatbots to conduct questions and answers with natural people in natural languages to achieve AI dialogue.
[0003] However, for tasks related to vertical fields, the execution results of vertical field tasks implemented using general AI models do not meet expectations. Summary of the invention
[0004] The present invention provides a table processing method, a model training method, an apparatus, a device and a storage medium.
[0005] A first aspect of an embodiment of the present disclosure provides a table processing method, including:
[0006] Determine the target task based on the target text in natural language;
[0007] Acquire the first structured data of the target table to be processed;
[0008] According to the target task and the first structured data of the target table, a target code for executing the target task is output; wherein after the target code is executed, the target task based on the target table is realized.
[0009] It can be understood that the AI model includes: a first module;
[0010] Determining the target task according to the target text in natural language includes: inputting the target text in natural language into the first module, obtaining first task information indicating the target task output by the first module;
[0011] The method of obtaining the first structured data of the target table to be processed includes: inputting the element information of the target table and / or the element information of the table file into the first module to obtain the first prompt word output by the first module; wherein the first prompt word includes: the first structured data sorted in a predetermined order, used to obtain the target code; the table file includes the target table.
[0012] It can be understood that the AI model also includes: a second module;
[0013] Outputting a target code for executing the target task according to the target task and the first structured data of the target table includes:
[0014] Inputting the target text in natural language into the second module to obtain text features;
[0015] Determining a target example related to the target task according to the text feature, the first prompt word, and the first task information;
[0016] The target code is generated according to the target sample.
[0017] It can be understood that determining the target sample related to the target task according to the text feature, the first prompt word and the first task information includes:
[0018] Concatenate the text feature and the first prompt word to obtain concatenation information;
[0019] Mapping the splicing information to a specific feature space to obtain a first feature vector;
[0020] Determining a similarity between the first feature vector and a second feature vector of the candidate sample;
[0021] Select the candidate sample with the highest similarity or the one with a similarity greater than the similarity threshold as the target sample.
[0022] It can be understood that the second module includes one or more alternative capability units; wherein different alternative capability units have different table processing capabilities and are configured with information of different alternative examples;
[0023] The method further comprises:
[0024] Determining, according to the first task information, a first unit that performs the target task from among the candidate capability units;
[0025] The text feature and the first prompt word are input into the first unit, so that the first unit outputs a second prompt word; wherein the second prompt word is generated according to the target sample and is used to generate the target code.
[0026] It is understandable that the AI model also includes a third module;
[0027] The step of generating the target code according to the target sample comprises:
[0028] The second prompt word is input into the third module to generate the target code.
[0029] It is understandable that the method further comprises:
[0030] In response to the first structured data being obtained based on the element information of the target table and / or the element information of the table file, and the first prompt word lacks the first type of prompt data, the first prompt information is output; wherein the first prompt information is used to prompt the input of adding the element information of the target table and / or the element information of the table file.
[0031] It is understandable that the method further comprises:
[0032] Outputting second prompt information according to the first task information and / or the target code;
[0033] According to a feedback operation acting on the second prompt information, it is determined whether to execute the target task according to the target code.
[0034] A second aspect of the present disclosure provides an artificial intelligence (AI) model training method, the method comprising:
[0035] Inputting sample text of natural language into a preset model to be trained, and determining sample tasks to be performed;
[0036] Obtaining second structured data of the sample table;
[0037] Obtaining a sample code for executing the sample task according to the sample task and the second structured data;
[0038] According to the execution result of the sample code and the label result of the sample task, the model parameters of the preset model are updated to obtain the artificial intelligence AI model used by the aforementioned table processing method.
[0039] It can be understood that the preset model includes: a fourth module;
[0040] The step of inputting the sample text of the natural language into the preset model to be trained to determine the sample task to be performed includes: inputting the sample text of the natural language into a fourth module, obtaining second task information indicating the sample task output by the fourth module;
[0041] The obtaining of the second structured data of the sample form includes: inputting the element information of the sample form into the fourth module to obtain a third prompt word; wherein the third prompt word includes: the second structured data sorted in a predetermined order, for obtaining a sample code.
[0042] It can be understood that the preset model also includes: a fifth module;
[0043] The obtaining, according to the sample task and the second structured data, a sample code for executing the sample task comprises:
[0044] Inputting the sample text of the natural language into the fifth module to obtain sample features;
[0045] Constructing alternative examples related to the sample task according to the sample feature, the third prompt word and the second task information;
[0046] According to the alternative examples, sample code is generated.
[0047] It can be understood that the fifth module includes one or more alternative capability units; wherein different alternative capability units have different table processing capabilities;
[0048] Determining, according to the second task information, a second unit for performing a sample task from the candidate capability units;
[0049] The sample feature and the third prompt word are input into the second unit, so that the second unit outputs a fourth prompt word; wherein the fourth prompt word is generated according to the target sample and is used to generate the sample code.
[0050] It can be understood that the preset model also includes a sixth module;
[0051] According to the alternative example, generating sample code includes:
[0052] The fourth prompt word is input into the sixth module to generate the sample code.
[0053] It is understandable that the method further comprises:
[0054] Obtain execution results corresponding to one or more natural language target texts;
[0055] According to the feedback operation on the execution result, the AI model is subjected to enhanced training and / or online training.
[0056] A third aspect of the present disclosure provides a table processing device, including:
[0057] A first determination module is used to determine a target task according to a target text in natural language;
[0058] A first acquisition module, used for acquiring first structured data of a target table to be processed;
[0059] An output module is used to output a target code for executing the target task according to the target task and the first structured data of the target table; wherein after the target code is executed, the target task based on the target table is realized.
[0060] It can be understood that the AI model includes: a first module;
[0061] The first determination module is specifically configured to input the target text in the natural language into the first module, and obtain first task information indicating the target task output by the first module;
[0062] The first acquisition module is specifically used to input the element information of the target table and / or the element information of the table file into the first module to obtain the first prompt word output by the first module; wherein the first prompt word includes: the first structured data sorted in a predetermined order, used to obtain the target code; the table file includes the target table.
[0063] It can be understood that the AI model also includes: a second module;
[0064] The output module is specifically used to input the target text of the natural language into the second module to obtain text features; determine the target sample related to the target task according to the text features, the first prompt word and the first task information; and generate the target code according to the target sample.
[0065] It can be understood that the output module is specifically used to splice text features and the first prompt word to obtain splicing information; map the splicing information to a specific feature space to obtain a first feature vector; determine the similarity between the first feature vector and the second feature vector of the alternative sample; select the alternative sample with the highest similarity or the similarity greater than the similarity threshold as the target sample.
[0066] It can be understood that the second module includes one or more alternative capability units; wherein different alternative capability units have different table processing capabilities and are configured with information of different alternative examples;
[0067] The device also includes:
[0068] A first selection module, configured to determine, according to the first task information, a first unit that performs the target task from among the candidate capability units;
[0069] The first prompt module is used to input the text feature and the first prompt word into the first unit, so that the first unit outputs a second prompt word; wherein the second prompt word is generated according to the target sample and is used to generate the target code.
[0070] It is understandable that the AI model also includes a third module;
[0071] The output module is further used to input the second prompt word into the third module to generate the target code.
[0072] It can be understood that the device also includes:
[0073] A second prompt module is used to output first prompt information in response to the first structured data being obtained based on the element information of the target table and / or the element information of the table file, and the first prompt word lacks first type of prompt data; wherein the first prompt information is used to prompt the input of adding the element information of the target table and / or the element information of the table file.
[0074] It can be understood that the device also includes:
[0075] A third prompt module, configured to output second prompt information according to the first task information and / or the target code;
[0076] An execution module is used to determine whether to execute the target task according to the target code according to the feedback operation acting on the second prompt information.
[0077] A fourth aspect of the present disclosure provides an artificial intelligence (AI) model training device, the device comprising:
[0078] A second determination module is used to input a sample text of a natural language into a preset model to be trained and determine a sample task to be performed;
[0079] A second acquisition module, used for acquiring second structured data of the sample table;
[0080] An obtaining module, used for obtaining a sample code for executing the sample task according to the sample task and the second structured data;
[0081] An updating module is used to update the model parameters of the preset model according to the execution results of the sample code and the label results of the sample task, so as to obtain an artificial intelligence AI model for executing the table processing method of the first aspect.
[0082] It can be understood that the preset model includes: a fourth module;
[0083] The second determining module is used to input the sample text of the natural language into the fourth module, and obtain the second task information indicating the sample task output by the fourth module;
[0084] The second acquisition module is used to input the element information of the sample form into the fourth module to obtain a third prompt word; wherein the third prompt word includes: the second structured data sorted in a predetermined order, which is used to obtain a sample code.
[0085] It can be understood that the preset model also includes: a fifth module;
[0086] The obtaining module is used to input the sample text of the natural language into the fifth module to obtain sample features; construct alternative examples related to the sample task based on the sample features, the third prompt word and the second task information; and generate sample code based on the alternative examples.
[0087] It can be understood that the fifth module includes one or more alternative capability units; wherein different alternative capability units have different table processing capabilities; and the device further includes:
[0088] A second selection module, configured to determine a second unit for executing a sample task from the candidate capability units according to the second task information;
[0089] A fourth prompt module is used to input the sample feature and the third prompt word into the second unit, so that the second unit outputs a fourth prompt word; wherein the fourth prompt word is generated according to the target sample and is used to generate the sample code.
[0090] A fifth aspect of the present disclosure provides an electronic device, including:
[0091] processor;
[0092] a memory for storing processor-executable instructions;
[0093] The processor is configured to implement the method provided by any one of the technical solutions of the first aspect or the second aspect when running the executable instructions.
[0094] A sixth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, wherein the readable storage medium stores an executable program, wherein when the executable program is executed by a processor, the method provided by any one of the first or second aspects is implemented.
[0095] In the technical solution provided by the embodiments of the present disclosure, the AI model is dedicated to realizing table tasks, which is equivalent to realizing the execution of tasks in the vertical field corresponding to the table. Due to this specialization, the execution effect of table-related tasks can be improved. At the same time, when realizing table tasks, in order to reduce data leakage in the target table, a target code to be executed is generated, and the target task is realized through the execution of the target code, thereby having the characteristics of high security of table data.
[0096] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0098] Figure 1 It is a flowchart of a table processing method according to an exemplary embodiment.
[0099] Figure 2 It is a schematic diagram of a user interface according to an exemplary embodiment.
[0100] Figure 3 It is a schematic diagram of an AI model according to an exemplary embodiment.
[0101] Figure 4 It is a flowchart of a table processing method according to an exemplary embodiment.
[0102] Figure 5 The figure is a schematic diagram showing a target sample determination example according to an exemplary embodiment.
[0103] Figure 6 The figure is a schematic diagram showing a display of an execution text and a target code according to an exemplary embodiment.
[0104] Figure 7 It is a schematic diagram of an analysis report generated based on an AI model according to an exemplary embodiment.
[0105] Figure 8 It is a flowchart of a table processing method according to an exemplary embodiment.
[0106] Fig. 9 The figure is a schematic diagram showing the structure of a table processing device according to an exemplary embodiment.
[0107] Fig.10 is a structural schematic diagram of a model training device according to an exemplary embodiment;
[0108] Fig.11 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0109] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present disclosure as detailed in the appended claims.
[0110] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0111] like Figure 1 As shown, the embodiment of the present disclosure provides a table processing method, which is executed by an electronic device running an AI model, including:
[0112] S1110: Determine a target task according to a target text in natural language;
[0113] S1210: Acquire the first structured data of the target table to be processed;
[0114] S1310: Output a target code for executing the target task according to the target task and the first structured data of the target table; wherein, after the target code is executed, the target task based on the target table is realized.
[0115] The electronic device may be a terminal device or a server. The server may include various application servers or a dedicated server specifically used for table task processing.
[0116] The AI model can be a model for processing table tasks. Exemplarily, the AI model can be a dedicated model for processing table tasks.
[0117] In some embodiments, the AI model may be a single model trained end-to-end. In other embodiments, the AI model may also be composed of multiple modules (or models), and different modules are trained separately.
[0118] The AI model may include, but is not limited to: a deep learning model and / or a machine learning model.
[0119] Exemplarily, the AI model includes but is not limited to at least one of the following:
[0120] Convolutional Neural Networks;
[0121] Feedback neural network;
[0122] Generative Adversarial Networks (GANs);
[0123] Large Language Models (LLMs).
[0124] Of course, the above is just an example of an AI model, and any of the above examples can be specifically implemented.
[0125] The target text in the natural language may be a target text received from a text input box of a user interface (UI). Alternatively, the target text in the natural language may be a target text converted based on voice data received by the electronic device. The language data may be target texts in various languages. Figure 2 As shown, the terminal device can display the target table and the dialog panel for receiving natural language text data in the same UI, and receive the natural language text data input by the user in the dialog panel. Figure 2 The goal table shown is a form of achievement table.
[0126] The target table can be any table associated with the target task. The table can be a table in a table file drawn by various table applications, a table inserted in a text document, or a table embedded in a web page. In short, the target table can be any table of any form that needs to execute a table task.
[0127] Exemplarily, according to the table storage location, the target table may include a local table of the terminal device and an online table.
[0128] As another example, depending on whether the table is combined with a database, the target table may include: a light-dimensional table and a traditional table. A light-dimensional table is different from a traditional table. Traditional tables are based on cells, and cells can be arbitrarily operated and their styles can be modified. In multi-person collaboration scenarios, irregular formats and inconsistent styles often occur. In a light-dimensional table, the data in each column belongs to the same type. After selecting a field type, only data of the selected type can be entered in the column, such as entering a date in a date field or column, and entering a number in a number field or column. There is no need to worry about irregular data formats, which greatly improves the efficiency of information collection and data statistics.
[0129] In some embodiments, depending on whether the table is from a database, the target table may include a database table and a non-database table. The database table may be a table generated or derived from the content in the database. The non-database table is usually stored separately in a table file, and the change of the table content does not involve the change of the content of other tables. Of course, the above is only an example of the type of the target table, and the specific implementation is not limited to the above examples.
[0130] For example, the target task may include but is not limited to at least one of the following:
[0131] Insert columns and rows;
[0132] Merge columns and rows;
[0133] Hide rows and columns that meet the conditions;
[0134] The rows that meet the deletion conditions;
[0135] Sorting operations on tables;
[0136] Execute table formulas, for example, calculate the sum or average of a column or columns containing an element or multiple elements;
[0137] Filter rows or columns that meet the conditions;
[0138] Insert a chart;
[0139] Conduct pivot analysis;
[0140] Perform data verification;
[0141] Modify the format of the target table;
[0142] Modify the data format of some rows or columns, for example, modify the date data format of the date column in the target table. Another example is to modify the number of digits after the decimal point of the value in the target table.
[0143] The first structured data may be data reflecting a table structure of a target table and / or a file structure including the target table.
[0144] The first structured data is different from the content in the target table, which includes but is not limited to numerical values, text content and / or input and output images in the table.
[0145] Exemplarily, the table structure includes but is not limited to at least one of the following:
[0146] The row names of the table;
[0147] The table's column names;
[0148] The table header;
[0149] The name of the table.
[0150] The file structure includes at least one of the following:
[0151] File name;
[0152] File type, for example, a table in an Excel or WPS file can be edited directly, while a table in a PDF file may not be edited directly. Before editing the table, you need to generate an editable file based on the PDF file, and then edit it;
[0153] Table type, for example, whether a table in a document file such as a WPS file is a directly editable table or a table inserted into the document file via an image can be indicated by the table type.
[0154] Of course, the above is merely an example of the first structured data, and the specific implementation is not limited to the above example.
[0155] In the embodiment of the present disclosure, after the target task to be executed is determined through the target text, a target code for executing the target task is generated by combining the target task and the first structured data.
[0156] The target code may be a code of various types of programming languages, including but not limited to at least one of the following:
[0157] Scripting languages;
[0158] Advanced programming languages, including but not limited to JAVA, python, html5, C language, C++, etc.;
[0159] Machine assembly language, including but not limited to 8086 assembly, Win32 assembly, etc.
[0160] These languages can be embedded in and executed by opening an object file containing an object table.
[0161] The target code can be used to execute the target task of the entire target table, and the target code can also be used to execute the target task of part of the content of the target table.
[0162] Exemplarily, the target scope involved in the target task is determined according to the target text, and the target scope may include: the entire target table and / or a target part in the target table.
[0163] The target part may be a part selected when executing the target task, or a table part determined based on natural language data recognition.
[0164] For example, S1310 may include but is not limited to at least one of the following:
[0165] When the electronic device is a server, the server may generate the target code and then embed the target file locally for execution;
[0166] When the electronic device is a server, the server may generate the target code and send it to the terminal device, which may execute it locally.
[0167] When the electronic device is a terminal device, after the terminal device generates the target code, the target code can be executed by an operating system or by an application program that opens the target file.
[0168] In short, the target code will realize the table task after execution. For example, if the target task is to change the display effect of the table, the visual effect of the table will change after the target code is executed. For another example, if the target task is to calculate the average score of each student in the score table, the target table will add an average score column, and the average score of each student will have the average score value in the corresponding column.
[0169] In the embodiments of the present disclosure, on the one hand, the table task is processed by an AI model that is good at processing table tasks to ensure the completion quality of the table task. On the other hand, in the embodiments of the present disclosure, the first structured data of the target table is obtained, rather than obtaining the entire target table or the table content of the target table. After only the first structured data of the target table is obtained, the table task is implemented by generating a target code, rather than directly obtaining the content of the target table through the AI model to complete the table task. In this way, while implementing the table task, the leakage of the content of the target table to be processed is reduced, that is, the content security of the target table is improved.
[0170] In some embodiments, the AI model includes: a first module.
[0171] S1110 may include: inputting the target text in the natural language into the first module, and obtaining first task information indicating the target task output by the first module.
[0172] Exemplarily, the first module may include one or more network layers. These network layers may have natural language processing capabilities, so that by recognizing the target text of the natural language, the target task indicated by the target text can be determined, and the first task information can be obtained.
[0173] For example, the first module may be Figure 3 The task classification module shown is used to determine the classification of the table task based on the natural language text data, that is, to determine the target task.
[0174] The first task information can at least be used to determine the task type. The first task information may include but is not limited to at least one of the following:
[0175] Task ID;
[0176] Task number;
[0177] Task type;
[0178] Task name, etc.
[0179] Exemplarily, the first module processes the target text in natural language, extracts keywords related to the table task from the target text, and determines the target task based on the keywords.
[0180] As another example, the first module determines the target task by processing the target text in natural language, matching task-related words, extracting semantics of combinations between different target texts, and other processes.
[0181] The above is only an example of determining the target task of the first module, and the specific implementation is not limited to the above processing.
[0182] In some embodiments, obtaining the first structured data of the target table to be processed may include: inputting the element information of the target table and / or the element information of the table file into the first module, and obtaining the first prompt word output by the first module; wherein the first prompt word includes: the first structured data sorted in a predetermined order, and used to obtain the target code. The table file includes the target table.
[0183] The element information here may include various descriptive information that can determine the rows or columns of the target table, information on various basic elements of the table file and / or the target table. Exemplarily, the element information may be attribute information of the table file and / or attribute information of the target table. The attribute information of the table file may include: at least one of the following: file type, how the table is presented in the file (for example, picture insertion), and applications supported by the file type. The attributes of the target table may include, but are not limited to, at least one of the following: whether the table supports editing, the table header, the name of the table, whether the content of the table is encrypted, and other information.
[0184] By acquiring the element information, the aforementioned first structured data can be obtained. The first structured data is sorted in a preset order to obtain a first prompt word (Prompt). The first prompt word may include one or more prompt data, which are sorted in a predetermined order to facilitate the rapid processing of subsequent modules of the AI model and improve the generation efficiency of the target code.
[0185] The prompt data may include, but are not limited to: target text and / or feature data after the target text is converted based on natural language. In some embodiments, the feature data may include, but are not limited to, various information contents of the first structured data represented by numerical values.
[0186] Exemplarily, the first prompt word may include a prompt word of a preset length. If the extraction of the nth first structured data from the first structured data fails, a first prompt word is generated according to the first structured data, and the corresponding prompt data in the first prompt word can be represented by "null".
[0187] In another exemplary embodiment, the prompt data corresponding to the first prompt word can be divided into a first type of prompt data and a second type of prompt data. The first type of prompt data is more important than the second type of prompt data. In some embodiments, the method may further include:
[0188] In response to the fact that the first structured data is obtained based on the element information of the target table and / or the element information of the table file, and the first prompt word lacks the first type of prompt data, the first prompt information is output; wherein, the first prompt information is used to prompt the input of adding the element information of the target table and / or the element information of the table file.
[0189] When the first prompt word lacks the first type of prompt data, the AI model will output the first prompt information, and the first prompt information is used to prompt the input of additional element information related to the target table and / or table file.
[0190] The table file here can be any file containing a table. The table in the table file can be a table inserted into a picture and / or a table in text format.
[0191] When the first prompt word does not lack the first type of prompt data, the AI model will continue to perform subsequent operations based on the first prompt word to generate a target code that can perform the target task. That is, when the second type of prompt data is missing, the AI model can continue to perform subsequent operations of the target task.
[0192] In the absence of the first type of prompt data, the AI model no longer continues to execute the subsequent target task. Exemplarily, the first type of prompt data may at least include: the column name of at least one column of the target table.
[0193] In some embodiments, the AI model further includes: a second module;
[0194] like Figure 4 As shown, the S1310 may include:
[0195] S1311: inputting the target text in natural language into the second module to obtain text features;
[0196] S1312: determining a target example related to the target task according to the text feature, the first prompt word, and the first task information;
[0197] S1313: Generate the target code according to the target sample.
[0198] In the embodiment of the present disclosure, the second module may also have the ability to process the target text in natural language. The second module may include Figure 3 The task execution module shown in the figure can be used for capacity scheduling of table task completion, etc.
[0199] In the disclosed embodiment, the processing capability of the natural language target text of the second module may be stronger and more detailed than that of the first module. In the disclosed embodiment, the second module acquires the target text and obtains text features according to the target text.
[0200] The text feature may include but not contain feature values of the semantics of the tabular text data.
[0201] After the text features are obtained, the target sample is determined by combining the text features, the first prompt word and the first task information. The target sample may be a sample that has performed the target task.
[0202] In some embodiments, determining a target example related to the target task according to the text feature, the first prompt word, and the first task information may include:
[0203] Determining candidate samples related to the target task according to the first task information;
[0204] Concatenate the text feature and the first prompt word to obtain concatenation information;
[0205] Mapping the splicing information to a specific feature space to obtain a first feature vector;
[0206] Determining a similarity between the first feature vector and a second feature vector of the candidate sample;
[0207] Select the candidate sample with the highest similarity or the one with a similarity greater than the similarity threshold as the target sample.
[0208] Figure 5 T 1 T 2 T 3 …T N is the second feature vector of the candidate sample from the sample set; I 1 I 2 I 3 …I N is the second eigenvector, which can be used to generate any parameters representing similarity, such as a dot product matrix, to determine the final target sample.
[0209] Figure 5 The natural language encoder in is part of the second module.
[0210] Of course, the above is only an example of a method for determining a target sample, and the specific implementation is not limited to the above example.
[0211] In some embodiments, the second module includes one or more alternative capability units; wherein different alternative capability units have different form processing capabilities and are configured with information of different alternative examples;
[0212] The method further comprises:
[0213] Determining, according to the first task information, a first unit that performs the target task from among the candidate capability units;
[0214] The text feature and the first prompt word are input into the first unit, so that the first unit outputs a second prompt word; wherein the second prompt word is generated according to the target sample and is used to generate the target code.
[0215] Exemplarily, one of the alternative capability units may correspond to a capability unit of an application program interface (API) granularity. Different alternative capability units have different table processing capabilities. In the disclosed embodiment, different alternative capability units correspond to different task identification sets. When the first task information is included in the task identification set of a certain alternative capability unit, the alternative capability unit is the aforementioned first unit.
[0216] In some embodiments, the first task information may be an identifier of an alternative capability unit, and thus the first task information is directly mapped to the corresponding alternative capability unit.
[0217] Exemplarily, the alternative capability unit may include but is not limited to at least one of the following:
[0218] A first alternative unit is used to perform table tasks based on table formulas;
[0219] The second alternative unit is used to perform table tasks based on API calls;
[0220] A third alternative unit is used to execute a table task based on assembly language code logic. Exemplarily, the assembly language includes but is not limited to a scripting language (JS);
[0221] A fourth alternative unit for performing a specific table task;
[0222] The fifth alternative unit is used to execute macro language related table tasks.
[0223] Of course, the above is merely an example of the alternative capability unit. In a specific implementation, the alternative capability unit may also include the sixth alternative unit and / or the seventh alternative unit, etc.
[0224] For example, the sixth candidate unit may encapsulate the atomic capabilities specifically applied to table files, which may include: table creation capability, data deletion, addition, update, hiding and other related capabilities.
[0225] According to the first task information, after the first prompt word and the text feature are provided to the first unit, the first unit outputs the second prompt word. The second prompt word may at least include sample information of the target sample, and the sample information may be used to uniquely identify the target sample. Exemplarily, the sample information may include a sample identifier, etc.
[0226] Exemplarily, a first feature vector is constructed based on the first prompt word and text features, and the Euclidean distance and / or paradigm distance between the first feature vector and the second feature vector of the candidate sample are calculated to characterize similarity. The candidate sample with the highest similarity is selected as the target sample.
[0227] The target sample may also include: an incomplete preset code, which is also a preset code to be supplemented.
[0228] In this way, the target sample is determined according to the second prompt word, and the target code can be generated according to the incomplete preset code corresponding to the target sample.
[0229] In some embodiments, the AI model further includes a third module;
[0230] The step of generating the target code according to the target sample comprises:
[0231] The second prompt word is input into the third module to generate the target code.
[0232] The third module may include, but is not limited to, LLMs.
[0233] Exemplarily, the third module may dynamically generate the target code according to the second prompt word.
[0234] The third module of the embodiment of the present disclosure may be Figure 3 The LLM shown in (also known as the abbreviation of LLMs).
[0235] exist Figure 3 The program also includes an execution module, which can be used to execute the target code output by the third module. Figure 3 The code module in is a functional module formed by encapsulating the target code.
[0236] In another exemplary embodiment, the third module can obtain the preset code to be supplemented of the target sample according to the second prompt word, and supplement the missing part of the preset code according to the first prompt word and / or the first structured data to generate the target code. Based on the simulation capability of the third module, the code for executing the target task of the target sample is simulated to generate the target code for the target table to execute the target task.
[0237] In some embodiments, the method further comprises:
[0238] Outputting second prompt information according to the first task information and / or the target code;
[0239] According to a feedback operation acting on the second prompt information, it is determined whether to execute the target task according to the target code.
[0240] The feedback operation may be a manual operation and / or voice operation performed by the user on the second prompt information.
[0241] Exemplarily, the second prompt information is displayed in the form of a dialog box, and the feedback operation may be a user operation acting on an "OK" and / or "Cancel" control in the dialog box.
[0242] In this way, according to the feedback operation acting on the second prompt information, erroneous operations are reduced and the execution quality of the target task is improved.
[0243] Exemplarily, outputting the second prompt information according to the first task information and / or the target code may include:
[0244] Determining, based on the target code, operations to be performed for executing the target task;
[0245] Generate an execution text according to the operation to be executed;
[0246] The execution text is displayed.
[0247] That is, the second prompt information is an execution text, so that it is convenient for the user to determine whether the target task that has not been executed is the task that the user needs to execute according to the execution text.
[0248] Figure 6 The dialog panel shown has a schematic diagram of the execution text for filtering the top three scores in the score table. The execution text describes the execution process of the target code step by step using natural language.
[0249] Figure 6 A schematic diagram of the target code is also shown.
[0250] In some cases, the terminal or server may display the target code or hide the target code. Whether to display the target code or hide the target code may be determined according to the table properties of the target table or the property settings of the application program that opens the target table.
[0251] In some embodiments, displaying the execution text may include:
[0252] Display the execution text in an editable text box;
[0253] Detect modification operations on editable text boxes;
[0254] Obtain the modified execution text according to the modification operation;
[0255] Update the target code according to the modified execution text;
[0256] Execute the updated object code.
[0257] In some other embodiments, the execution text may include: editable key text and non-editable non-key text. The key text may be operation information for executing the target task.
[0258] For example, key text and non-key text in the displayed execution text are distinguished, and a modification operation of modifying the key text is detected, thereby obtaining the modified execution text.
[0259] There are multiple ways to obtain the modified execution text, which can ensure the accurate execution of the target task and the task modification required according to user needs.
[0260] In this way, it is also possible to reduce the misoperation caused by errors in editing the target text of natural language or conversion errors of the target text obtained based on voice data conversion. Different people have different pronunciation characteristics, and people in different regions have different local characteristics. Although the conversion accuracy of voice data to target text is getting higher and higher, there are still errors from time to time. This modification of the execution text can reduce the occurrence of such errors.
[0261] Exemplarily, the target code includes two parts:
[0262] The first part includes: a demonstration code; through the execution of the demonstration code, a unit in the target table will be selected for execution, and the unit will be demonstrated to the user through a video or animation. After the animation is demonstrated, the second prompt information will be displayed according to the demonstration code;
[0263] The second part: execution code, which is used to be executed when a confirmation operation acting on the second prompt information is detected, so as to execute the target task for all parts involved in the target text of the natural language.
[0264] Take the target table as a score sheet for each subject as an example, and the target task is to calculate the total score of each student. Through the execution of the demonstration code, you can select a row in the target table or a sample table outside the target table to demonstrate the total score calculation. After the demonstration is completed, the second prompt message is displayed to prompt the user whether to perform the total score calculation for all students in the target table. If confirmation feedback is detected, the target code is loaded into the application where the table file is located to perform the total score calculation.
[0265] At this time, the aforementioned one unit may be one row.
[0266] In one embodiment, the method comprises:
[0267] When executing the target code, a demonstration video or a demonstration animation is generated according to the execution progress of the target code and the table content of the target table; wherein, when the demonstration video or the demonstration animation is displayed, the target code is also executed;
[0268] After the target code is executed, a third prompt message is displayed; wherein the third prompt message is used to prompt whether to confirm the execution result.
[0269] After detecting a feedback operation acting on the third prompt information, it is determined whether to save the execution result to the target table.
[0270] Exemplarily, upon detecting a feedback operation acting on the third prompt information, determining whether to save the execution result to the target table includes:
[0271] In the case of detecting a confirmation operation acting on the third prompt information, determining to save the execution result to the target table, at this time, if the execution result involves updating the format and / or data content of the table, the updated table will be solidified on the disk;
[0272] In the case where a denial operation acting on the third prompt information is detected, the execution result is determined to be canceled, and the target table restores the table state before the execution result acts on the target table.
[0273] In short, by displaying the second prompt information and the third prompt information, the execution accuracy of the target task can be ensured.
[0274] In an embodiment of the present disclosure, the method further includes:
[0275] Determine the target scope of the target code, which may be part or all of the content in the target table;
[0276] Detecting the table content of the target range;
[0277] When it is detected that the table content within the target range is abnormal, a fourth prompt message is output and the execution of the target code is suspended.
[0278] Exemplarily, the fourth prompt information may be a separate abnormal prompt information, which is used to inform the user of the table content.
[0279] As another example, the fourth prompt information may be prompt information of the exception type and / or exception correction, which informs the user how to remove the abnormal content in the table.
[0280] Also exemplarily, abnormal content is highlighted or displayed in a different color, thereby facilitating the user to modify the table content.
[0281] In some embodiments, the fourth prompt information is also displayed in the form of a dialog box.
[0282] When the fourth prompt information is displayed, when an ignore operation of ignoring abnormal table content is detected, the target code is executed.
[0283] Abnormal table contents may include but are not limited to at least one of the following:
[0284] Required content in the form is missing; for example, if the target form is an employee's attendance sheet, the attendance time of a certain job is missing in the attendance sheet, etc.
[0285] The values in the table are beyond the normal range. Taking the student's academic performance as an example, the lowest score is 0, but a negative score is currently detected, which may be abnormal content.
[0286] Of course, the above is only a prompt for abnormal table content, and the specific implementation is not limited to this prompt.
[0287] In some embodiments, the method further comprises:
[0288] When it is detected that the table content within the target range is normal, the target code is executed.
[0289] Figure 7 The diagram shows a schematic diagram of generating an analysis report for the execution result of the target task. The analysis report can be added to the original page of the target table, or a new table page or a new file can be created for storage.
[0290] like Figure 8 As shown, the present disclosure provides an artificial intelligence (AI) model training method, the method comprising:
[0291] S2110: Inputting a sample text of a natural language into a preset model to be trained, and determining a sample task to be performed;
[0292] S2120: Acquire second structured data of the sample table;
[0293] S2130: Obtaining a sample code for executing the sample task according to the sample task and the second structured data;
[0294] S2140: According to the execution result of the sample code and the label result of the sample task, the model parameters of the preset model are updated to obtain the artificial intelligence AI model used by any of the aforementioned table processing methods.
[0295] The disclosed embodiments provide a method for training an AI model, and the AI model trained by the training method can be used for table processing in any of the aforementioned embodiments.
[0296] The sample text of the natural language may also be text-type data. For example, the sample text may come from natural language data related to table operations collected from the network.
[0297] As another example, the sample text may be a special target text specially generated during model training. In this case, a target text generation model may be used to generate one or more target texts. Exemplarily, firstly, the standard target text for various tasks of the form is obtained according to the form application, etc., and noise is added to the standard target text, and the standardized target text is transformed. Alternatively, the standard target text is used according to the characteristics of natural language to generate multiple non-standardized target texts. Generating sample text in this way can reduce the difficulty of collecting sample texts. The target text after destandardization processing such as adding noise to the standard target text and changing the target text can simulate the target texts of various natural languages in real scenarios. In this way, the AI model trained with this sample text has the characteristics of strong generalization ability.
[0298] Adding noise to the standardized target text may include: adding noise to the standardized target text without information content, and / or adding interference information of real speech with information content and fuzzy form processing to the standardized target text.
[0299] For example, adding interjections or humble words such as "um", "oh", "please" etc. that do not increase the amount of information to the standardized target text.
[0300] The transformation of the standardized target text may include but is not limited to at least one of the following:
[0301] Standardize synonyms of standard words in target text;
[0302] The order of different words in the annotated target text is reversed;
[0303] Standardize the hiding of key words and / or non-key words in the target text that help improve the representation of the true semantics;
[0304] The sentences of the standardized target text are transformed into incorrect sentences, etc.
[0305] By transforming the standardized text based on the speaking characteristics of users with different educational levels, sample text for training the preset model can be obtained.
[0306] In the embodiment of the present disclosure, the preset model may be the model to be trained.
[0307] The preset model may include but is not limited to: a deep learning model and / or a machine learning model.
[0308] Exemplarily, the preset model includes but is not limited to at least one of the following:
[0309] Convolutional Neural Networks;
[0310] Feedback neural network;
[0311] Generative Adversarial Networks (GANs);
[0312] Large Language Models (LLMs).
[0313] Of course, the above is only an example of a preset model, and any of the above examples are specifically implemented.
[0314] The samples here consider the table tasks that need to be performed for the sample tables.
[0315] After the sample task is determined, the second task information will be generated. The specific content corresponding to the second task information may include but is not limited to at least one of the following:
[0316] Task ID;
[0317] Task number;
[0318] Task type;
[0319] Task name, etc.
[0320] The relevant content of the second structured data here may be similar to the aforementioned first structured data. For example, similarly, the second structured data may be data such as a table structure reflecting a sample table and / or a file structure including a target table.
[0321] During the training process of the preset model, the preset model will obtain sample code based on the sample task and the second structured data. The sample code can also be assembly language code and / or high-level code, etc. After the sample code is executed, an execution result will be obtained, which can be compared with the label result of the standard operation. According to the difference between the execution result and the label result, a loss value can be obtained. Based on the loss value, it can be determined whether it is necessary to continue training the preset model. If it is necessary to continue training the model, at least part of the parameters of the preset model are updated first, and the training and loss value of the model are continued until a qualified AI model is obtained.
[0322] Exemplarily, the model parameters of the preset model may include weights of network nodes in one or more network layers.
[0323] Eligible AI models may include:
[0324] AI models with loss values less than the preset threshold;
[0325] and / or,
[0326] AI model with minimal loss value.
[0327] In some embodiments, the preset model includes: a fourth module;
[0328] The step of inputting the sample text of the natural language into the preset model to be trained to determine the sample task to be performed includes: inputting the sample text of the natural language into a fourth module, obtaining second task information indicating the sample task output by the fourth module;
[0329] The obtaining of the second structured data of the sample form includes: inputting the element information of the sample form into the fourth module to obtain a third prompt word; wherein the third prompt word includes: the second structured data sorted in a predetermined order, for obtaining a sample code.
[0330] In the disclosed embodiment, the fourth module that completes the training is the aforementioned first module.
[0331] In some embodiments, the preset model further includes: a fifth module;
[0332] The obtaining, according to the sample task and the second structured data, a sample code for executing the sample task comprises:
[0333] Inputting the sample text of the natural language into the fifth module to obtain sample features;
[0334] Constructing alternative examples related to the sample task according to the sample feature, the third prompt word and the second task information;
[0335] According to the alternative examples, sample code is generated.
[0336] In this way, alternative samples are also constructed during the model training process. If a sample corresponding to a certain sample is determined as a sample sample, the second task information and sample features obtained during the model training will be stored accordingly, which is convenient for subsequent use of the AI model.
[0337] In some embodiments, the method further includes: updating the sample instance when the execution result is different from the label result or the difference is large.
[0338] The fifth module of training is the aforementioned second module.
[0339] In some embodiments, the fifth module includes one or more alternative capability units; wherein different alternative capability units have different form processing capabilities;
[0340] Determining, according to the first task information, a second unit for executing a sample task from among the candidate capability units;
[0341] The sample feature and the third prompt word are input into the second unit, so that the second unit outputs a fourth prompt word; wherein the fourth prompt word is generated according to the target sample and is used to generate the sample code.
[0342] In some embodiments, the preset model further includes a sixth module;
[0343] According to the alternative example, generating sample code includes:
[0344] The fourth prompt word is input into the sixth module to generate the sample code.
[0345] Illustratively, the sample code may be the aforementioned LLMs.
[0346] Exemplarily, the alternative capability unit may include but is not limited to at least one of the following:
[0347] A first alternative unit is used to perform table tasks based on table formulas;
[0348] The second alternative unit is used to perform table tasks based on API calls;
[0349] A third alternative unit is used to execute a table task based on assembly language code logic. Exemplarily, the assembly language includes but is not limited to a scripting language (JS);
[0350] A fourth alternative unit for performing a specific table task;
[0351] The fifth alternative unit is used to execute macro language related table tasks.
[0352] Of course, the above is merely an example of the alternative capability unit. In a specific implementation, the alternative capability unit may also include the sixth alternative unit and / or the seventh alternative unit, etc.
[0353] For example, the sixth candidate unit may encapsulate the atomic capabilities specifically applied to table files, which may include: table creation capability, data deletion, addition, update, hiding and other related capabilities.
[0354] In some embodiments, after the AI model is put into use, the table processing method and / or the model training method may further include:
[0355] Obtain execution results corresponding to one or more natural language target texts;
[0356] operating according to feedback on the execution result;
[0357] Based on the feedback operation, the AI model is subjected to enhanced training and / or online training.
[0358] Exemplarily, the performing enhanced training and / or online training on the AI model according to the feedback operation includes:
[0359] Obtaining continued training data based on negative feedback and / or code modification operations;
[0360] The AI model can be reinforced and / or trained online based on the continued training data, which can further improve the accuracy of the AI model used online.
[0361] The online training here can be: the use phase when the AI model is put into use. During the use phase, the AI model will continue to be trained based on user feedback on the execution results of the target code generated by the AI model.
[0362] The enhanced training here may include: conducting enhanced training on some capabilities of the AI model. For example, negative training data is constructed based on a denial operation on the execution result. The negative training data is used to conduct enhanced training on the AI model. The denial operation indicates that the execution result is an incorrect execution result or an execution result that the user is not satisfied with.
[0363] The shortcomings of related technologies for large-scale language models in table vertical scenarios are as follows:
[0364] Poor applicability in the vertical scenarios of online forms: The intelligent vertical fields of online forms involve a lot of knowledge points and data types, and often involve specific industries and fields, which leads to a relatively narrow coverage of the data set. At the same time, the quality of data in this vertical scenario is uneven, and some data contains noise and errors. Therefore, the trained large language model may not be able to fully cover all knowledge points and data types in the vertical field of online forms, and the model may not provide accurate answers to questions in some fields.
[0365] Insufficient interactivity in conversations: Problems in the online form vertical field are often complex and interactive. The accuracy and emotionality of the feedback results of large-scale language models in vertical scenarios are poor, and cannot meet the needs of market applications.
[0366] The solution provided by the embodiment of the present disclosure, by combing the underlying atomic capabilities of the table product, matches the table operations involved in the target text of natural language with the API of the atomic capabilities, thereby obtaining high-quality table-related vertical data sets, and through the ability of transfer learning, training a proprietary model with excellent performance for vertical scenarios based on a large-scale language model. Ultimately, it lowers the threshold for users to use tables, further unleashes the capabilities of table products, and helps users improve office efficiency.
[0367] The disclosed embodiments improve the applicability and accuracy of large-scale language models in table vertical scenarios by deeply combing table-specific capabilities such as table function sets, atomization capabilities, VBA / formulas, and by leveraging the understanding of table data structures and the ability to recognize first structured data.
[0368] refer to Figure 2 As shown in the figure, the three core elements of data structure, function set and natural language are matched more deeply to improve the feedback accuracy of the large language model in table vertical scenarios and the automated process of table use.
[0369] In terms of data structure, the disclosed embodiment performs structural recognition and data type recognition on metadata, sorts out the atomic capabilities of more than 100 tables and hundreds of table formulas in terms of function sets, and establishes corresponding data pairs between scenario-based natural language descriptions and function sets and data structures, thereby forming a high-quality data set. Based on a large-scale language model, an exclusive AI model belonging to the table vertical scenario is trained through transfer learning (offsite-tuning).
[0370] Data structure-function set-natural language instructions are used for scenario matching to build high-quality vertical datasets, and end-to-end semantic-level matching is achieved.
[0371] This vertical model can greatly improve the applicability, task accuracy, and automated execution level of the model in vertical scenarios, ensuring that the AI model for vertical table processing has sufficient table task processing capabilities and protects the privacy of data in the table.
[0372] Based on the basic capabilities of large-scale language models, a high degree of matching is achieved in table vertical scenarios.
[0373] The application scope and field of the disclosed embodiments are very wide, and can be used in a variety of office table product directions. The applicable products are mainly table-related products, such as local tables, online tables, light-dimensional tables, database-like tables, etc. However, the overall design idea can be used for various table products related to multi-API call operations or editing functions. The applicable scenarios are also diverse, and the accumulation of model capabilities can cover various operations of the product, as well as various functions that can be realized after code intervention.
[0374] refer to Figure 2 As shown in the figure, from natural language to the final table operation mapping, it will go through two stages of judgment and model processing, from the input layer (Input layer) to two hidden layers (Hidden Layer), and finally get the output layer (Output Layer).
[0375] The key process in this architecture is the ability of the multimodal complementary fusion module (MCMF) to generate target code based on the operation instructions obtained from the natural language input by the user. The AI model can be expressed as C = LLM (α, β, γ)
[0376] LLM has three parts of input: basic model-related parameters α, user operation instructions denoted as β, and task-related APIs denoted as γ. Using these inputs that are highly matched to the task content, the model automatically generates action codes denoted as C.
[0377] Step 1: Structural identification of metadata. Goal: Read loose metadata into a structured form.
[0378] Ⅰ. Identify basic element information such as file name, table name, and table header for table files.
[0379] Ⅱ. Identify the data types of each column based on the column type of the table.
[0380] III. Combine the table header information and column data type in a specific format to form a prompt in a specific format.
[0381] Step 2: Matching natural language with task semantics:
[0382] Goal: Match user natural language with tasks after combining metadata structure.
[0383] Ⅰ. Pre-label the real samples of the training data set.
[0384] II. Encode the labeled training data set through the training set encoder.
[0385] III. Encode the feature elements generated by the basic elements of metadata through a natural language encoder.
[0386] IV. Combine the scenario language with the labeled task training set for semantic matching to find task types with extremely high similarity.
[0387] Step 3: Task Step Breakdown
[0388] Goal: Break down the task into API-sized steps.
[0389] Ⅰ. Pre-label the API and manually label it according to the API capabilities;
[0390] Ⅱ. Divert to the corresponding API set according to the successfully matched task type;
[0391] III. Break down the user requirements described in natural language into task steps;
[0392] IV. Filter out the annotated APIs based on the disassembled steps.
[0393] Step 4: Generate code based on examples
[0394] Objective: Complete the operation of the second hidden layer.
[0395] Ⅰ. Combine the sample and the selected related API to form a specific prompt and send it to LLM together.
[0396] Ⅱ. Use the simulation capability of LLM and the strong task-related API to write the code that can be executed by the corresponding table.
[0397] III. Complete the task execution operation.
[0398] Step 5: Results presentation
[0399] Objective: To present the results of the task.
[0400] Ⅰ. Match different presentation methods according to task categories;
[0401] Ⅱ. Provide users with secondary confirmation.
[0402] At the same time, the vertical model provides two learning mechanisms to make the cooperation between the model and the task execution module more accurate. After the user confirms, the real success or failure results of the execution process are fed back. By recording these user feedbacks, a training set of bad cases is prepared to continuously strengthen the model's capabilities. User feedback is denoted as f. The calculation equation for calculating the loss value between user feedback and model execution can be as follows:
[0403] Loss(C,f)=Loss(LLM(α,β,γ),f)
[0404] Then, the parameters α of the basic model and the parameters γ of the task examples and task-related APIs are continuously adjusted to optimize the overall loss function, so that the model can continuously enhance its accuracy. Loss(C,f) represents the loss value of the AI model. The parameters α related to the basic model, the user's operation instructions are recorded as β, and the task-related APIs are recorded as γ. Using these inputs that are highly matched with the task content, the model automatically generates action codes recorded as C.
[0405] As the most frequently used and most in-depth office software in office scenarios, spreadsheet software has extremely complex functions, but at the same time, the software is also extremely powerful. Through model training, the triggering logic of functions is changed from the original starting point of understanding functions to the starting point of task requirements, which greatly reduces the threshold for users.
[0406] Through natural language dialogue, table operations can be achieved, which greatly reduces the threshold for users to use various functions of the table.
[0407] It greatly improves the operability of the table and at the same time improves the accuracy of the table in solving scenario problems.
[0408] Build GAN and implement end-to-end semantic-level matching on hardware, greatly improving the matching speed and accuracy.
[0409] Improve the completion rate and overall response speed of complex tasks in user scenarios.
[0410] like Fig. 9 As shown, the embodiment of the present disclosure provides a table processing device, including:
[0411] A first determination module 110 is used to determine a target task according to a target text in a natural language;
[0412] A first acquisition module 120, used to acquire first structured data of a target table to be processed;
[0413] The output module 130 is used to output a target code for executing the target task according to the target task and the first structured data of the target table; wherein, after the target code is executed, the target task based on the target table is realized.
[0414] It can be understood that the AI model includes: a first module;
[0415] The first determination module 110 is specifically configured to input the target text in the natural language into the first module, and obtain first task information indicating the target task output by the first module;
[0416] The first acquisition module 120 is specifically used to input the element information of the target table into the first module to obtain the first prompt word output by the first module; wherein the first prompt word includes: the first structured data sorted in a predetermined order, which is used to obtain the target code.
[0417] In some embodiments, the output module 130 is specifically used to splice text features and the first prompt word to obtain splicing information; map the splicing information to a specific feature space to obtain a first feature vector; determine the similarity between the first feature vector and the second feature vector of the alternative sample; select the alternative sample with the highest similarity or the similarity greater than the similarity threshold as the target sample.
[0418] It can be understood that the second module includes one or more alternative capability units; wherein different alternative capability units have different table processing capabilities and are configured with information of different alternative examples;
[0419] The device also includes:
[0420] A first selection module, configured to determine, according to the first task information, a first unit that performs the target task from among the candidate capability units;
[0421] The first prompt module is used to input the text feature and the first prompt word into the first unit, so that the first unit outputs a second prompt word; wherein the second prompt word is generated according to the target sample and is used to generate the target code.
[0422] It is understandable that the AI model also includes a third module;
[0423] The output module 130 is further configured to input the second prompt word into the third module to generate the target code.
[0424] It can be understood that the device also includes:
[0425] A second prompt module is used to output first prompt information in response to the first structured data being obtained based on the element information of the target table and / or the element information of the table file, and the first prompt word lacks first type of prompt data; wherein the first prompt information is used to prompt the input of adding the element information of the target table and / or the element information of the table file.
[0426] It can be understood that the device also includes:
[0427] A third prompt module, configured to output second prompt information according to the first task information and / or the target code;
[0428] An execution module is used to determine whether to execute the target task according to the target code according to the feedback operation acting on the second prompt information.
[0429] like Fig.10 As shown, the embodiment of the present disclosure provides an AI model training device, the device comprising:
[0430] A second determination module 210 is used to input a sample text of a natural language into a preset model to be trained and determine a sample task to be performed;
[0431] The second acquisition module 220 is used to acquire the second structured data of the sample table;
[0432] An obtaining module 230 is used to obtain a sample code for executing the sample task according to the sample task and the second structured data;
[0433] The updating module 240 is used to update the model parameters of the preset model according to the execution result of the sample code and the label result of the sample task, so as to obtain the artificial intelligence AI model used to execute the table processing method described in the above embodiment.
[0434] It can be understood that the preset model includes: a fourth module;
[0435] The second determining module 210 is used to input the sample text of the natural language into the fourth module, and obtain the second task information indicating the sample task output by the fourth module;
[0436] The second acquisition module 220 is used to input the element information of the sample form into the fourth module to obtain a third prompt word; wherein the third prompt word includes: the second structured data sorted in a predetermined order, which is used to obtain a sample code.
[0437] It can be understood that the preset model also includes: a fifth module;
[0438] The obtaining module 230 is used to input the sample text of the natural language into the fifth module to obtain sample features; construct alternative examples related to the sample task based on the sample features, the third prompt word and the second task information; and generate sample code based on the alternative examples.
[0439] It can be understood that the fifth module includes one or more alternative capability units; wherein different alternative capability units have different table processing capabilities; and the device further includes:
[0440] A second selection module, configured to determine a second unit for executing a sample task from the candidate capability units according to the second task information;
[0441] A fourth prompt module is used to input the sample feature and the third prompt word into the second unit, so that the second unit outputs a fourth prompt word; wherein the fourth prompt word is generated according to the target sample and is used to generate the sample code.
[0442] An embodiment of the present disclosure further provides an electronic device, including:
[0443] processor;
[0444] a memory for storing processor-executable instructions;
[0445] Among them, the processor is configured to: implement the table processing method and / or model training method of any embodiment of the present disclosure when running executable instructions.
[0446] The electronic device may at least be the aforementioned server and / or terminal device.
[0447] The memory may include various types of storage media, which are non-transitory computer storage media that can continue to remember information stored thereon after the communication device loses power.
[0448] The processor can be connected to the memory through a bus or the like to read the executable program stored in the memory, for example, to implement the following Figure 1 , Figure 4 and / or Figure 8 The method shown.
[0449] The embodiments of the present disclosure further provide a computer-readable storage medium, wherein the computer-readable storage medium stores an executable program, wherein when the executable program is executed by a processor, the table processing method of any embodiment of the present disclosure is implemented. Figure 1 , Figure 4 and / or Figure 8 The method shown.
[0450] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0451] The present disclosure provides an electronic device, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to: when running the executable instructions, implement the table processing method provided by any of the above technical solutions, for example, Figure 1 , Figure 4 and / or Figure 8 The method shown.
[0452] like Fig.11 As shown, an embodiment of the present disclosure shows a structure of an electronic device. For example, the electronic device 900 can be provided as a network side device. Fig.11 The electronic device 900 includes a processing component 922, which further includes one or more processors, and a memory resource represented by a memory 932 for storing instructions executable by the processing component 922, such as an application. The application stored in the memory 932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 922 is configured as an executable program to perform any of the aforementioned methods for applying to the access device, such as Figure 1 , Figure 4 and / or Figure 8 The method shown.
[0453] The electronic device 900 may also include a power supply component 926 configured to perform power management of the electronic device 900, a wired or wireless network interface 950 configured to connect the electronic device 900 to a network, and an input / output (I / O) interface 958. The electronic device 900 may operate based on an operating system stored in the memory 932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0454] In an exemplary embodiment, an embodiment of the present disclosure provides a computer-readable storage medium, which stores an executable program, wherein the executable program, when executed by a processor, implements the table processing method provided by any of the aforementioned technical solutions.
[0455] The computer-readable storage medium may specifically be: a non-temporary computer-readable storage medium.
[0456] Exemplarily, for example, the memory 932 includes an executable program, and the above instructions can be executed by the processing component 922 of the electronic device 900 to complete the above method.
[0457] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0458] Those skilled in the art will readily appreciate other implementations of the disclosed embodiments after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosed embodiments, which follow the general principles of the disclosed embodiments and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the disclosed embodiments are indicated by the following claims.
[0459] It should be understood that the embodiments of the present disclosure are not limited to the precise structures described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the embodiments of the present disclosure is limited only by the appended claims.
Claims
1. A table processing method, characterized in that: Executed by electronic devices running artificial intelligence (AI) models, including: Determine the target task based on the target text in natural language; Acquire the first structured data of the target table to be processed; According to the target task and the first structured data of the target table, a target code for executing the target task is output; wherein after the target code is executed, the target task based on the target table is realized.
2. The method according to claim 1, characterized in that The AI model includes: a first module; Determining the target task according to the target text in natural language includes: inputting the target text in natural language into the first module, obtaining first task information indicating the target task output by the first module; The method of obtaining the first structured data of the target table to be processed includes: inputting the element information of the target table and / or the element information of the table file into the first module to obtain the first prompt word output by the first module; wherein the first prompt word includes: the first structured data sorted in a predetermined order, used to obtain the target code; the table file includes the target table.
3. The method according to claim 2, characterized in that The AI model also includes: a second module; Outputting a target code for executing the target task according to the target task and the first structured data of the target table includes: Inputting the target text in natural language into the second module to obtain text features; Determining a target example related to the target task according to the text feature, the first prompt word, and the first task information; The target code is generated according to the target sample.
4. The method according to claim 3, characterized in that The step of determining a target example related to the target task according to the text feature, the first prompt word, and the first task information includes: Concatenate the text feature and the first prompt word to obtain concatenation information; Mapping the splicing information to a specific feature space to obtain a first feature vector; Determining a similarity between the first feature vector and a second feature vector of the candidate sample; Select the candidate sample with the highest similarity or the one with a similarity greater than the similarity threshold as the target sample.
5. The method according to claim 3, characterized in that: The second module includes one or more alternative capability units; wherein different alternative capability units have different table processing capabilities and are configured with information of different alternative samples; The method further comprises: Determining, according to the first task information, a first unit that performs the target task from among the candidate capability units; The text feature and the first prompt word are input into the first unit, so that the first unit outputs a second prompt word; wherein the second prompt word is generated according to the target sample and is used to generate the target code.
6. The method according to claim 5, characterized in that The AI model also includes a third module; The step of generating the target code according to the target sample comprises: The second prompt word is input into the third module to generate the target code.
7. The method according to claim 2, characterized in that: The method further comprises: In response to the first structured data being obtained based on the element information of the target table and / or the element information of the table file, and the first prompt word lacks the first type of prompt data, the first prompt information is output; wherein the first prompt information is used to prompt the input of adding the element information of the target table and / or the element information of the table file.
8. The method according to any one of claims 2 to 7, characterized in that: The method further comprises: Outputting second prompt information according to the first task information and / or the target code; According to a feedback operation acting on the second prompt information, it is determined whether to execute the target task according to the target code.
9. An artificial intelligence AI model training method, characterized in that: The method comprises: Inputting sample text of natural language into a preset model to be trained, and determining sample tasks to be performed; Obtaining second structured data of the sample table; Obtaining a sample code for executing the sample task according to the sample task and the second structured data; According to the execution result of the sample code and the label result of the sample task, the model parameters of the preset model are updated to obtain an artificial intelligence AI model used to execute any one of the table processing methods of claims 1 to 8.
10. The method according to claim 9, characterized in that The preset model includes: a fourth module; The step of inputting the sample text of the natural language into the preset model to be trained to determine the sample task to be performed includes: inputting the sample text of the natural language into a fourth module, obtaining second task information indicating the sample task output by the fourth module; The obtaining of the second structured data of the sample form includes: inputting the element information of the sample form into the fourth module to obtain a third prompt word; wherein the third prompt word includes: the second structured data sorted in a predetermined order, for obtaining a sample code.
11. The method according to claim 10, characterized in that The preset model also includes: a fifth module; The obtaining, according to the sample task and the second structured data, a sample code for executing the sample task comprises: Inputting the sample text of the natural language into the fifth module to obtain sample features; Constructing alternative examples related to the sample task according to the sample feature, the third prompt word and the second task information; According to the alternative examples, sample code is generated.
12. The method according to claim 11, characterized in that The fifth module includes one or more optional capability units; wherein different optional capability units have different table processing capabilities; The method further comprises: Determining, according to the second task information, a second unit for performing a sample task from the candidate capability units; The sample feature and the third prompt word are input into the second unit, so that the second unit outputs a fourth prompt word; wherein the fourth prompt word is generated according to the target sample and is used to generate the sample code.
13. The method according to claim 12, characterized in that The preset model also includes a sixth module; According to the alternative example, generating the sample code includes: The fourth prompt word is input into the sixth module to generate the sample code.
14. The method according to any one of claims 9 to 13, characterized in that: The method further comprises: Obtain execution results corresponding to one or more natural language target texts; According to the feedback operation on the execution result, the AI model is subjected to enhanced training and / or online training.
15. A table processing device, characterized in that: include: A first determination module is used to determine a target task according to a target text in natural language; A first acquisition module, used for acquiring first structured data of a target table to be processed; An output module is used to output a target code for executing the target task according to the target task and the first structured data of the target table; wherein after the target code is executed, the target task based on the target table is realized.
16. An artificial intelligence (AI) model training device, characterized in that: The device comprises: A second determination module is used to input a sample text of a natural language into a preset model to be trained and determine a sample task to be performed; A second acquisition module, used for acquiring second structured data of the sample table; An obtaining module, used for obtaining a sample code for executing the sample task according to the sample task and the second structured data; An update module is used to update the model parameters of the preset model according to the execution results of the sample code and the label results of the sample task, so as to obtain an artificial intelligence AI model used to execute any one of the table processing methods of claims 1 to 8.
17. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method of any one of claims 1 to 8 or 9 to 14 when running the executable instructions.
18. A computer-readable storage medium, characterized in that: The readable storage medium stores an executable program, wherein the executable program implements the method of any one of claims 1 to 8 or 9 to 14 when executed by a processor.
Citation Information
Patent Citations
Model training and corpus generation method and device, equipment and storage medium
CN114281968A
Structured query language statement generation method and system
CN114610742A
Table information extraction method and device, equipment and medium
CN114818710A
Generation of text from structured data
US20200356729A1
Cited By
Spreadsheet intelligent interaction method, device and equipment and medium
CN120409441A
