Table processing method and device, electronic equipment and storage medium
By obtaining the target requirement description of the table and using a pre-trained model to automatically label and process the data, the problem of low table processing efficiency is solved, and efficient table data processing is achieved.
Patent Information
- Application Number
- CN202410582581.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2025-11-11
AI Technical Summary
The low efficiency of table processing in existing technologies is mainly due to the high barrier to entry for using table macros and the time-consuming and laborious process of learning and predefining them.
By obtaining the target requirement description of the table to be processed, and using a pre-trained multi-task analysis model and natural language processing model, the requirement type and data label are automatically labeled, the data to be processed is determined, and the data is processed according to the requirement type, reducing the reliance on table macros.
It simplifies and facilitates table processing, improves processing efficiency, and reduces the time cost of learning and predefining.
Smart Images

Figure CN120930612A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a table processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Tables are a common data format in documents. Currently, tables are widely used in daily work and life, with a large amount of document information presented in a concise tabular format. This is especially true in industries such as IT, banking, and finance, where the number of tables processed daily is staggering. Therefore, how to efficiently process tables is a pressing issue that needs to be addressed.
[0003] In related technologies, efficient table processing often relies on macros within the tables, i.e., pre-defined macros that are used to process the tables. However, using macros in tables has a certain learning curve, requiring time to learn, and pre-defining macros is time-consuming and laborious, resulting in low table processing efficiency. Summary of the Invention
[0004] To address the technical problem of low table processing efficiency caused by the high learning curve and the time-consuming and laborious process of pre-defining macros, this application provides a table processing method, apparatus, electronic device, and storage medium. The specific technical solution is as follows:
[0005] In a first aspect of the embodiments of this application, a table processing method is provided, the method comprising:
[0006] Obtain the table to be processed, and obtain the target requirement description corresponding to the table to be processed;
[0007] Determine the type of target requirement corresponding to the target requirement description, and determine the data to be processed in the table to be processed based on the target requirement description;
[0008] Based on the target requirement type, the data to be processed in the table to be processed is processed.
[0009] In an optional implementation, determining the target requirement type corresponding to the target requirement description, and determining the data to be processed in the table to be processed based on the target requirement description, includes:
[0010] The target requirement statement is input into a pre-trained multi-task analysis model, which then performs the following analysis on the target requirement statement:
[0011] Mark the type of target requirement corresponding to the stated target requirement;
[0012] Mark the first target column label corresponding to each character in the target requirement statement;
[0013] Mark the second target value flag corresponding to each character in the target requirement statement;
[0014] The data to be processed in the table to be processed is determined based on the first target column flag or the second target value flag.
[0015] In an optional implementation, determining the data to be processed in the table to be processed based on the first target column flag or the second target value flag includes:
[0016] From the characters expressed in the target requirement, a first character is selected, wherein the first target column flag corresponding to the first character is a first preset value;
[0017] Determine the first data composed of the first characters, and search for the header data that matches the first data in the table to be processed;
[0018] Determine the header corresponding to the header data, and fill the remaining cells in the column containing the header (excluding the header itself) with the data to be processed in the table to be processed.
[0019] or,
[0020] From the characters expressed in the target requirement, a second character is selected, wherein the second target value flag corresponding to the second character is a second preset value;
[0021] Determine the second data composed of the second character, and search for cell data that matches the second data in the table to be processed;
[0022] The cell data is identified as the data to be processed in the table to be processed.
[0023] In an optional implementation, processing the data to be processed in the table to be processed according to the target demand type includes:
[0024] If the target requirement type is the first type of requirement, find the data processing script corresponding to the target requirement type;
[0025] The data processing script is used to process the data to be processed in the table to be processed.
[0026] In an optional implementation, processing the data to be processed in the table to be processed according to the target demand type includes:
[0027] If the target demand type is the second type of demand type, the target demand type and the data to be processed are input into a pre-trained natural language processing model to obtain the sentiment classification corresponding to the data to be processed.
[0028] In an optional implementation, processing the data to be processed in the table to be processed according to the target demand type includes:
[0029] When the target requirement type is the third type of requirement, the target requirement type and the target requirement description are input into a pre-trained natural language processing model to obtain a specific requirement description of the target requirement description.
[0030] Find the data processing script corresponding to the target requirement type, and use the data processing script to process the data to be processed in the table to be processed, referring to the specific requirement description.
[0031] In an optional implementation, obtaining the target requirement description corresponding to the table to be processed includes:
[0032] In response to a natural language processing instruction, a natural language input dialog box is displayed, which is used to input a statement of requirements.
[0033] In the natural language input dialog box, obtain the target requirement expression for the table to be processed.
[0034] After processing the data to be processed in the table according to the target demand type, the method further includes:
[0035] The processing result of the data to be processed in the table to be processed is displayed in the natural language input dialog box;
[0036] In response to the confirmation command, the processing result of the data to be processed in the table to be processed is sent back to the table to be processed.
[0037] In an optional implementation, the method further includes, before execution:
[0038] Obtain the sample table and the corresponding sample requirement description, and perform the following annotation processing on the sample requirement description;
[0039] Label the sample requirement type corresponding to the sample requirement statement, and label the first sample column flag corresponding to each character in the sample requirement statement;
[0040] Mark the second sample value flag corresponding to each character in the sample requirement statement, and mark the sample data in the sample table corresponding to the sample requirement statement;
[0041] The sample requirement statement is input into a multi-task analysis model, which then performs the following analysis and processing on the sample requirement statement:
[0042] Label the predicted demand type corresponding to the sample demand description, and label the first prediction column flag corresponding to each character in the sample demand description;
[0043] Mark the second predicted value flag corresponding to each character in the sample requirement statement, and determine the predicted data in the sample table based on the first predicted column flag or the second predicted value flag;
[0044] Based on the sample demand type, the first sample column flag, the second sample value flag, the sample data, the prediction demand type, the first prediction column flag, the second prediction value flag, and the prediction data, the multi-task analysis model is subjected to supervised training to obtain a pre-trained multi-task analysis model.
[0045] In an optional implementation, obtaining the sample requirement description corresponding to the sample table includes:
[0046] Obtain the requirement description template and determine the target sample data in the sample table, wherein different requirement description templates correspond to different requirement types;
[0047] The target sample data in the sample table is filled into the slots of the requirement description template to obtain the sample requirement description corresponding to the sample table.
[0048] In an optional implementation, determining the target sample data in the sample table includes:
[0049] Obtain the sample header from the sample table, and determine the sample header data filled in the sample header as the target sample data in the sample table;
[0050] or,
[0051] Obtain sample cells from the sample table, and determine the sample cell data filled in the sample cells as the target sample data in the sample table.
[0052] In an optional implementation, determining the predicted data in the sample table based on the first predicted column flag or the second predicted value flag includes:
[0053] From the characters in the sample requirement description, a third character is selected, wherein the first prediction column flag corresponding to the third character is a third preset value;
[0054] Determine the third data composed of the third character, and search for the prediction header data that matches the third data in the sample table;
[0055] Determine the prediction header corresponding to the prediction header data, and determine the prediction cell data filled in the remaining prediction cells in the column where the prediction header is located (excluding the prediction header) as the prediction data in the sample table;
[0056] or,
[0057] From the characters in the sample requirement description, a fourth character is selected, wherein the second predicted value flag corresponding to the fourth character is a fourth preset value;
[0058] Determine the fourth data composed of the fourth character, and find the predicted cell data that matches the fourth data in the sample table;
[0059] The predicted cell data is determined as the predicted data in the sample table.
[0060] In an optional implementation, the step of performing supervised training on the multi-task analysis model based on the sample demand type, the first sample column identifier, the second sample value identifier, the sample data, the prediction demand type, the first prediction column identifier, the second prediction value identifier, and the prediction data to obtain a pre-trained multi-task analysis model includes:
[0061] Determine a first loss value between the sample demand type and the predicted demand type, and a second loss value between the first sample column label and the first predicted column label;
[0062] Determine a third loss value between the second sample value flag and the second predicted value flag, and a fourth loss value between the sample data and the predicted data;
[0063] The target loss value is determined based on the first loss value, the second loss value, the third loss value, and the fourth loss value.
[0064] Based on the target loss value, the multi-task analysis model is subjected to supervised training.
[0065] Training stops when the target loss value is less than a preset threshold, and a pre-trained multi-task analysis model is obtained.
[0066] In an optional implementation, the method further includes, before execution:
[0067] Obtain the sample requirement statement, the sample requirement type corresponding to the sample requirement statement, and the specific sample requirement description corresponding to the sample requirement statement;
[0068] The sample requirement description, the sample requirement type, and the sample requirement specification are provided to the initial natural language processing model for learning, thereby obtaining a pre-trained natural language processing model.
[0069] The initial natural language processing model learns the correspondence between the sample requirement statement, the sample requirement type and the sample specific requirement description, to obtain a pre-trained natural language processing model.
[0070] In a second aspect of this application, a table processing apparatus is also provided, the apparatus comprising:
[0071] The table retrieval module is used to retrieve the table to be processed.
[0072] The description acquisition module is used to acquire the target requirement description corresponding to the table to be processed;
[0073] The category and data determination module is used to determine the category of target requirement corresponding to the target requirement description, and to determine the data to be processed in the table to be processed based on the target requirement description.
[0074] The data processing module is used to process the data to be processed in the table to be processed according to the target requirement type.
[0075] In an optional implementation, the category and data determination module specifically includes:
[0076] The representation analysis submodule is used to input the target requirement representation into a pre-trained multi-task analysis model, and the trained multi-task analysis model performs the following analysis processing on the target requirement representation:
[0077] The category labeling submodule is used to label the target requirement category corresponding to the target requirement description;
[0078] The column labeling submodule is used to label the first target column label corresponding to each character in the target requirement description;
[0079] The value labeling module is used to label the second target value label corresponding to each character in the target requirement statement;
[0080] The data determination submodule is used to determine the data to be processed in the table to be processed based on the first target column flag or the second target value flag.
[0081] In an optional implementation, the data determination submodule is specifically used for:
[0082] From the characters expressed in the target requirement, a first character is selected, wherein the first target column flag corresponding to the first character is a first preset value;
[0083] Determine the first data composed of the first characters, and search for the header data that matches the first data in the table to be processed;
[0084] Determine the header corresponding to the header data, and fill the remaining cells in the column containing the header (excluding the header itself) with the data to be processed in the table to be processed.
[0085] or,
[0086] From the characters expressed in the target requirement, a second character is selected, wherein the second target value flag corresponding to the second character is a second preset value;
[0087] Determine the second data composed of the second character, and search for cell data that matches the second data in the table to be processed;
[0088] The cell data is identified as the data to be processed in the table to be processed.
[0089] In an optional implementation, the data processing module is specifically used for:
[0090] If the target requirement type is the first type of requirement, find the data processing script corresponding to the target requirement type;
[0091] The data processing script is used to process the data to be processed in the table to be processed.
[0092] In an optional implementation, the data processing module is specifically used for:
[0093] The step of processing the data to be processed in the table according to the target demand type includes:
[0094] If the target demand type is the second type of demand type, the target demand type and the data to be processed are input into a pre-trained natural language processing model to obtain the sentiment classification corresponding to the data to be processed.
[0095] In an optional implementation, the data processing module is specifically used for:
[0096] When the target requirement type is the third type of requirement, the target requirement type and the target requirement description are input into a pre-trained natural language processing model to obtain a specific requirement description of the target requirement description.
[0097] Find the data processing script corresponding to the target requirement type, and use the data processing script to process the data to be processed in the table to be processed, referring to the specific requirement description.
[0098] In an optional implementation, the representation acquisition module is specifically used for:
[0099] In response to a natural language processing instruction, a natural language input dialog box is displayed, which is used to input a statement of requirements.
[0100] In the natural language input dialog box, obtain the target requirement expression for the table to be processed.
[0101] The device further includes:
[0102] The result response module is used to display the processing result of the data to be processed in the table to be processed in the natural language input dialog box;
[0103] In response to the confirmation command, the processing result of the data to be processed in the table to be processed is sent back to the table to be processed.
[0104] In an optional implementation, the apparatus further includes:
[0105] The table and description acquisition module is used to acquire sample tables and corresponding sample requirement descriptions, and to perform the following annotation processing on the sample requirement descriptions;
[0106] The first annotation module is used to annotate the sample requirement type corresponding to the sample requirement statement and to annotate the first sample column flag corresponding to each character in the sample requirement statement.
[0107] The second annotation module is used to annotate the second sample value flag corresponding to each character in the sample requirement statement, and to annotate the sample data in the sample table corresponding to the sample requirement statement;
[0108] The requirement statement analysis module is used to input the sample requirement statement into the multi-task analysis model, and the multi-task analysis model performs the following analysis and processing on the sample requirement statement:
[0109] The third annotation module is used to annotate the predicted demand type corresponding to the sample demand description and to annotate the first prediction column flag corresponding to each character in the sample demand description.
[0110] The fourth annotation module is used to annotate the second predicted value flag corresponding to each character in the sample requirement statement, and to determine the predicted data in the sample table based on the first predicted column flag or the second predicted value flag.
[0111] The model training module is used to perform supervised training on the multi-task analysis model based on the sample demand type, the first sample column label, the second sample value label, the sample data, the prediction demand type, the first prediction column label, the second prediction value label, and the prediction data, to obtain a pre-trained multi-task analysis model.
[0112] In an optional implementation, the table and expression acquisition module specifically includes:
[0113] The template acquisition submodule is used to acquire requirement description templates, wherein different requirement description templates correspond to different requirement types;
[0114] The sample data determination submodule is used to determine the target sample data in the sample table;
[0115] The requirement description generation module is used to fill the target sample data in the sample table into the slots of the requirement description template to obtain the sample requirement description corresponding to the sample table.
[0116] In an optional implementation, the sample data determination submodule is specifically used for:
[0117] Obtain the sample header from the sample table, and determine the sample header data filled in the sample header as the target sample data in the sample table;
[0118] or,
[0119] Obtain sample cells from the sample table, and determine the sample cell data filled in the sample cells as the target sample data in the sample table.
[0120] In an optional implementation, the fourth annotation module is specifically used for:
[0121] From the characters in the sample requirement description, a third character is selected, wherein the first prediction column flag corresponding to the third character is a third preset value;
[0122] Determine the third data composed of the third character, and search for the prediction header data that matches the third data in the sample table;
[0123] Determine the prediction header corresponding to the prediction header data, and determine the prediction cell data filled in the remaining prediction cells in the column where the prediction header is located (excluding the prediction header) as the prediction data in the sample table;
[0124] or,
[0125] From the characters in the sample requirement description, a fourth character is selected, wherein the second predicted value flag corresponding to the fourth character is a fourth preset value;
[0126] Determine the fourth data composed of the fourth character, and find the predicted cell data that matches the fourth data in the sample table;
[0127] The predicted cell data is determined as the predicted data in the sample table.
[0128] In an optional implementation, the model training module is specifically used for:
[0129] Determine a first loss value between the sample demand type and the predicted demand type, and a second loss value between the first sample column label and the first predicted column label;
[0130] Determine a third loss value between the second sample value flag and the second predicted value flag, and a fourth loss value between the sample data and the predicted data;
[0131] The target loss value is determined based on the first loss value, the second loss value, the third loss value, and the fourth loss value.
[0132] Based on the target loss value, the multi-task analysis model is subjected to supervised training.
[0133] Training stops when the target loss value is less than a preset threshold, and a pre-trained multi-task analysis model is obtained.
[0134] In an optional implementation, the apparatus further includes:
[0135] The description, type, and description acquisition module is used to acquire the sample requirement description, the sample requirement type corresponding to the sample requirement description, and the specific sample requirement description corresponding to the sample requirement description.
[0136] The model learning module is used to provide the sample requirement description, the sample requirement type, and the sample requirement specification to the initial natural language processing model for learning, so as to obtain a pre-trained natural language processing model.
[0137] The initial natural language processing model learns the correspondence between the sample requirement statement, the sample requirement type and the sample specific requirement description, to obtain a pre-trained natural language processing model.
[0138] In a third aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0139] Memory, used to store computer programs;
[0140] When a processor executes a program stored in memory, it implements any of the table processing methods described in the first aspect above.
[0141] In a fourth aspect of the embodiments of this application, a storage medium is also provided, the storage medium storing instructions that, when run on a computer, cause the computer to execute any of the table processing methods described in the first aspect above.
[0142] In a fifth aspect of the embodiments of this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the table processing methods described above.
[0143] The technical solution provided in this application embodiment obtains a table to be processed and obtains the target requirement description corresponding to the table to be processed, determines the target requirement type corresponding to the target requirement description, determines the data to be processed in the table to be processed according to the target requirement description, and processes the data to be processed in the table to be processed according to the target requirement type.
[0144] By obtaining the target requirement description, determining the target requirement type corresponding to the target requirement description, and determining the data to be processed in the table to be processed based on the target requirement description, the data to be processed is processed according to the target requirement type. In this way, the table to be processed can be processed through the target requirement description in natural language, which is simple and convenient, no longer dependent on macros in the table, and improves the efficiency of table processing. Attached Figure Description
[0145] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0146] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0147] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0148] Figure 1This is a schematic diagram illustrating the implementation flow of a table processing method in an embodiment of this application;
[0149] Figure 2 This is a schematic diagram illustrating the implementation flow of another table processing method shown in the embodiments of this application;
[0150] Figure 3 This is a schematic diagram illustrating the input of a target requirement statement in a natural language input dialog box, as shown in an embodiment of this application.
[0151] Figure 4 This is a schematic diagram illustrating the implementation process of a multi-task analysis model training method in an embodiment of this application;
[0152] Figure 5 This is a schematic diagram illustrating the implementation process of a natural language processing model training method in an embodiment of this application;
[0153] Figure 6 This is a schematic diagram of the structure of a table processing device shown in an embodiment of this application;
[0154] Figure 7 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation
[0155] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0156] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0157] Currently, in daily work and life, we need to process tables, such as modifying data in a table. To process tables efficiently, users can input their needs in natural language, determine the type of need, and identify the data to be processed based on the needs. This allows for table processing through natural language input, making it simple and convenient, eliminating reliance on macros and improving efficiency.
[0158] like Figure 1 The diagram shown is a schematic representation of an implementation flow of a table processing method provided in this application. This method is applied to electronic devices and may specifically include the following steps:
[0159] S101, obtain the table to be processed, and obtain the target requirement description corresponding to the table to be processed.
[0160] In this embodiment of the application, when a user opens a spreadsheet document using spreadsheet processing software, the table in the spreadsheet document can be obtained as the table to be processed, thereby realizing the acquisition of the table to be processed. The table to be processed can be a table from various industries.
[0161] In addition, for the table to be processed, users can input the corresponding target requirement statement for the table to be processed, so as to realize the processing of the table and obtain the target requirement statement corresponding to the table to be processed.
[0162] It should be noted that the target requirement is expressed in natural language, such as "add XX- before the residential address". This application does not limit this.
[0163] S102, determine the type of target requirement corresponding to the target requirement description, and determine the data to be processed in the table to be processed based on the target requirement description.
[0164] In this embodiment of the application, for a target requirement description, the type of target requirement corresponding to that description can be determined. Furthermore, the data to be processed in the table to be processed can be determined based on the target requirement description.
[0165] It should be noted that the data to be processed in the table to be processed can be the data filled in a column of cells in the table to be processed, or it can be the data filled in a cell in the table to be processed. This application embodiment does not limit this.
[0166] For the types of target requirements, for example, they may include the following: 0-extract part, 1-delete part, 2-insert part, 3-retain decimal places, 4-round down, 5-merge, 6-extract date (year, month, day), 7-extract household registration from ID card, 8-extract gender from ID card, 9-extract date of birth from ID card, 10-condition filtering, 11-sentiment analysis, etc. This application embodiment does not limit these.
[0167] S103, process the data to be processed in the table according to the type of target requirement.
[0168] In this embodiment of the application, for the target requirement type corresponding to the target requirement description, the data to be processed in the table to be processed can be processed according to the target requirement type. This can be achieved using a corresponding data processing script.
[0169] Therefore, by finding the data processing script corresponding to the type of target requirement, the data to be processed in the table can be processed. In this way, the target requirement can be expressed in natural language, and the processing of the table can be realized. It is simple and convenient, no longer relying on macros in the table, and improving the efficiency of table processing.
[0170] For example, if the target requirement description corresponds to the target requirement type, assuming it is the above 4-rounding, then the corresponding data rounding script can be found to perform rounding processing on the data to be processed in the table.
[0171] Based on the above description of the technical solutions provided in the embodiments of this application, a table to be processed is obtained, as well as a target requirement statement corresponding to the table to be processed is obtained, the target requirement type corresponding to the target requirement statement is determined, and the data to be processed in the table to be processed is determined according to the target requirement statement, and the data to be processed in the table to be processed is processed according to the target requirement type.
[0172] By obtaining the target requirement description, determining the target requirement type corresponding to the target requirement description, and determining the data to be processed in the table to be processed based on the target requirement description, the data to be processed is processed according to the target requirement type. In this way, the table to be processed can be processed through the target requirement description in natural language, which is simple and convenient, no longer dependent on macros in the table, and improves the efficiency of table processing.
[0173] Furthermore, in this embodiment, a pre-trained multi-task analysis model, such as BERT, is introduced to analyze the target requirement statement, determine the type of target requirement corresponding to the target requirement statement, and identify the data to be processed in the table to be processed. Based on this, as... Figure 2 The diagram shown illustrates the implementation flow of another table processing method provided in this application. This method is applied to electronic devices and may specifically include the following steps:
[0174] S201, Obtain the table to be processed, and in response to the natural language processing instruction, display the natural language input dialog box, which is used to input the requirement statement.
[0175] S202, In the natural language input dialog box, obtain the target requirement statement for the table to be processed.
[0176] In this embodiment, when a user opens a spreadsheet document using spreadsheet software, the table within the document can be obtained and used as a table to be processed. The user can then manipulate this table using natural language. Therefore, the spreadsheet software includes a natural language processing button, allowing the user to perform preset operations such as clicking the button to trigger natural language processing instructions.
[0177] In response to a natural language processing instruction, a natural language input dialog box is displayed. This dialog box is used to input a description of the user's requirements for the table to be processed. The user's input description of the user's requirements for the table to be processed can be retrieved from the natural language input dialog box. For example, such as... Figure 3 As shown, in the natural language input dialog box, the user's input of the target requirement for the table to be processed, "Add XX- before the residential address", can be obtained.
[0178] S203, Input the target requirement statement into the pre-trained multi-task analysis model, and let the trained multi-task analysis model perform the following analysis on the target requirement statement.
[0179] S204 indicates the type of target requirement corresponding to the target requirement description.
[0180] S205, mark the first target column label corresponding to each character in the target requirement description.
[0181] S206, mark the second target value flag corresponding to each character in the target requirement statement.
[0182] S207, determine the data to be processed in the table based on the first target column flag or the second target value flag.
[0183] In this embodiment of the application, a pre-trained multi-task analysis model is introduced, which can perform (multi-task) analysis on the target requirement statement, determine the target requirement type corresponding to the target requirement statement, and the data to be processed in the table to be processed.
[0184] Specifically, the target requirement statement is input into a pre-trained multi-task analysis model, and the trained multi-task analysis model performs the following analysis on the target requirement statement:
[0185] 1. Mark the type of the target requirement corresponding to the target requirement statement, which means identifying the type of the target requirement corresponding to the target requirement statement; 2. Mark the first target column flag (token) corresponding to each character in the target requirement statement, which is used to indicate the processing of the data in a certain column cell of the to-be-processed table; 3. Mark the second target value flag (token) corresponding to each character in the target requirement statement, which is used to indicate the processing of the data in a certain cell of the to-be-processed table; 4. Determine the to-be-processed data in the to-be-processed table according to the first target column flag or the second target value flag.
[0186] It should be noted that for the target requirement statement, if it involves the processing of the data in a certain column cell of the to-be-processed table, the first target column flag of the character at the corresponding position in the target requirement statement is marked as 1, otherwise it is marked as 0. For example, for the target requirement statement "Add XX- in front of the residential address", which involves the processing of the residential address data in the residential address column of the to-be-processed table, the first target column flag of the character at the corresponding position in the target requirement statement is marked as 1, which means that the first target column flags corresponding to each character such as "residential", "address" are marked as 1, and the first target column flags corresponding to the remaining characters are marked as 0.
[0187] In addition, for the target requirement statement, if it involves the processing of the data in a certain cell of the to-be-processed table, the second target value flag of the character at the corresponding position in the target requirement statement is marked as 1, otherwise it is marked as 0. For example, for the target requirement statement "Round X", which involves the processing of the data X in a cell of the to-be-processed table, the second target value flag of the character at the corresponding position in the target requirement statement is marked as 1, which means that the second target value flag corresponding to the character "X" is marked as 1, and the second target value flags corresponding to the remaining characters are marked as 0.
[0188] Based on this, for the first target column flag corresponding to each character in the above-marked target requirement statement, judge whether there is a first target column flag with a value of the first preset value among these first target column flags. If so, screen out the first characters from the characters of the target requirement statement, where the first target column flag corresponding to the first characters is the first preset value (such as 1), determine the first data composed of the first characters, find the header data matching the first data from the to-be-processed table, determine the header corresponding to the header data (specifically the header cell), and determine the cell data filled in the remaining cells except the header in the column where the header is located as the to-be-processed data in the to-be-processed table.
[0189] Alternatively, for each character in the target requirement description above, the second target value flag corresponding to it is determined whether there is a second target value flag with a preset second value among these second target value flags. If so, the second character is selected from the characters in the target requirement description, where the second target value flag corresponding to the second character is a second preset value (e.g., 1). The second data composed of the second character is determined, and the cell data that matches the second data (different from the header data) is found in the table to be processed. The cell data is then determined as the data to be processed in the table to be processed.
[0190] S208, Process the data to be processed in the table according to the type of target requirement.
[0191] In the embodiments of this application, the target requirement types corresponding to the target requirement descriptions can be divided into different categories according to different data processing methods, which means that different categories of target requirement types are different in the data processing process.
[0192] Based on this, for the target requirement category corresponding to the target requirement description, if the target requirement category is the first type of requirement, find the data processing script corresponding to the target requirement category, and use the data processing script to process the data to be processed in the table to be processed.
[0193] For example, if the target requirement type is 3-retain decimal places, 4-round to the nearest integer, or 5-merge, which belongs to the first type of requirement, then you can directly find the data processing script corresponding to the target requirement type and use the data processing script to process the data to be processed in the table.
[0194] For example, for target demand types, assuming they are 6 - extract date (year, month, day), 7 - extract household registration from ID card, 8 - extract gender from ID card, and 9 - extract date of birth from ID card, which belong to the first type of demand, you can directly find the data processing script corresponding to the target demand type and use the data processing script to process the data to be processed in the table.
[0195] In addition, for the target demand category corresponding to the target demand expression, if the target demand category is the second type of demand category, the target demand category and the data to be processed are input into the pre-trained natural language processing model to obtain the sentiment classification corresponding to the data to be processed.
[0196] For example, if the target demand category is 11-sentiment analysis, which belongs to the second type of demand category, then the target demand category and the data to be processed can be input into a pre-trained natural language processing model to obtain the sentiment classification corresponding to the data to be processed.
[0197] It should be noted that the pre-trained natural language processing model, such as the T5 model, which stands for Transfer Text-to-Text Transformer, is a sequence-to-sequence model that supports adding the corresponding task identifier (i.e., the target requirement type mentioned above) to the input and can generate results in a targeted manner. This application embodiment does not limit this.
[0198] In addition, for the target requirement category corresponding to the target requirement description, if the target requirement category is the third type of requirement, the target requirement description needs to be parsed again to determine the specific operation and processing. To this end, the target requirement category and the target requirement description are input into the pre-trained natural language processing model to obtain the specific requirement description of the target requirement. The data processing script corresponding to the target requirement category is found, and the data to be processed in the table is processed using the data processing script and with reference to the specific requirement description.
[0199] It should be noted that the pre-trained natural language processing model, such as the T5 model mentioned above, can parse the user's natural language input (i.e., the target requirement statement) through character encoding and positional encoding. Specifically, the parsing is achieved by extracting important information (i.e., specific requirement description) from the natural language input (i.e., the target requirement statement) through a multi-head attention mechanism, while adding the corresponding task identifier (i.e., the target requirement type mentioned above) to the input, and generating results accordingly. This completes the parsing of the natural language input (i.e., the target requirement statement). The embodiments of this application do not limit this.
[0200] For example, for a target requirement type, assuming it is 0 - extract part, 1 - delete part, or 2 - insert part, which belongs to the third type of requirement, the target requirement type and target requirement description can be input into the T5 model to obtain the specific requirement description of the target requirement. Then, the data processing script corresponding to the target requirement type can be found. Using the data processing script, the data to be processed in the table can be processed with reference to the specific requirement description.
[0201] It should be noted that the specific requirements description refers to the specific operation processing, such as extracting the first few characters, extracting the last few characters, extracting the first and last few characters, deleting the first few characters, deleting the last few characters, deleting the first and last few characters, inserting the first xxx, inserting the last xxx, inserting the first and last xxx. The embodiments of this application do not limit this.
[0202] S209, In the natural language input dialog box, display the processing results of the data to be processed in the table to be processed.
[0203] S210, in response to the confirmation command, sends the processing result of the data to be processed in the pending table back to the pending table.
[0204] In this embodiment of the application, the processing result of the data to be processed in the table to be processed is obtained after the above processing. The processing result of the data to be processed in the table to be processed can be displayed in the natural language input dialog box. This means that the processing result of the data to be processed in the table to be processed will not be directly responded to the table to be processed, but the user must first confirm whether to use it.
[0205] Users can confirm the processing results of the data to be processed in the table. If they confirm, they can trigger the confirmation command through the confirmation button in the natural language input dialog box. In response to the confirmation command, the processing results of the data to be processed in the table will be sent back to the table.
[0206] By acquiring the target requirement description, a pre-trained multi-task analysis model is used to analyze and process the target requirement description to determine the target requirement type and the data to be processed in the table. Based on the target requirement type, the data to be processed is processed. In this way, the table to be processed can be processed through the target requirement description in natural language, which is simple and convenient, no longer dependent on macros in the table, and improves the efficiency of table processing.
[0207] Furthermore, the aforementioned pre-trained multi-task analysis model requires model training to obtain the desired results. Therefore, as... Figure 4 The diagram shown is a schematic representation of the implementation process of a multi-task analysis model training method provided in this application embodiment. This method is applied to electronic devices and may specifically include the following steps:
[0208] S401, obtain the sample table and the corresponding sample requirement description, and perform the following annotation processing on the sample requirement description.
[0209] S402, mark the sample requirement type corresponding to the sample requirement statement, and mark the first sample column flag corresponding to each character in the sample requirement statement.
[0210] S403, mark the second sample value flag corresponding to each character in the sample requirement statement, and mark the sample data in the sample table corresponding to the sample requirement statement.
[0211] In this embodiment of the application, a sample table and a corresponding sample requirement statement can be obtained. The sample requirement statement can be generated using a requirement statement template and target sample data from the sample table.
[0212] To this end, we obtain the requirement description template and determine the target sample data in the sample table. Different requirement description templates correspond to different requirement types. We fill the slots in the requirement description template with the target sample data from the sample table to obtain the sample requirement description corresponding to the sample table.
[0213] In this context, the target sample data in the sample table usually refers to the sample header data filled in the sample header of the sample table, or the sample cell data filled in the sample cell of the sample table. Here, the sample cell is different from the sample header.
[0214] This allows you to obtain the sample header from the sample table and determine the sample header data filled in the sample header as the target sample data in the sample table. Alternatively, you can obtain the sample cells from the sample table and determine the sample cell data filled in the sample cells as the target sample data in the sample table.
[0215] In addition, for the sample requirement statement, the following annotation process is performed: annotate the sample requirement type corresponding to the sample requirement statement, annotate the first sample column flag corresponding to each character in the sample requirement statement, annotate the second sample value flag corresponding to each character in the sample requirement statement, and annotate the sample data in the sample table corresponding to the sample requirement statement.
[0216] It should be noted that the sample data in the above sample table is similar to the data to be processed in the above table, referring to the sample cell data filled in a certain column of the sample table, or the sample cell data filled in a certain sample cell of the sample table.
[0217] In addition, for the sample requirement description, performing the above annotation process can yield its corresponding annotation results, namely, sample requirement type, first sample column label, second sample value label, and sample data. These annotation results can be regarded as sample labels for the sample requirement description, and this application embodiment does not limit this.
[0218] S404. Input the sample requirement statement into the multi-task analysis model, and the multi-task analysis model will perform the following analysis and processing on the sample requirement statement.
[0219] S405, mark the predicted demand type corresponding to the sample demand statement, and mark the first prediction column flag corresponding to each character in the sample demand statement.
[0220] S406, mark the second predicted value flag corresponding to each character in the sample requirement statement, and determine the predicted data in the sample table based on the first predicted column flag or the second predicted value flag.
[0221] In this embodiment of the application, the sample requirement statement is input into a multi-task analysis model, and the multi-task analysis model performs the following analysis on the sample requirement statement:
[0222] 1. Labeling the predicted demand type corresponding to the sample demand statement means identifying the predicted demand type corresponding to the sample demand statement; 2. Labeling the first prediction column flag corresponding to each character in the sample demand statement, which is used to indicate the processing of sample cell data in a certain column of the sample table; 3. Labeling the second prediction value flag corresponding to each character in the sample demand statement, which is used to indicate the processing of sample cell data in a certain sample cell of the sample table; 4. Determining the predicted data in the sample table based on the first prediction column flag or the second prediction value flag.
[0223] Specifically, for each character in the labeled sample requirement description, the first prediction column marker is determined to be a first prediction column marker with a value of a third preset value. If such a first prediction column marker exists, the third character is selected from the characters in the sample requirement description, where the first prediction column marker corresponding to the third character is a third preset value (e.g., 1). The third data composed of the third character is determined, and the prediction header data matching the third data is searched in the sample table. The prediction header corresponding to the prediction header data is determined, and the prediction cell data filled in the remaining prediction cells of the column containing the prediction header (excluding the prediction header) is determined as the prediction data in the sample table.
[0224] Alternatively, for each character in the labeled sample requirement statement, determine whether there is a second predicted value flag with a fourth preset value among these second predicted value flags. If so, select the fourth character from the characters in the sample requirement statement, where the second predicted value flag corresponding to the fourth character is the fourth preset value (e.g., 1); determine the fourth data composed of the fourth character, and find the predicted cell data that matches the fourth data in the sample table; determine the predicted cell data as the predicted data in the sample table.
[0225] It should be noted that for multi-task analysis models, such as BERT, in the process of labeling the predicted demand type corresponding to the sample demand description, the CLS position in the BERT encoding is used for multi-class classification. In the process of labeling the first prediction column label corresponding to each character in the sample demand description, multi-class classification is used, and sample header data is also used for attention processing. In the process of labeling the second prediction value label corresponding to each character in the sample demand description, multi-class classification is used, and sample cell data is also used for attention processing. This application embodiment does not limit this.
[0226] S407. Based on the sample demand type, the first sample column label, the second sample value label, the sample data, the prediction demand type, the first prediction column label, the second prediction value label, and the prediction data, supervised training is performed on the multi-task analysis model to obtain a pre-trained multi-task analysis model.
[0227] In this embodiment of the application, the sample demand type corresponding to the sample demand statement, the first sample column flag corresponding to each character in the sample demand statement, the second sample value flag corresponding to each character in the sample demand statement, the sample data in the sample table corresponding to the sample demand statement, and the predicted demand type corresponding to the sample demand statement, the first predicted column flag corresponding to each character in the sample demand statement, the second predicted value flag corresponding to each character in the sample demand statement, and the predicted data in the sample table can be used to perform supervised training on the multi-task analysis model to obtain a pre-trained multi-task analysis model.
[0228] The process involves determining a first loss value between the sample demand type and the predicted demand type, a second loss value between the first sample column label and the first predicted column label, a third loss value between the second sample value label and the second predicted value label, and a fourth loss value between the sample data and the predicted data. Based on the first, second, third, and fourth loss values, a target loss value is determined. The multi-task analysis model is then trained in a supervised manner based on the target loss value. Training is stopped when the target loss value is less than a preset threshold, resulting in a pre-trained multi-task analysis model.
[0229] It should be noted that for the first loss value, the second loss value, the third loss value, and the fourth loss value mentioned above, the average value of the first loss value, the second loss value, the third loss value, and the fourth loss value can be calculated to obtain the target loss value, or the weighted sum of the first loss value, the second loss value, the third loss value, and the fourth loss value can be calculated to obtain the target loss value. This application embodiment does not limit this.
[0230] Furthermore, the aforementioned pre-trained natural language processing models require model training to obtain the desired results. Therefore, as... Figure 5 The diagram shown is a schematic representation of the implementation flow of a natural language processing model training method provided in this application embodiment. This method is applied to electronic devices and may specifically include the following steps:
[0231] S501, obtain the sample requirement statement, the sample requirement type corresponding to the sample requirement statement, and the specific sample requirement description corresponding to the sample requirement statement.
[0232] S502, the sample requirement description, sample requirement type and sample requirement specification are provided to the initial natural language processing model for learning, to obtain a pre-trained natural language processing model.
[0233] In this embodiment of the application, the sample requirement statement, the sample requirement type corresponding to the sample requirement statement, and the sample specific requirement description corresponding to the sample requirement statement are obtained. The sample requirement statement, sample requirement type, and sample specific requirement description are provided to the initial natural language processing model for learning to obtain a pre-trained natural language processing model.
[0234] Among them, the sample requirement statement and the sample requirement type corresponding to the sample requirement statement can be regarded as the key, while the specific requirement description of the sample corresponding to the sample requirement statement can be regarded as the value. For the initial natural language processing model, the correspondence between the sample requirement statement, the sample requirement type and the specific requirement description can be learned, thereby obtaining the pre-trained natural language processing model. Subsequently, given the target requirement statement and the target requirement type, the specific requirement description corresponding to the target requirement statement can be predicted.
[0235] It should be noted that the sample requirement types are similar to the specific requirement descriptions above, referring to specific operation processing, such as extracting the first few characters, extracting the last few characters, extracting the first and last few characters, deleting the first few characters, deleting the last few characters, deleting the first and last few characters, inserting the first xxx, inserting the last xxx, inserting the first and last xxx. This application embodiment does not limit this.
[0236] Corresponding to the above method embodiments, this application also provides a table processing apparatus, such as... Figure 6 As shown, the device may include: a table acquisition module 610, a description acquisition module 620, a category and data determination module 630, and a data processing module 640.
[0237] The table acquisition module 610 is used to acquire the table to be processed.
[0238] The expression acquisition module 620 is used to acquire the target requirement expression corresponding to the table to be processed.
[0239] The category and data determination module 630 is used to determine the target requirement category corresponding to the target requirement description, and to determine the data to be processed in the table to be processed based on the target requirement description.
[0240] The data processing module 640 is used to process the data to be processed in the table to be processed according to the target requirement type.
[0241] In an optional implementation, the category and data determination module specifically includes:
[0242] The representation analysis submodule is used to input the target requirement representation into a pre-trained multi-task analysis model, and the trained multi-task analysis model performs the following analysis processing on the target requirement representation:
[0243] The category labeling submodule is used to label the target requirement category corresponding to the target requirement description;
[0244] The column labeling submodule is used to label the first target column label corresponding to each character in the target requirement description;
[0245] The value labeling module is used to label the second target value label corresponding to each character in the target requirement statement;
[0246] The data determination submodule is used to determine the data to be processed in the table to be processed based on the first target column flag or the second target value flag.
[0247] In an optional implementation, the data determination submodule is specifically used for:
[0248] From the characters expressed in the target requirement, a first character is selected, wherein the first target column flag corresponding to the first character is a first preset value;
[0249] Determine the first data composed of the first characters, and search for the header data that matches the first data in the table to be processed;
[0250] Determine the header corresponding to the header data, and fill the remaining cells in the column containing the header (excluding the header itself) with the data to be processed in the table to be processed.
[0251] or,
[0252] From the characters expressed in the target requirement, a second character is selected, wherein the second target value flag corresponding to the second character is a second preset value;
[0253] Determine the second data composed of the second character, and search for cell data that matches the second data in the table to be processed;
[0254] The cell data is identified as the data to be processed in the table to be processed.
[0255] In an optional implementation, the data processing module is specifically used for:
[0256] If the target requirement type is the first type of requirement, find the data processing script corresponding to the target requirement type;
[0257] The data processing script is used to process the data to be processed in the table to be processed.
[0258] In an optional implementation, the data processing module is specifically used for:
[0259] The step of processing the data to be processed in the table according to the target demand type includes:
[0260] If the target demand type is the second type of demand type, the target demand type and the data to be processed are input into a pre-trained natural language processing model to obtain the sentiment classification corresponding to the data to be processed.
[0261] In an optional implementation, the data processing module is specifically used for:
[0262] When the target requirement type is the third type of requirement, the target requirement type and the target requirement description are input into a pre-trained natural language processing model to obtain a specific requirement description of the target requirement description.
[0263] Find the data processing script corresponding to the target requirement type, and use the data processing script to process the data to be processed in the table to be processed, referring to the specific requirement description.
[0264] In an optional implementation, the representation acquisition module is specifically used for:
[0265] In response to a natural language processing instruction, a natural language input dialog box is displayed, which is used to input a statement of requirements.
[0266] In the natural language input dialog box, obtain the target requirement expression for the table to be processed.
[0267] The device further includes:
[0268] The result response module is used to display the processing result of the data to be processed in the table to be processed in the natural language input dialog box;
[0269] In response to the confirmation command, the processing result of the data to be processed in the table to be processed is sent back to the table to be processed.
[0270] In an optional implementation, the apparatus further includes:
[0271] The table and description acquisition module is used to acquire sample tables and corresponding sample requirement descriptions, and to perform the following annotation processing on the sample requirement descriptions;
[0272] The first annotation module is used to annotate the sample requirement type corresponding to the sample requirement statement and to annotate the first sample column flag corresponding to each character in the sample requirement statement.
[0273] The second annotation module is used to annotate the second sample value flag corresponding to each character in the sample requirement statement, and to annotate the sample data in the sample table corresponding to the sample requirement statement;
[0274] The requirement statement analysis module is used to input the sample requirement statement into the multi-task analysis model, and the multi-task analysis model performs the following analysis and processing on the sample requirement statement:
[0275] The third annotation module is used to annotate the predicted demand type corresponding to the sample demand description and to annotate the first prediction column flag corresponding to each character in the sample demand description.
[0276] The fourth annotation module is used to annotate the second predicted value flag corresponding to each character in the sample requirement statement, and to determine the predicted data in the sample table based on the first predicted column flag or the second predicted value flag.
[0277] The model training module is used to perform supervised training on the multi-task analysis model based on the sample demand type, the first sample column label, the second sample value label, the sample data, the prediction demand type, the first prediction column label, the second prediction value label, and the prediction data, to obtain a pre-trained multi-task analysis model.
[0278] In an optional implementation, the table and expression acquisition module specifically includes:
[0279] The template acquisition submodule is used to acquire requirement description templates, wherein different requirement description templates correspond to different requirement types;
[0280] The sample data determination submodule is used to determine the target sample data in the sample table;
[0281] The requirement description generation module is used to fill the target sample data in the sample table into the slots of the requirement description template to obtain the sample requirement description corresponding to the sample table.
[0282] In an optional implementation, the sample data determination submodule is specifically used for:
[0283] Obtain the sample header from the sample table, and determine the sample header data filled in the sample header as the target sample data in the sample table;
[0284] or,
[0285] Obtain sample cells from the sample table, and determine the sample cell data filled in the sample cells as the target sample data in the sample table.
[0286] In an optional implementation, the fourth annotation module is specifically used for:
[0287] From the characters in the sample requirement description, a third character is selected, wherein the first prediction column flag corresponding to the third character is a third preset value;
[0288] Determine the third data composed of the third character, and search for the prediction header data that matches the third data in the sample table;
[0289] Determine the prediction header corresponding to the prediction header data, and determine the prediction cell data filled in the remaining prediction cells in the column where the prediction header is located (excluding the prediction header) as the prediction data in the sample table;
[0290] or,
[0291] From the characters in the sample requirement description, a fourth character is selected, wherein the second predicted value flag corresponding to the fourth character is a fourth preset value;
[0292] Determine the fourth data composed of the fourth character, and find the predicted cell data that matches the fourth data in the sample table;
[0293] The predicted cell data is determined as the predicted data in the sample table.
[0294] In an optional implementation, the model training module is specifically used for:
[0295] Determine a first loss value between the sample demand type and the predicted demand type, and a second loss value between the first sample column label and the first predicted column label;
[0296] Determine a third loss value between the second sample value flag and the second predicted value flag, and a fourth loss value between the sample data and the predicted data;
[0297] The target loss value is determined based on the first loss value, the second loss value, the third loss value, and the fourth loss value.
[0298] Based on the target loss value, the multi-task analysis model is subjected to supervised training.
[0299] Training stops when the target loss value is less than a preset threshold, and a pre-trained multi-task analysis model is obtained.
[0300] In an optional implementation, the apparatus further includes:
[0301] The description, type, and description acquisition module is used to acquire the sample requirement description, the sample requirement type corresponding to the sample requirement description, and the specific sample requirement description corresponding to the sample requirement description.
[0302] The model learning module is used to provide the sample requirement description, the sample requirement type, and the sample requirement specification to the initial natural language processing model for learning, so as to obtain a pre-trained natural language processing model.
[0303] The initial natural language processing model learns the correspondence between the sample requirement statement, the sample requirement type and the sample specific requirement description, to obtain a pre-trained natural language processing model.
[0304] This application also provides an electronic device, such as... Figure 7 As shown, it includes a processor 71, a communication interface 72, a memory 73, and a communication bus 74. The processor 71, the communication interface 72, and the memory 73 communicate with each other through the communication bus 74.
[0305] Memory 73 is used to store computer programs;
[0306] When processor 71 executes the program stored in memory 73, it performs the following steps:
[0307] Obtain the table to be processed and the target requirement description corresponding to the table to be processed; determine the target requirement type corresponding to the target requirement description, and determine the data to be processed in the table to be processed according to the target requirement description; process the data to be processed in the table to be processed according to the target requirement type.
[0308] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0309] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0310] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0311] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0312] In another embodiment provided in this application, a storage medium is also provided, which stores instructions that, when run on a computer, cause the computer to execute any of the table processing methods described in the above embodiments.
[0313] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the table processing methods described in the above embodiments.
[0314] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0315] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0316] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0317] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A table processing method, characterized in that, The method includes: Obtain the table to be processed, and obtain the target requirement description corresponding to the table to be processed; Determine the type of target requirement corresponding to the target requirement description, and determine the data to be processed in the table to be processed based on the target requirement description; Based on the target requirement type, the data to be processed in the table to be processed is processed.
2. The method according to claim 1, characterized in that, The step of determining the target requirement type corresponding to the target requirement description, and determining the data to be processed in the table to be processed based on the target requirement description, includes: The target requirement statement is input into a pre-trained multi-task analysis model, which then performs the following analysis on the target requirement statement: Mark the type of target requirement corresponding to the stated target requirement; Mark the first target column label corresponding to each character in the target requirement statement; Mark the second target value flag corresponding to each character in the target requirement statement; The data to be processed in the table to be processed is determined based on the first target column flag or the second target value flag.
3. The method according to claim 2, characterized in that, The step of determining the data to be processed in the table to be processed based on the first target column flag or the second target value flag includes: From the characters expressed in the target requirement, a first character is selected, wherein the first target column flag corresponding to the first character is a first preset value; Determine the first data composed of the first characters, and search for the header data that matches the first data in the table to be processed; Determine the header corresponding to the header data, and fill the remaining cells in the column containing the header (excluding the header itself) with the data to be processed in the table to be processed. or, From the characters expressed in the target requirement, a second character is selected, wherein the second target value flag corresponding to the second character is a second preset value; Determine the second data composed of the second character, and search for cell data that matches the second data in the table to be processed; The cell data is identified as the data to be processed in the table to be processed.
4. The method according to claim 1, characterized in that, The step of processing the data to be processed in the table according to the target demand type includes: If the target requirement type is the first type of requirement, find the data processing script corresponding to the target requirement type; The data processing script is used to process the data to be processed in the table to be processed.
5. The method according to claim 1, characterized in that, The step of processing the data to be processed in the table according to the target demand type includes: If the target demand type is the second type of demand type, the target demand type and the data to be processed are input into a pre-trained natural language processing model to obtain the sentiment classification corresponding to the data to be processed.
6. The method according to claim 1, characterized in that, The step of processing the data to be processed in the table according to the target demand type includes: When the target requirement type is the third type of requirement, the target requirement type and the target requirement description are input into a pre-trained natural language processing model to obtain a specific requirement description of the target requirement description. Find the data processing script corresponding to the target requirement type, and use the data processing script to process the data to be processed in the table to be processed, referring to the specific requirement description.
7. The method according to claim 1, characterized in that, The step of obtaining the target requirement description corresponding to the table to be processed includes: In response to a natural language processing instruction, a natural language input dialog box is displayed, which is used to input a statement of requirements. In the natural language input dialog box, obtain the target requirement expression for the table to be processed. After processing the data to be processed in the table according to the target demand type, the method further includes: The processing result of the data to be processed in the table to be processed is displayed in the natural language input dialog box; In response to the confirmation command, the processing result of the data to be processed in the table to be processed is sent back to the table to be processed.
8. The method according to claim 2, characterized in that, Before executing the method, the following is also included: Obtain the sample table and the corresponding sample requirement description, and perform the following annotation processing on the sample requirement description; Label the sample requirement type corresponding to the sample requirement statement, and label the first sample column flag corresponding to each character in the sample requirement statement; Mark the second sample value flag corresponding to each character in the sample requirement statement, and mark the sample data in the sample table corresponding to the sample requirement statement; The sample requirement statement is input into a multi-task analysis model, which then performs the following analysis and processing on the sample requirement statement: Label the predicted demand type corresponding to the sample demand description, and label the first prediction column flag corresponding to each character in the sample demand description; Mark the second predicted value flag corresponding to each character in the sample requirement statement, and determine the predicted data in the sample table based on the first predicted column flag or the second predicted value flag; Based on the sample demand type, the first sample column flag, the second sample value flag, the sample data, the prediction demand type, the first prediction column flag, the second prediction value flag, and the prediction data, the multi-task analysis model is subjected to supervised training to obtain a pre-trained multi-task analysis model.
9. The method according to claim 8, characterized in that, Obtain the sample requirement description corresponding to the sample table, including: Obtain the requirement description template and determine the target sample data in the sample table, wherein different requirement description templates correspond to different requirement types; The target sample data in the sample table is filled into the slots of the requirement description template to obtain the sample requirement description corresponding to the sample table.
10. The method according to claim 9, characterized in that, Determining the target sample data in the sample table includes: Obtain the sample header from the sample table, and determine the sample header data filled in the sample header as the target sample data in the sample table; or, Obtain sample cells from the sample table, and determine the sample cell data filled in the sample cells as the target sample data in the sample table.
11. The method according to claim 8, characterized in that, The step of determining the predicted data in the sample table based on the first predicted column flag or the second predicted value flag includes: From the characters in the sample requirement description, a third character is selected, wherein the first prediction column flag corresponding to the third character is a third preset value; Determine the third data composed of the third character, and search for the prediction header data that matches the third data in the sample table; Determine the prediction header corresponding to the prediction header data, and determine the prediction cell data filled in the remaining prediction cells in the column where the prediction header is located (excluding the prediction header) as the prediction data in the sample table; or, From the characters in the sample requirement description, a fourth character is selected, wherein the second predicted value flag corresponding to the fourth character is a fourth preset value; Determine the fourth data composed of the fourth character, and find the predicted cell data that matches the fourth data in the sample table; The predicted cell data is determined as the predicted data in the sample table.
12. The method according to claim 8, characterized in that, The step of performing supervised training on the multi-task analysis model based on the sample demand type, the first sample column identifier, the second sample value identifier, the sample data, the prediction demand type, the first prediction column identifier, the second prediction value identifier, and the prediction data to obtain a pre-trained multi-task analysis model includes: Determine a first loss value between the sample demand type and the predicted demand type, and a second loss value between the first sample column label and the first predicted column label; Determine a third loss value between the second sample value flag and the second predicted value flag, and a fourth loss value between the sample data and the predicted data; The target loss value is determined based on the first loss value, the second loss value, the third loss value, and the fourth loss value. Based on the target loss value, the multi-task analysis model is subjected to supervised training. Training stops when the target loss value is less than a preset threshold, and a pre-trained multi-task analysis model is obtained.
13. The method according to claim 6, characterized in that, Before executing the method, the following is also included: Obtain the sample requirement statement, the sample requirement type corresponding to the sample requirement statement, and the specific sample requirement description corresponding to the sample requirement statement; The sample requirement description, the sample requirement type, and the sample requirement specification are provided to the initial natural language processing model for learning, thereby obtaining a pre-trained natural language processing model. The initial natural language processing model learns the correspondence between the sample requirement statement, the sample requirement type and the sample specific requirement description, to obtain a pre-trained natural language processing model.
14. A form processing device, characterized in that, The device includes: The table retrieval module is used to retrieve the table to be processed. The description acquisition module is used to acquire the target requirement description corresponding to the table to be processed; The category and data determination module is used to determine the category of target requirement corresponding to the target requirement description, and to determine the data to be processed in the table to be processed based on the target requirement description. The data processing module is used to process the data to be processed in the table to be processed according to the target requirement type.
15. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-13.
16. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-13.