Programming statement generation method, device, electronic device and storage medium

By obtaining the target table and demand statement, generating and splicing the sub-components of the initial programming statement, and using the multi-task model to process the embedding vector, the problem of unregistered word processing in the Seq2Seq model in the natural language to SQL conversion is solved, and the syntax is correct and Executable SQL statements are generated.

CN118246409BActive Publication Date: 2024-08-27ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410673408.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-08-27
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

The Seq2Seq model is affected by the scope of the vocabulary when converting natural language to SQL statements. It cannot handle unregistered words in the table, and the grammatical correctness and executability of the generated SQL statements cannot be guaranteed.

Method used

By obtaining the target table and requirement statement, the sub-components of the initial programming statement are generated and spliced, and the pre-trained multi-task model is used to process the embedding vector to generate the target programming statement, avoiding the impact of vocabulary range and ensuring grammatical correctness and executability. sex.

Benefits of technology

It effectively avoids the impact of vocabulary range, ensures the grammatical correctness and executability of the generated programming statements, and improves the accuracy of SQL statement conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118246409B
    Figure CN118246409B
Patent Text Reader

Abstract

The present application relates to a programming statement generation method, device, electronic device and storage medium, the method comprising: obtaining a target table and a target requirement expression corresponding to the target table, and determining the target table content in the target table; for any initial component of the initial programming statement, generating subcomponents of the initial component according to the target requirement expression and the target table content; splicing the subcomponents of the initial component to obtain the target component; generating the target programming statement from each of the target components corresponding to the initial programming statement. The influence of the vocabulary range can be avoided, and the grammatical correctness and executability of the generated programming statement are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a programming statement generation method, device, electronic device and storage medium. Background Art

[0002] At present, in the question-and-answer business of tables, it is often necessary to add, delete, modify, and query tables, so it is necessary to write and develop programming statements corresponding to data operations, such as SQL (Structured Query Language) statements, Java statements, Python statements, etc. This method is inefficient, so NL2SQL (Natural Language to SQL, natural language conversion to executable SQL statements) came into being.

[0003] Currently, for NL2SQL, the Seq2Seq (end-to-end neural network) model is used to realize the conversion from natural language to executable SQL statements. However, there are the following problems: due to the scope of the vocabulary, OOV (Out Of Vocabulary) may appear in the header content of the table, and the Seq2Seq model cannot generate correct SQL statements. In addition, the Seq2Seq model is a generative model, and the grammatical correctness and executableness of the generated SQL statements cannot be guaranteed. Summary of the invention

[0004] In order to solve the above-mentioned NL2SQL, the Seq2Seq (end-to-end neural network) model is used to realize the conversion from natural language to executable SQL statements. However, there are the following problems: Affected by the scope of the vocabulary, the header content in the table sometimes appears OOV (Out Of Vocabulary, unregistered words), and the Seq2Seq model cannot generate correct SQL statements. The Seq2Seq model is a generative model, and the grammatical correctness and executableness of the generated SQL statements cannot be guaranteed. The embodiment of the present application provides a programming statement generation method, device, electronic device and storage medium. The specific technical solution is as follows:

[0005] In a first aspect of an embodiment of the present application, a method for generating a programming statement is first provided, the method comprising:

[0006] Obtaining a target table and a target requirement statement corresponding to the target table, and determining target table content in the target table;

[0007] For any initial component of the initial programming statement, generate a subcomponent of the initial component according to the target requirement statement and the target table content;

[0008] splicing the subcomponents of the initial component to obtain a target component;

[0009] A target programming statement is generated from each of the target components corresponding to the initial programming statement.

[0010] In an optional implementation, the determining the target table content in the target table includes:

[0011] Determine a target header in the target table, and for any header cell in the target header, obtain the header content filled in the header cell;

[0012] Determine the remaining cells in the column where the header cell is located except the header cell;

[0013] Select a target cell from the remaining cells, and obtain the cell content filled in the target cell;

[0014] Combine the header content with the cell content to obtain the header representation content corresponding to the header cell;

[0015] All the header representation contents are determined as target table contents in the target table.

[0016] In an optional embodiment, for any initial component of the initial programming statement, generating subcomponents of the initial component according to the target requirement statement and the target table content includes:

[0017] The target requirement statement and all the header representation contents are input into a pre-trained multi-task model, and the pre-trained multi-task model performs the following processing:

[0018] According to the custom flag and the sequence flag, the target requirement expression and all the header representation contents are spliced ​​to obtain a splicing result;

[0019] For any component content in the splicing result, vectorize the component content to obtain an embedding vector corresponding to the component content;

[0020] The composition content includes one of the following: the custom mark, the sequence mark, each character in the target requirement statement, and each character in the header representation content;

[0021] For any initial component of the initial programming statement, a subcomponent of the initial component is generated according to the embedding vector corresponding to the corresponding component content in the concatenation result.

[0022] In an optional implementation, the target requirement statement and all the header representation contents are spliced ​​according to the custom flag and the sequence flag to obtain a splicing result, including:

[0023] According to the custom flag and the sequence flag, the target demand expression is spliced ​​to obtain a first expression splicing result;

[0024] The custom mark is located at the beginning of the first expression splicing result, and the sequence mark is located at the end of the first expression splicing result;

[0025] For any of the header representation contents, splicing the header representation contents according to the sequence mark to obtain a second content splicing result;

[0026] Wherein, the sequence mark is located at the end of the second content splicing result;

[0027] The first expression splicing result and all the second content splicing results are sequentially spliced ​​to obtain a splicing result.

[0028] In an optional implementation, when the initial component is an initial restricted part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result includes:

[0029] Searching for the embedding vector corresponding to the custom logo from the embedding vectors corresponding to the component contents of the splicing result;

[0030] Classify the embedding vector corresponding to the custom mark to obtain the restriction probability of each restriction quantity corresponding to the initial restriction part;

[0031] Selecting the maximum restriction probability, and determining the restriction quantity corresponding to the maximum restriction probability;

[0032] Determine the restriction quantity corresponding to the maximum restriction probability as a subcomponent of the initial restriction part;

[0033] The step of splicing the subcomponents of the initial component to obtain the target component includes:

[0034] The restriction quantity corresponding to the maximum restriction probability is concatenated with the sign of the initial restriction part to obtain the target restriction part.

[0035] In an optional implementation, when the initial component is the remaining part except the initial restricted part, generating the subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result includes:

[0036] For any of the header representation contents, the following processing is performed to obtain the column representation embedding vector corresponding to the header representation content:

[0037] From the embedding vectors corresponding to the constituent contents of the concatenated result, searching for the embedding vector corresponding to each character in the header representation content and the embedding vector corresponding to the sequence marker concatenated with the header representation content;

[0038] The embedding vector corresponding to the custom logo, the embedding vector corresponding to each character in the header representation content, and the embedding vector corresponding to the sequence logo spliced ​​with the header representation content are processed by a self-attention mechanism to obtain a processing result;

[0039] Adding the embedding vector corresponding to the custom flag to the processing result to obtain a column representation embedding vector corresponding to the header representation content;

[0040] Subcomponents of the initial component are generated according to the embedding vectors corresponding to the corresponding component contents in the splicing result and the column representation embedding vectors corresponding to any of the header representation contents.

[0041] In an optional implementation, when the initial component is an initial selected part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any header representation content includes:

[0042] Classify the embedding vector corresponding to the custom logo to obtain the first column probability of each column quantity corresponding to the initial selection part;

[0043] Selecting the largest probability of the first column, and determining the number of columns corresponding to the largest probability of the first column;

[0044] Classifying the column representation embedding vectors corresponding to all the header representation contents to obtain a first usage probability of each of the header representation contents being used by the initial selection portion;

[0045] Sorting the first usage probabilities and selecting top N first usage probabilities, where N is the number of columns corresponding to the largest first column probability;

[0046] The subcomponents of the initial selection part are generated according to the first usage probabilities of the top N.

[0047] In an optional implementation, generating subcomponents of the initial selection part according to the first usage probabilities of the top N names includes:

[0048] Determine N header representation contents corresponding to the top N first usage probabilities, and obtain N header contents from the N header representation contents;

[0049] Determine N of the header contents as the first subcomponent of the initial selected part;

[0050] Classify the column representation embedding vectors corresponding to the N header representation contents to obtain first inter-column probabilities of each inter-column operation corresponding to the initial selected part and aggregation probabilities of each aggregation operation;

[0051] Selecting the largest first inter-column probability, and determining the inter-column operation corresponding to the largest first inter-column probability;

[0052] Selecting the maximum aggregation probability, and determining the aggregation operation corresponding to the maximum aggregation probability;

[0053] Determine the inter-column operation corresponding to the largest first inter-column probability as a second subcomponent of the initial selection part;

[0054] Determine the aggregation operation corresponding to the maximum aggregation probability as the third subcomponent of the initial selection part;

[0055] The step of splicing the subcomponents of the initial component to obtain the target component includes:

[0056] Using the inter-column operation corresponding to the largest first inter-column probability, concatenate the N header contents to obtain a first selected concatenation result;

[0057] Splicing the aggregation operation corresponding to the maximum aggregation probability with the first selection splicing result to obtain a second selection splicing result;

[0058] The second selection splicing result is spliced ​​with the mark of the initial selection part to obtain the target selection part.

[0059] In an optional implementation, when the initial component is an initial grouping part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any header representation content includes:

[0060] Classify the embedding vector corresponding to the custom mark to obtain second column probabilities of the number of columns corresponding to the initial grouping part;

[0061] Selecting the largest probability of the second column, and determining the number of columns corresponding to the largest probability of the second column;

[0062] Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a second usage probability of each header representation content being used by the initial grouping part;

[0063] Sort the second usage probabilities and select the top M second usage probabilities, where M is the number of columns corresponding to the largest second column probability;

[0064] The sub-components of the initial grouping part are generated according to the second usage probabilities of the top M names.

[0065] In an optional implementation, generating subcomponents of the initial grouping part according to the second usage probabilities of the top M names includes:

[0066] Determine M of the header representation contents corresponding to the top M second usage probabilities, and obtain M header contents from the M header representation contents;

[0067] Determining M header contents as subcomponents of the initial grouping part;

[0068] The step of splicing the subcomponents of the initial component to obtain the target component includes:

[0069] The M header contents are concatenated with the flag corresponding to the initial grouping part to obtain the target grouping part.

[0070] In an optional implementation, when the initial component is an initial ascending and descending part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any header representation content includes:

[0071] Classify the embedding vector corresponding to the custom mark to obtain the third column probability of each column quantity corresponding to the initial ascending and descending order part, and the ascending and descending order probability of each ascending and descending order operation;

[0072] Select the largest third column probability, and determine the number of columns corresponding to the largest third column probability;

[0073] Select the largest ascending and descending probability, and determine the ascending and descending operation corresponding to the largest ascending and descending probability;

[0074] Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a third usage probability of each of the header representation contents being used in the initial ascending and descending order parts;

[0075] Sorting the third usage probabilities and selecting the top 0 third usage probabilities, where 0 is the number of columns corresponding to the largest third column probability;

[0076] The sub-components of the initial ascending and descending order part are generated according to the ascending and descending order operations corresponding to the third usage probabilities of the top 0 and the largest ascending and descending order probabilities.

[0077] In an optional implementation, the generating of the subcomponents of the initial ascending and descending order part according to the ascending and descending order operation corresponding to the third usage probability of the top 0 and the maximum ascending and descending order probability includes:

[0078] Determine O header representation contents corresponding to the top O third usage probabilities;

[0079] Classify the column representation embedding vectors corresponding to the O header representation contents to obtain second inter-column probabilities of inter-column operations corresponding to the initial ascending and descending order parts;

[0080] Selecting the largest second inter-column probability, and determining the inter-column operation corresponding to the largest second inter-column probability;

[0081] Obtain O header contents from the O header representation contents, and determine the O header contents as the first subcomponent of the initial ascending and descending order part;

[0082] Determine the ascending and descending operation corresponding to the largest ascending and descending probability as the second subcomponent of the initial ascending and descending part;

[0083] Determine the inter-column operation corresponding to the largest second inter-column probability as the third sub-component of the initial ascending and descending order part;

[0084] The step of splicing the subcomponents of the initial component to obtain the target component includes:

[0085] Using the inter-column operation corresponding to the second inter-column probability with the largest value, concatenate the contents of the O headers to obtain a first ascending and descending order concatenation result;

[0086] Splicing the ascending and descending order operation corresponding to the largest ascending and descending order probability with the first ascending and descending order splicing result to obtain a second ascending and descending order splicing result;

[0087] The second ascending and descending sequence splicing result is spliced ​​with the mark of the initial ascending and descending sequence part to obtain the target ascending and descending sequence part.

[0088] In an optional implementation, when the initial component is an initial condition part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any header representation content includes:

[0089] Classify the embedding vector corresponding to the custom mark to obtain the number probability of each condition number corresponding to the initial condition part and the relationship probability of each condition relationship;

[0090] Selecting the largest probability of the number, and determining the number of conditions corresponding to the largest probability of the number;

[0091] Select the largest relationship probability, and determine the conditional relationship corresponding to the largest relationship probability;

[0092] From the embedding vectors corresponding to the component contents of the concatenated result, searching for the embedding vector corresponding to each character in the target requirement statement;

[0093] Classify the embedding vector corresponding to each character in the target requirement expression to obtain a conditional value flag corresponding to each character in the target requirement expression;

[0094] Select a target character from the target requirement statement, wherein the conditional value flag of the target character is a preset value;

[0095] The target characters form M conditional values, where M is the number of conditions corresponding to the maximum probability of the number;

[0096] Subcomponents of the initial condition part are generated according to the M condition values, the conditional relationship corresponding to the maximum relationship probability, and the column representation embedding vector corresponding to any of the header representation contents.

[0097] In an optional implementation, generating subcomponents of the initial condition part according to the M condition values, the conditional relationship corresponding to the maximum relationship probability, and the column representation embedding vector corresponding to any of the header representation contents includes:

[0098] For any of the conditional values, matching the embedding vector corresponding to the target character constituting the conditional value with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content matched by the conditional value;

[0099] Determine the condition value and the header content in the header representation content that matches the condition value as the first subcomponent of the initial condition part;

[0100] For any of the conditional values, classify the embedding vectors corresponding to the target characters constituting the conditional value and the column representation embedding vectors corresponding to the header representation content matched by the conditional value to obtain the logical probabilities of the logical operations corresponding to the conditional value;

[0101] Select the largest logical probability, and determine the logical operation corresponding to the largest logical probability;

[0102] Determine the logic operation corresponding to the largest logic probability as the second subcomponent of the initial condition part;

[0103] Determine the conditional relationship corresponding to the maximum relationship probability as the third subcomponent of the initial condition part;

[0104] The step of splicing the subcomponents of the initial component to obtain the target component includes:

[0105] For any of the conditional values, using the logical operation corresponding to the maximum logical probability corresponding to the conditional value, the conditional value is spliced ​​with the header content in the header representation content that matches the conditional value to obtain a first conditional splicing result;

[0106] Using the conditional relationship corresponding to the largest relationship probability, all the first conditional splicing results are spliced ​​to obtain a second conditional splicing result;

[0107] The second condition concatenation result is concatenated with the flag of the initial condition part to obtain the target condition part.

[0108] In an optional implementation, matching the embedding vector corresponding to the target character constituting the conditional value with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content matched by the conditional value includes:

[0109] Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a fourth usage probability of each of the header representation contents being used in the initial condition part;

[0110] According to the fourth usage probability, the embedding vector corresponding to the target character constituting the conditional value is matched with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content that matches the conditional value.

[0111] In an optional embodiment, before executing the method, the method further includes:

[0112] Obtain a sample form and a sample requirement statement corresponding to the sample form, and determine all sample header representation contents in the sample form;

[0113] The sample requirement statement and all sample header representation contents are input into the multi-task model, and the multi-task model performs the following processing:

[0114] According to the custom flag and the sequence flag, the sample requirement statement and all the sample header representation contents are spliced ​​to obtain a sample splicing result;

[0115] For any sample component content in the sample splicing result, vectorize the sample component content to obtain a sample embedding vector corresponding to the sample component content;

[0116] The sample composition content includes one of the following: the custom mark, the sequence mark, each character in the sample requirement statement, and each character in the sample header representation content;

[0117] For any sample component of the sample programming statement, predict a predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result;

[0118] determining a loss value between a predicted subcomponent of the sample component and a sample subcomponent of the sample component;

[0119] The multi-task model is trained according to the loss value, and when the loss value satisfies a convergence condition, the model training is stopped to obtain a pre-trained multi-task model.

[0120] In an optional implementation, the determining of all sample header representation contents in the sample table includes:

[0121] Determine a sample header in the sample table, and for any sample header cell in the sample header, obtain the sample header content filled in the sample header cell;

[0122] Determine the remaining sample cells in the column where the sample table header cell is located except the sample table header cell;

[0123] Select a target sample cell from the remaining sample cells, and obtain the sample cell content filled in the target sample cell;

[0124] The sample header content is combined with the sample cell content to obtain the sample header representation content corresponding to the sample header cell.

[0125] In an optional implementation, the sample requirement statement and all sample header representation contents are spliced ​​according to the custom flag and the sequence flag to obtain a sample splicing result, including:

[0126] splicing the sample requirement expressions according to the custom flag and the sequence flag to obtain a first sample expression splicing result;

[0127] The custom mark is located at the start position of the splicing result of the first sample representation, and the sequence mark is located at the end position of the splicing result of the first sample representation;

[0128] For any of the sample header representation contents, splicing the sample header representation contents according to the sequence mark to obtain a second sample content splicing result;

[0129] The sequence mark is located at the end of the concatenated result of the second sample content;

[0130] The first sample expression splicing result and all the second sample content splicing results are sequentially spliced ​​to obtain a sample splicing result.

[0131] In an optional implementation, when the sample component is a sample restricted part, predicting a predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result includes:

[0132] Searching for the sample embedding vector corresponding to the custom logo from the sample embedding vectors corresponding to the sample component contents of the sample splicing result;

[0133] Classify the sample embedding vector corresponding to the custom mark to obtain the sample restriction probability of each sample restriction quantity corresponding to the sample restriction part;

[0134] Selecting the maximum sample restriction probability, and determining the sample restriction quantity corresponding to the maximum sample restriction probability;

[0135] The sample restriction quantity corresponding to the maximum sample restriction probability is determined as the prediction subcomponent of the sample restriction part.

[0136] In an optional implementation, when the sample component is the remaining sample part except the sample restricted part, predicting the predicted sub-component of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result includes:

[0137] For any of the sample header representation contents, the following processing is performed to obtain the sample column representation embedding vector corresponding to the sample header representation content:

[0138] From the sample embedding vectors corresponding to the sample constituent contents of the sample splicing result, searching for the sample embedding vector corresponding to each character in the sample header representation content and the sample embedding vector corresponding to the sequence marker spliced ​​with the sample header representation content;

[0139] The sample embedding vector corresponding to the custom logo, the sample embedding vector corresponding to each character in the sample header representation content, and the sample embedding vector corresponding to the sequence logo spliced ​​with the sample header representation content are processed by a self-attention mechanism to obtain a sample processing result;

[0140] Adding the sample embedding vector corresponding to the custom flag to the sample processing result to obtain a sample column representation embedding vector corresponding to the sample header representation content;

[0141] According to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content, the predicted sub-component of the sample component is predicted.

[0142] In an optional implementation, when the sample component is a sample selection part, predicting a predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content includes:

[0143] Classify the sample embedding vector corresponding to the custom mark to obtain a first sample column probability of each sample column quantity corresponding to the sample selection part;

[0144] Selecting the largest probability of the first sample column, and determining the number of the sample columns corresponding to the largest probability of the first sample column;

[0145] Classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain the first sample use probability of each sample header representation content used by the sample selection part;

[0146] Sorting the first sample usage probabilities and selecting the top N first sample usage probabilities, where N is the number of sample columns corresponding to the largest first sample column probability;

[0147] The prediction subcomponents of the sample selection part are predicted according to the usage probabilities of the first samples in the top N.

[0148] In an optional implementation, predicting the prediction subcomponents of the sample selection part according to the first sample usage probabilities of the top N samples includes:

[0149] Determine N sample header representation contents corresponding to the top N first sample usage probabilities, and obtain N sample header contents from the N sample header representation contents;

[0150] Determining N sample header contents as the first prediction subcomponent of the sample selection part;

[0151] Classify the sample column representation embedding vectors corresponding to the N sample header representation contents to obtain a first sample column probability of each sample column operation corresponding to the sample selection part and a sample aggregation probability of each sample aggregation operation;

[0152] Selecting the largest first inter-sample column probability, and determining the inter-sample column operation corresponding to the largest first inter-sample column probability;

[0153] Selecting the largest sample aggregation probability, and determining the sample aggregation operation corresponding to the largest sample aggregation probability;

[0154] Determine the sample column operation corresponding to the largest first sample column probability as the second prediction subcomponent of the sample selection part;

[0155] The sample aggregation operation corresponding to the maximum sample aggregation probability is determined as the third prediction subcomponent of the sample selection part.

[0156] In an optional implementation, when the sample component is a sample grouping part, predicting a predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content includes:

[0157] Classify the sample embedding vector corresponding to the custom mark to obtain a second sample column probability of each sample column quantity corresponding to the sample grouping part;

[0158] Selecting the largest probability of the second sample column, and determining the number of the sample columns corresponding to the largest probability of the second sample column;

[0159] Classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a second sample usage probability of each sample header representation content used by the sample grouping part;

[0160] Sort the second sample usage probabilities and select the top M second sample usage probabilities, where M is the number of sample columns corresponding to the largest second sample column probability;

[0161] According to the usage probabilities of the second samples of the top M, a prediction sub-component of the sample grouping part is generated.

[0162] In an optional implementation, generating the prediction subcomponent of the sample grouping part according to the second sample usage probabilities of the top M comprises:

[0163] Determine M sample header representation contents corresponding to the top M second sample usage probabilities, and obtain M sample header contents from the M sample header representation contents;

[0164] The M sample header contents are determined as predicted subcomponents of the sample grouping part.

[0165] In an optional embodiment, when the sample component is a sample ascending and descending order part, predicting a predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content includes:

[0166] Classify the sample embedding vector corresponding to the custom mark to obtain the third sample column probability of each sample column quantity corresponding to the sample ascending and descending order part, and the sample ascending and descending order probability of each sample ascending and descending order operation;

[0167] Selecting the largest third sample column probability, and determining the number of sample columns corresponding to the largest third sample column probability;

[0168] Select the largest probability of the sample ascending and descending order, and determine the sample ascending and descending order operation corresponding to the largest probability of the sample ascending and descending order;

[0169] Classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a third sample usage probability of using each sample header representation content in the ascending and descending order parts of the samples;

[0170] Sorting the third sample usage probabilities, and selecting the top O third sample usage probabilities, where O is the number of sample columns corresponding to the largest third sample column probability;

[0171] According to the sample ascending and descending operations corresponding to the third sample usage probabilities of the top 0 and the maximum sample ascending and descending probabilities, prediction subcomponents of the sample ascending and descending parts are generated.

[0172] In an optional implementation, the sample ascending and descending operations corresponding to the third sample usage probabilities of the top 0 and the maximum sample ascending and descending probabilities are used to generate the prediction subcomponents of the sample ascending and descending parts, including:

[0173] Determine the representation contents of the O sample headers corresponding to the usage probabilities of the top O third samples;

[0174] Classify the sample column representation embedding vectors corresponding to the O sample header representation contents to obtain a second sample column probability of the inter-sample column operation corresponding to the sample ascending and descending order parts;

[0175] Selecting the largest second sample inter-column probability, and determining the sample inter-column operation corresponding to the largest second sample inter-column probability;

[0176] Obtain O sample header contents from the O sample header representation contents, and determine the O sample header contents as the first predicted subcomponent of the sample ascending and descending order part;

[0177] Determine the sample ascending and descending operation corresponding to the largest sample ascending and descending probability as the second prediction subcomponent of the sample ascending and descending part;

[0178] The sample-column operation corresponding to the largest second sample-column probability is determined as the third prediction subcomponent of the sample ascending and descending order part.

[0179] In an optional implementation, when the sample component is a sample condition part, predicting a predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content includes:

[0180] Classify the sample embedding vector corresponding to the custom mark to obtain the sample number probability of each sample condition number corresponding to the sample condition part and the sample relationship probability of each sample condition relationship;

[0181] Selecting the maximum sample number probability, and determining the sample condition number corresponding to the maximum sample number probability;

[0182] Select the largest sample relationship probability, and determine the sample conditional relationship corresponding to the largest sample relationship probability;

[0183] From the sample embedding vectors corresponding to the sample component contents of the sample splicing result, searching for the sample embedding vector corresponding to each character in the sample requirement statement;

[0184] Classify the sample embedding vector corresponding to each character in the sample requirement statement to obtain a sample condition value flag corresponding to each character in the sample requirement statement;

[0185] Selecting a sample character from the sample requirement statement, wherein the sample condition value flag of the sample character is a preset value;

[0186] The sample characters form M sample condition values, where M is the sample condition number corresponding to the maximum probability of the sample number;

[0187] The prediction subcomponent of the sample condition part is generated according to the M sample condition values, the sample condition relationship corresponding to the maximum sample relationship probability, and the sample column representation embedding vector corresponding to any sample header representation content.

[0188] In an optional implementation, generating the prediction subcomponent of the sample condition part according to the M sample condition values, the sample condition relationship corresponding to the maximum sample relationship probability, and the sample column representation embedding vector corresponding to any sample header representation content includes:

[0189] For any of the sample condition values, matching the sample embedding vector corresponding to the sample characters constituting the sample condition value with the sample column representation embedding vector corresponding to any of the sample header representation contents to obtain the sample header representation contents matched by the sample condition value;

[0190] Determine the sample condition value and the sample header content in the sample header representation content that matches the sample condition value as a first prediction subcomponent of the sample condition part;

[0191] For any of the sample condition values, classify the sample embedding vectors corresponding to the sample characters constituting the sample condition value and the sample column representation embedding vectors corresponding to the sample header representation content matched by the sample condition value to obtain sample logical probabilities of each sample logical operation corresponding to the sample condition value;

[0192] Select the largest sample logical probability, and determine the sample logical operation corresponding to the largest sample logical probability;

[0193] Determine the sample logic operation corresponding to the maximum sample logic probability as the second prediction subcomponent of the sample condition part;

[0194] The sample condition relationship corresponding to the maximum sample relationship probability is determined as the third prediction subcomponent of the sample condition part.

[0195] In an optional implementation, matching the sample embedding vector corresponding to the sample characters constituting the sample condition value with the sample column representation embedding vector corresponding to any sample header representation content to obtain the header representation content matched by the sample condition value includes:

[0196] Classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a fourth sample usage probability of each sample header representation content used in the sample conditional part;

[0197] According to the fourth sample usage probability, the sample embedding vector corresponding to the sample characters constituting the sample condition value is matched with the sample column representation embedding vector corresponding to any of the sample header representation contents to obtain the sample header representation content that matches the sample condition value.

[0198] In a second aspect of the embodiment of the present application, a programming statement generating device is also provided, the device comprising:

[0199] Table acquisition module, used to acquire the target table;

[0200] A statement acquisition module, used to acquire the target requirement statement corresponding to the target table;

[0201] a content determination module, used to determine the target table content in the target table;

[0202] A part generation module, for generating, for any initial component of the initial programming statement, a sub-component of the initial component according to the target requirement statement and the target table content;

[0203] A partial splicing module, used for splicing subcomponents of the initial component to obtain a target component;

[0204] The statement generation module is used to generate a target programming statement from each of the target components of the initial programming statement.

[0205] In an optional implementation, the content determination module is specifically configured to:

[0206] Determine a target header in the target table, and for any header cell in the target header, obtain the header content filled in the header cell;

[0207] Determine the remaining cells in the column where the header cell is located except the header cell;

[0208] Select a target cell from the remaining cells, and obtain the cell content filled in the target cell;

[0209] Combine the header content with the cell content to obtain the header representation content corresponding to the header cell;

[0210] All the header representation contents are determined as target table contents in the target table.

[0211] In an optional implementation, the part generation module specifically includes:

[0212] The expression and content input submodule is used to input the target requirement expression and all the header representation contents into the pre-trained multi-task model, and the pre-trained multi-task model performs the following processing:

[0213] The expression and content splicing submodule is used to splice the target demand expression and all the header representation contents according to the custom mark and sequence mark to obtain the splicing result;

[0214] A content processing module, used for performing vectorization processing on any component content in the splicing result to obtain an embedding vector corresponding to the component content;

[0215] The composition content includes one of the following: the custom mark, the sequence mark, each character in the target requirement statement, and each character in the header representation content;

[0216] The part generation submodule is used to generate a sub-component of any initial component of the initial programming statement according to the embedding vector corresponding to the corresponding component content in the splicing result.

[0217] In an optional implementation, the expression and content splicing submodule is specifically used for:

[0218] According to the custom flag and the sequence flag, the target demand expression is spliced ​​to obtain a first expression splicing result;

[0219] The custom mark is located at the beginning of the first expression splicing result, and the sequence mark is located at the end of the first expression splicing result;

[0220] For any of the header representation contents, splicing the header representation contents according to the sequence mark to obtain a second content splicing result;

[0221] Wherein, the sequence mark is located at the end of the second content splicing result;

[0222] The first expression splicing result and all the second content splicing results are sequentially spliced ​​to obtain a splicing result.

[0223] In an optional implementation, when the initial component is an initial restricted portion, the portion generating submodule is specifically configured to:

[0224] Searching for the embedding vector corresponding to the custom logo from the embedding vectors corresponding to the component contents of the splicing result;

[0225] Classify the embedding vector corresponding to the custom mark to obtain the restriction probability of each restriction quantity corresponding to the initial restriction part;

[0226] Selecting the maximum restriction probability, and determining the restriction quantity corresponding to the maximum restriction probability;

[0227] Determine the restriction quantity corresponding to the maximum restriction probability as a subcomponent of the initial restriction part;

[0228] The partial splicing module is specifically used for:

[0229] The restriction quantity corresponding to the maximum restriction probability is concatenated with the sign of the initial restriction part to obtain the target restriction part.

[0230] In an optional embodiment, when the initial component is the remaining part except the initial restricted part, the part generation submodule specifically includes:

[0231] The content processing unit is used to perform the following processing on any of the header representation contents to obtain a column representation embedding vector corresponding to the header representation content:

[0232] A vector search unit, used to search the embedding vector corresponding to each character in the header representation content and the embedding vector corresponding to the sequence mark spliced ​​with the header representation content from the embedding vectors corresponding to the component contents of the splicing result;

[0233] A vector processing unit, configured to perform self-attention mechanism processing on the embedding vector corresponding to the custom logo, the embedding vector corresponding to each character in the header representation content, and the embedding vector corresponding to the sequence logo spliced ​​with the header representation content to obtain a processing result;

[0234] A vector adding unit, configured to add the embedding vector corresponding to the custom flag to the processing result to obtain a column representation embedding vector corresponding to the header representation content;

[0235] The part generating unit is used to generate a sub-component of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any of the header representation contents.

[0236] In an optional implementation, when the initial component is an initial selected part, the part generating unit specifically includes:

[0237] A first vector classification subunit is used to classify the embedding vector corresponding to the custom mark to obtain a first column probability of each column quantity corresponding to the initial selection part;

[0238] a column quantity determination subunit, configured to select the largest first column probability and determine the column quantity corresponding to the largest first column probability;

[0239] A second vector classification subunit is used to classify the column representation embedding vectors corresponding to all the header representation contents to obtain a first usage probability of each of the header representation contents used by the initial selection part;

[0240] a probability sorting subunit, configured to sort the first usage probabilities and select the top N first usage probabilities, where N is the number of columns corresponding to the largest first column probability;

[0241] The part generating subunit is used to generate subcomponents of the initial selected part according to the first usage probabilities of the top N names.

[0242] In an optional implementation, the part generation subunit is specifically used for:

[0243] Determine N header representation contents corresponding to the top N first usage probabilities, and obtain N header contents from the N header representation contents;

[0244] Determine N of the header contents as the first subcomponent of the initial selected part;

[0245] Classify the column representation embedding vectors corresponding to the N header representation contents to obtain first inter-column probabilities of each inter-column operation corresponding to the initial selected part and aggregation probabilities of each aggregation operation;

[0246] Selecting the largest first inter-column probability, and determining the inter-column operation corresponding to the largest first inter-column probability;

[0247] Selecting the maximum aggregation probability, and determining the aggregation operation corresponding to the maximum aggregation probability;

[0248] Determine the inter-column operation corresponding to the largest first inter-column probability as a second subcomponent of the initial selection part;

[0249] Determine the aggregation operation corresponding to the maximum aggregation probability as the third subcomponent of the initial selection part;

[0250] The partial splicing modules are specifically used for:

[0251] Using the inter-column operation corresponding to the largest first inter-column probability, concatenate the N header contents to obtain a first selected concatenation result;

[0252] Splicing the aggregation operation corresponding to the maximum aggregation probability with the first selection splicing result to obtain a second selection splicing result;

[0253] The second selection splicing result is spliced ​​with the mark of the initial selection part to obtain the target selection part.

[0254] In an optional implementation, when the initial component is an initial grouping part, the part generating unit specifically includes:

[0255] A first vector classification subunit is used to classify the embedding vector corresponding to the custom mark to obtain second column probabilities of the number of columns corresponding to the initial grouping part;

[0256] a column quantity determination subunit, configured to select the largest second column probability and determine the column quantity corresponding to the largest second column probability;

[0257] A second vector classification subunit is used to classify the column representation embedding vectors corresponding to all the header representation contents to obtain a second usage probability of each of the header representation contents being used in the initial grouping part;

[0258] a probability sorting subunit, configured to sort the second usage probabilities and select the top M second usage probabilities, where M is the number of columns corresponding to the largest second column probability;

[0259] The part generating subunit is used to generate the subcomponents of the initial grouping part according to the second usage probabilities of the top M names.

[0260] In an optional implementation, the part generation subunit is specifically used for:

[0261] Determine M of the header representation contents corresponding to the top M second usage probabilities, and obtain M header contents from the M header representation contents;

[0262] Determining M header contents as subcomponents of the initial grouping part;

[0263] The partial splicing module is specifically used for:

[0264] The M header contents are concatenated with the flag corresponding to the initial grouping part to obtain the target grouping part.

[0265] In an optional implementation, when the initial component is an initial ascending and descending order part, the part generating unit specifically includes:

[0266] A first vector classification subunit is used to classify the embedding vector corresponding to the custom mark to obtain the third column probability of each column quantity corresponding to the initial ascending and descending order part, and the ascending and descending order probability of each ascending and descending order operation;

[0267] a column quantity determination subunit, configured to select the largest third column probability and determine the column quantity corresponding to the largest third column probability;

[0268] An ascending and descending order operation determination subunit, used for selecting the largest ascending and descending order probability, and determining the ascending and descending order operation corresponding to the largest ascending and descending order probability;

[0269] A second vector classification unit is used to classify the column representation embedding vectors corresponding to all the header representation contents to obtain a third usage probability of each of the header representation contents being used in the initial ascending and descending order parts;

[0270] a probability sorting subunit, used to sort the third usage probabilities and select the top O third usage probabilities, where O is the number of columns corresponding to the largest third column probability;

[0271] The part generating subunit is used to generate the subcomponents of the initial ascending and descending order part according to the ascending and descending order operation corresponding to the third usage probability of the top 0 and the largest ascending and descending order probability.

[0272] In an optional implementation, the part generation subunit is specifically used for:

[0273] Determine O header representation contents corresponding to the top O third usage probabilities;

[0274] Classify the column representation embedding vectors corresponding to the O header representation contents to obtain second inter-column probabilities of inter-column operations corresponding to the initial ascending and descending order parts;

[0275] Selecting the largest second inter-column probability, and determining the inter-column operation corresponding to the largest second inter-column probability;

[0276] Obtain O header contents from the O header representation contents, and determine the O header contents as the first subcomponent of the initial ascending and descending order part;

[0277] Determine the ascending and descending operation corresponding to the largest ascending and descending probability as the second subcomponent of the initial ascending and descending part;

[0278] Determine the inter-column operation corresponding to the largest second inter-column probability as the third sub-component of the initial ascending and descending order part;

[0279] The partial splicing module is specifically used for:

[0280] Using the inter-column operation corresponding to the second inter-column probability with the largest value, concatenate the contents of the O headers to obtain a first ascending and descending order concatenation result;

[0281] Splicing the ascending and descending order operation corresponding to the largest ascending and descending order probability with the first ascending and descending order splicing result to obtain a second ascending and descending order splicing result;

[0282] The second ascending and descending sequence splicing result is spliced ​​with the mark of the initial ascending and descending sequence part to obtain the target ascending and descending sequence part.

[0283] In an optional implementation, when the initial component is an initial condition part, the part generation unit specifically includes:

[0284] A first vector classification subunit is used to classify the embedding vector corresponding to the custom mark to obtain the number probability of each condition number corresponding to the initial condition part and the relationship probability of each condition relationship;

[0285] A condition number determination subunit, used for selecting the maximum number probability and determining the condition number corresponding to the maximum number probability;

[0286] A conditional relationship determination subunit, used for selecting the maximum relationship probability and determining the conditional relationship corresponding to the maximum relationship probability;

[0287] A vector search subunit, used to search the embedding vector corresponding to each character in the target requirement expression from the embedding vectors corresponding to the component contents of the splicing result;

[0288] A second vector classification subunit is used to classify the embedded vector corresponding to each character in the target requirement expression to obtain a condition value flag corresponding to each character in the target requirement expression;

[0289] A character selection module, used for selecting a target character from the target requirement expression, wherein the conditional value flag of the target character is a preset value;

[0290] A character composition subunit, used for composing M conditional values ​​from the target character, wherein M is the number of conditions corresponding to the maximum probability of the number;

[0291] The part generating subunit is used to generate the subcomponent of the initial condition part according to the M condition values, the conditional relationship corresponding to the maximum relationship probability and the column representation embedding vector corresponding to any one of the header representation contents.

[0292] In an optional implementation, the part generation subunit is specifically used for:

[0293] For any of the conditional values, matching the embedding vector corresponding to the target character constituting the conditional value with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content matched by the conditional value;

[0294] Determine the condition value and the header content in the header representation content that matches the condition value as the first subcomponent of the initial condition part;

[0295] For any of the conditional values, classify the embedding vectors corresponding to the target characters constituting the conditional value and the column representation embedding vectors corresponding to the header representation content matched by the conditional value to obtain the logical probabilities of the logical operations corresponding to the conditional value;

[0296] Select the largest logical probability, and determine the logical operation corresponding to the largest logical probability;

[0297] Determine the logic operation corresponding to the largest logic probability as the second subcomponent of the initial condition part;

[0298] Determine the conditional relationship corresponding to the maximum relationship probability as the third subcomponent of the initial condition part;

[0299] The partial splicing modules are specifically used for:

[0300] For any of the conditional values, using the logical operation corresponding to the maximum logical probability corresponding to the conditional value, the conditional value is spliced ​​with the header content in the header representation content that matches the conditional value to obtain a first conditional splicing result;

[0301] Using the conditional relationship corresponding to the largest relationship probability, all the first conditional splicing results are spliced ​​to obtain a second conditional splicing result;

[0302] The second condition concatenation result is concatenated with the flag of the initial condition part to obtain the target condition part.

[0303] In an optional implementation, the part generation subunit is specifically used for:

[0304] Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a fourth usage probability of each of the header representation contents being used in the initial condition part;

[0305] According to the fourth usage probability, the embedding vector corresponding to the target character constituting the conditional value is matched with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content that matches the conditional value.

[0306] In an optional embodiment, the device further comprises:

[0307] A table and expression acquisition module, used to acquire a sample table and a sample requirement expression corresponding to the sample table;

[0308] A representation content determination module, used to determine the representation content of all sample headers in the sample table;

[0309] The expression and content input module is used to input the sample requirement expression and all the sample header representation contents into the multi-task model, and the multi-task model performs the following processing:

[0310] A statement and content splicing module, used to splice the sample requirement statement and all sample header representation contents according to a custom mark and a sequence mark to obtain a sample splicing result;

[0311] A component content processing module, used for performing vectorization processing on any sample component content in the sample splicing result to obtain a sample embedding vector corresponding to the sample component content;

[0312] The sample composition content includes one of the following: the custom mark, the sequence mark, each character in the sample requirement statement, and each character in the sample header representation content;

[0313] a partial prediction module, for predicting, for any sample component of the sample programming statement, a predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result;

[0314] a loss value determination module, used to determine a loss value between a predicted subcomponent of the sample component and a sample subcomponent of the sample component;

[0315] The model training module is used to perform model training on the multi-task model according to the loss value, and stop the model training when the loss value meets the convergence condition to obtain a pre-trained multi-task model.

[0316] In an optional implementation, the representation content determination module is specifically used to:

[0317] Determine a sample header in the sample table, and for any sample header cell in the sample header, obtain the sample header content filled in the sample header cell;

[0318] Determine the remaining sample cells in the column where the sample table header cell is located except the sample table header cell;

[0319] Select a target sample cell from the remaining sample cells, and obtain the sample cell content filled in the target sample cell;

[0320] The sample header content is combined with the sample cell content to obtain the sample header representation content corresponding to the sample header cell.

[0321] In an optional implementation, the expression and content splicing module is specifically used for:

[0322] splicing the sample requirement expressions according to the custom flag and the sequence flag to obtain a first sample expression splicing result;

[0323] The custom mark is located at the start position of the splicing result of the first sample representation, and the sequence mark is located at the end position of the splicing result of the first sample representation;

[0324] For any of the sample header representation contents, splicing the sample header representation contents according to the sequence mark to obtain a second sample content splicing result;

[0325] The sequence mark is located at the end of the concatenated result of the second sample content;

[0326] The first sample expression splicing result and all the second sample content splicing results are sequentially spliced ​​to obtain a sample splicing result.

[0327] In an optional implementation, when the sample component is a sample restriction portion, the partial prediction module is specifically configured to:

[0328] Searching for the sample embedding vector corresponding to the custom logo from the sample embedding vectors corresponding to the sample component contents of the sample splicing result;

[0329] Classify the sample embedding vector corresponding to the custom mark to obtain the sample restriction probability of each sample restriction quantity corresponding to the sample restriction part;

[0330] Selecting the maximum sample restriction probability, and determining the sample restriction quantity corresponding to the maximum sample restriction probability;

[0331] The sample restriction quantity corresponding to the maximum sample restriction probability is determined as the prediction subcomponent of the sample restriction part.

[0332] In an optional implementation, when the sample component is the remaining sample part except the sample restriction part, the part prediction module specifically includes:

[0333] The representation content processing submodule is used to perform the following processing on any of the sample header representation contents to obtain a sample column representation embedding vector corresponding to the sample header representation content;

[0334] A vector search submodule, used to search the sample embedding vector corresponding to each character in the sample header representation content and the sample embedding vector corresponding to the sequence mark spliced ​​with the sample header representation content from the sample embedding vector corresponding to the sample composition content of the sample splicing result;

[0335] A vector processing submodule, used to perform self-attention mechanism processing on the sample embedding vector corresponding to the custom logo, the sample embedding vector corresponding to each character in the sample header representation content, and the sample embedding vector corresponding to the sequence logo spliced ​​with the sample header representation content, to obtain a sample processing result;

[0336] A vector addition submodule, configured to add the sample embedding vector corresponding to the custom flag to the sample processing result to obtain a sample column representation embedding vector corresponding to the sample header representation content;

[0337] The partial prediction submodule is used to predict the predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content.

[0338] In an optional implementation, when the sample component is a sample selection part, the part prediction submodule specifically includes:

[0339] A first vector classification unit, configured to classify the sample embedding vector corresponding to the custom mark to obtain a first sample column probability of each sample column quantity corresponding to the sample selection part;

[0340] a column quantity determination unit, configured to select the largest probability of the first sample column, and determine the number of sample columns corresponding to the largest probability of the first sample column;

[0341] A second vector classification unit is used to classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a first sample usage probability of each sample header representation content used by the sample selection part;

[0342] a probability sorting unit, configured to sort the first sample usage probabilities and select the top N first sample usage probabilities, where N is the number of sample columns corresponding to the largest first sample column probability;

[0343] The part prediction unit is used to predict the prediction subcomponent of the sample selection part according to the usage probabilities of the first samples in the top N.

[0344] In an optional implementation, the partial prediction unit is specifically used for:

[0345] Determine N sample header representation contents corresponding to the top N first sample usage probabilities, and obtain N sample header contents from the N sample header representation contents;

[0346] Determining N sample header contents as the first prediction subcomponent of the sample selection part;

[0347] Classify the sample column representation embedding vectors corresponding to the N sample header representation contents to obtain a first sample column probability of each sample column operation corresponding to the sample selection part and a sample aggregation probability of each sample aggregation operation;

[0348] Selecting the largest first inter-sample column probability, and determining the inter-sample column operation corresponding to the largest first inter-sample column probability;

[0349] Selecting the largest sample aggregation probability, and determining the sample aggregation operation corresponding to the largest sample aggregation probability;

[0350] Determine the sample column operation corresponding to the largest first sample column probability as the second prediction subcomponent of the sample selection part;

[0351] The sample aggregation operation corresponding to the maximum sample aggregation probability is determined as the third prediction subcomponent of the sample selection part.

[0352] In an optional implementation, when the sample component is a sample grouping part, the part prediction submodule specifically includes:

[0353] A first vector classification unit is used to classify the sample embedding vector corresponding to the custom mark to obtain a second sample column probability of each sample column quantity corresponding to the sample grouping part;

[0354] a column quantity determination unit, configured to select the largest probability of the second sample column, and determine the number of sample columns corresponding to the largest probability of the second sample column;

[0355] A second vector classification unit is used to classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a second sample usage probability of each sample header representation content used by the sample grouping part;

[0356] a probability sorting unit, configured to sort the second sample usage probabilities and select the top M second sample usage probabilities, where M is the number of sample columns corresponding to the largest second sample column probability;

[0357] The partial prediction unit is used to generate a prediction subcomponent of the sample grouping part according to the usage probabilities of the second samples in the top M.

[0358] In an optional implementation, the partial prediction unit specifically includes:

[0359] Determine M sample header representation contents corresponding to the top M second sample usage probabilities, and obtain M sample header contents from the M sample header representation contents;

[0360] The M sample header contents are determined as predicted subcomponents of the sample grouping part.

[0361] In an optional implementation, when the sample component is a sample ascending and descending order portion, the part prediction submodule specifically includes:

[0362] A first vector classification unit is used to classify the sample embedding vector corresponding to the custom mark to obtain a third sample column probability of each sample column quantity corresponding to the sample ascending and descending order part, and a sample ascending and descending order probability of each sample ascending and descending order operation;

[0363] a column quantity determination unit, configured to select the largest third sample column probability, and determine the number of sample columns corresponding to the largest third sample column probability;

[0364] An ascending and descending order determination unit, used for selecting the largest ascending and descending order probability of the sample, and determining the sample ascending and descending order operation corresponding to the largest ascending and descending order probability of the sample;

[0365] A second vector classification unit is used to classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a third sample usage probability of each sample header representation content being used in the sample ascending and descending order parts;

[0366] A probability sorting unit, used to sort the third sample usage probabilities and select the top O third sample usage probabilities, where O is the number of sample columns corresponding to the largest third sample column probability;

[0367] The partial prediction unit is used to generate a prediction subcomponent of the sample ascending and descending part according to the sample ascending and descending operation corresponding to the third sample usage probability of the top 0 and the maximum sample ascending and descending probability.

[0368] In an optional implementation, the partial prediction unit specifically includes:

[0369] Determine the representation contents of the O sample headers corresponding to the usage probabilities of the top O third samples;

[0370] Classify the sample column representation embedding vectors corresponding to the O sample header representation contents to obtain a second sample column probability of the inter-sample column operation corresponding to the sample ascending and descending order parts;

[0371] Selecting the largest second sample inter-column probability, and determining the sample inter-column operation corresponding to the largest second sample inter-column probability;

[0372] Obtain O sample header contents from the O sample header representation contents, and determine the O sample header contents as the first predicted subcomponent of the sample ascending and descending order part;

[0373] Determine the sample ascending and descending operation corresponding to the largest sample ascending and descending probability as the second prediction subcomponent of the sample ascending and descending part;

[0374] The sample-column operation corresponding to the largest second sample-column probability is determined as the third prediction subcomponent of the sample ascending and descending order part.

[0375] In an optional implementation, when the sample component is a sample condition part, the part prediction submodule specifically includes:

[0376] A first vector classification unit, configured to classify the sample embedding vector corresponding to the custom mark, and obtain a sample number probability of each sample condition number corresponding to the sample condition part, and a sample relationship probability of each sample condition relationship;

[0377] A condition number determination unit, used for selecting the maximum sample number probability and determining the sample condition number corresponding to the maximum sample number probability;

[0378] A conditional relationship determination unit, used for selecting the maximum sample relationship probability and determining the sample conditional relationship corresponding to the maximum sample relationship probability;

[0379] A vector search unit, used to search for a sample embedding vector corresponding to each character in the sample requirement statement from the sample embedding vector corresponding to the sample component content of the sample splicing result;

[0380] A second vector classification unit is used to classify the sample embedding vector corresponding to each character in the sample requirement expression to obtain a sample condition value flag corresponding to each character in the sample requirement expression;

[0381] A character selection unit, used for selecting a sample character from the sample requirement statement, wherein the sample condition value flag of the sample character is a preset value;

[0382] A character composition unit, used for composing M sample condition values ​​from the sample characters, wherein M is the sample condition number corresponding to the maximum probability of the sample number;

[0383] The partial prediction unit is used to generate a prediction subcomponent of the sample condition part according to the M sample condition values, the sample condition relationship corresponding to the maximum sample relationship probability, and the sample column representation embedding vector corresponding to any sample header representation content.

[0384] In an optional implementation, the partial prediction unit is specifically used for:

[0385] For any of the sample condition values, matching the sample embedding vector corresponding to the sample characters constituting the sample condition value with the sample column representation embedding vector corresponding to any of the sample header representation contents to obtain the sample header representation contents matched by the sample condition value;

[0386] Determine the sample condition value and the sample header content in the sample header representation content that matches the sample condition value as a first prediction subcomponent of the sample condition part;

[0387] For any of the sample condition values, classify the sample embedding vectors corresponding to the sample characters constituting the sample condition value and the sample column representation embedding vectors corresponding to the sample header representation content matched by the sample condition value to obtain sample logical probabilities of each sample logical operation corresponding to the sample condition value;

[0388] Select the largest sample logical probability, and determine the sample logical operation corresponding to the largest sample logical probability;

[0389] Determine the sample logic operation corresponding to the maximum sample logic probability as the second prediction subcomponent of the sample condition part;

[0390] The sample condition relationship corresponding to the maximum sample relationship probability is determined as the third prediction subcomponent of the sample condition part.

[0391] In an optional implementation, the partial prediction unit is specifically used for:

[0392] Classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a fourth sample usage probability of each sample header representation content used in the sample conditional part;

[0393] According to the fourth sample usage probability, the sample embedding vector corresponding to the sample characters constituting the sample condition value is matched with the sample column representation embedding vector corresponding to any of the sample header representation contents to obtain the sample header representation content that matches the sample condition value.

[0394] In a third aspect of the embodiments of the present application, there is further provided an electronic device, 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 via the communication bus;

[0395] Memory, used to store computer programs;

[0396] The processor is used to implement any programming statement generation method described in the first aspect when executing a program stored in the memory.

[0397] In a fourth aspect of the embodiments of the present application, a storage medium is further provided, wherein instructions are stored in the storage medium, and when the storage medium is run on a computer, the computer executes any programming statement generation method described in the first aspect above.

[0398] In a fifth aspect of the embodiments of the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the programming statement generation methods described above.

[0399] The technical solution provided by the embodiment of the present application obtains a target table and a target requirement expression corresponding to the target table, and determines the target table content in the target table. For any initial component of the initial programming statement, sub-components of the initial component are generated according to the target requirement expression and the target table content, and the sub-components of the initial component are spliced ​​to obtain the target component, and the target programming statement is generated from each target component corresponding to the initial programming statement.

[0400] In this way, through the target requirement expression corresponding to the target table and the target table content in the target table, sub-components of any initial component of the initial programming statement are generated, and then spliced ​​to obtain the various target components of the initial programming statement. The target programming statement is generated from the various target components of the initial programming statement, which can avoid the influence of the vocabulary scope and ensure the grammatical correctness and executableness of the generated programming statement. BRIEF DESCRIPTION OF THE DRAWINGS

[0401] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0402] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0403] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0404] Figure 1 A schematic diagram of an implementation flow of a programming statement generation method shown in an embodiment of the present application;

[0405] Figure 2 A schematic diagram of an implementation flow of another programming statement generation method shown in an embodiment of the present application;

[0406] Figure 3 A schematic diagram of an implementation flow of a method for generating sub-components of an initial restriction part shown in an embodiment of the present application;

[0407] Figure 4 A schematic diagram of an implementation flow of a method for generating sub-components of an initial component shown in an embodiment of the present application;

[0408] Figure 5 It is a schematic diagram of an implementation flow of a method for generating sub-components of an initial selection part shown in an embodiment of the present application;

[0409] Figure 6 A schematic diagram of an implementation flow of a method for generating sub-components of an initial grouping part shown in an embodiment of the present application;

[0410] Figure 7 It is a schematic diagram of an implementation flow of a method for generating sub-components of an initial ascending and descending order part shown in an embodiment of the present application;

[0411] Figure 8 A schematic diagram of an implementation flow of a method for generating sub-components of an initial condition part shown in an embodiment of the present application;

[0412] Fig. 9 A schematic diagram of an implementation flow of a model training method shown in an embodiment of the present application;

[0413] Fig.10 It is a schematic diagram of an implementation flow of a method for generating a prediction subcomponent of a sample restriction part shown in an embodiment of the present application;

[0414] Fig.11 It is a schematic diagram of an implementation flow of a method for generating a predicted sub-component of a sample component shown in an embodiment of the present application;

[0415] Fig.12 It is a schematic diagram of an implementation flow of a method for generating a prediction subcomponent of a sample selection part shown in an embodiment of the present application;

[0416] Fig.13 It is a schematic diagram of an implementation flow of a method for generating a prediction sub-component of a sample grouping part shown in an embodiment of the present application;

[0417] Fig.14 It is a schematic diagram of the implementation process of a method for generating a prediction sub-component of a sample ascending and descending order part shown in an embodiment of the present application;

[0418] Fig.15 It is a schematic diagram of an implementation flow of a method for generating a prediction subcomponent of a sample condition part shown in an embodiment of the present application;

[0419] Fig.16 A schematic diagram of the structure of a programming statement generating device shown in an embodiment of the present application;

[0420] Fig.17 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0421] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0422] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0423] At present, in daily work and life, it is necessary to process tables, such as modifying a certain data in a table. To this end, for a table, a user can input a natural language requirement expression for the table, and generate a sub-component of any initial component of the initial programming statement through the requirement expression and the table content in the table, and then splice and obtain each target component corresponding to the initial programming statement, and generate a target programming statement from each target component corresponding to the initial programming statement. The target programming statement is such as an executable SQL statement. Here, the table is similar to the database table structure, and the table can be converted into a database table, so that the SQL statement can be executed on the database table, or the SQL statement can be converted into the corresponding table formula, and then the table formula is executed on the table, so as to realize the processing of the table.

[0424] like Figure 1 FIG. 1 is a schematic diagram of an implementation flow of a programming statement generation method provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0425] S101, obtaining a target table and a target requirement statement corresponding to the target table, and determining the target table content in the target table.

[0426] In the embodiment of the present application, when a user uses a spreadsheet processing software to open a spreadsheet document, a table in the spreadsheet document can be obtained, and the table is used as a target table, thereby achieving the acquisition of the target table. The target table can be a table of various industries.

[0427] In addition, for the target table, the user can input a corresponding target requirement statement for the target table to implement processing of the target table, thereby obtaining the target requirement statement corresponding to the target table.

[0428] It should be noted that, for the target requirement expression, the target requirement expression is expressed in the form of natural language. For example, the target requirement expression can be "find students with a total score above 650", which is not limited in this embodiment of the present application.

[0429] In addition, in an embodiment of the present application, for the target table, it is also necessary to determine the target table content in the target table. The target table content is usually composed of the header content filled in the header cell and the cell content filled in the remaining cells except the header cell.

[0430] S102, for any initial component of the initial programming statement, generate a sub-component of the initial component according to the target requirement statement and the target table content.

[0431] S103, splicing the subcomponents of the initial component to obtain the target component.

[0432] In the embodiment of the present application, the format of the initial programming statement is generally fixed. For example, the initial SQL statement can be roughly divided into five initial components, namely, the SELECT initial component, the WHERE initial component, the GROUP BY initial component, the ORDER BY initial component and the LIMIT initial component.

[0433] It should be noted that for the SELECT initial component, it supports multi-column queries, aggregate column queries and multi-column joint queries; for the WHERE initial component, it supports single-condition, multi-condition and multi-column joint queries; for the GROUP BY initial component, it supports single grouping and multi-column joint grouping; for the ORDER BY initial component, it supports single-column ascending and descending processing and multi-column joint ascending and descending processing; for the LIMIT initial component, it supports 1~20 limit processing, that is, it is used to limit the number of query results returned, such as LIMIT 2, which limits the number of query results returned to 2.

[0434] For each initial component of the initial programming statement, it is also composed of several sub-components and corresponding flags. For example, for the LIMIT initial component, it is composed of the flag "LIMIT" of the LIMIT initial component and the corresponding sub-component "limited quantity", such as LIMIT 2, where "2" is a sub-component of the LIMIT initial component.

[0435] Based on this, the embodiments of the present application can generate sub-components of any initial component of the initial programming statement, and obtain the target component of the initial programming statement by splicing the sub-components, so that the target components corresponding to the initial programming statement can be obtained, and subsequently the target components of the initial programming statement can be spliced ​​to obtain a complete target programming statement.

[0436] To this end, for any initial component of the initial programming statement, the sub-components of the initial component are generated according to the target requirement statement corresponding to the target table and the target table content in the target table. The sub-components of the initial component are spliced ​​to obtain the target component, and thus the various target components corresponding to the initial programming statement can be obtained.

[0437] For example, for the LIMIT initial component of the initial programming statement, the sub-components of the LIMIT initial component are generated according to the target requirement statement corresponding to the target table and the target table content in the target table. The sub-components of the LIMIT initial component are spliced ​​to obtain the LIMIT target component, and thus the various target components corresponding to the initial programming statement can be obtained.

[0438] S104, generating a target programming statement from each target component corresponding to the initial programming statement.

[0439] In the embodiment of the present application, for each target component corresponding to the initial programming statement, a target programming statement can be generated from each target component corresponding to the initial programming statement. Among them, each target component of the initial programming statement can be spliced ​​in a certain splicing order, so that a complete target programming statement can be obtained.

[0440] It should be noted that the splicing order of each target component corresponding to the initial programming statement can refer to the composition rules of the current programming statement. For example, for the SELECT target component, it is usually located at the starting position of the target programming statement, and the splicing order of the SELECT target component is the first, and the LIMIT target component is located at the end position of the target programming statement, and the splicing order of the LIMIT target component is the last, and the embodiment of the present application is not limited to this.

[0441] Through the above description of the technical solution provided in the embodiment of the present application, a target table and a target requirement expression corresponding to the target table are obtained, and the target table content in the target table is determined. For any initial component of the initial programming statement, sub-components of the initial component are generated according to the target requirement expression and the target table content, and the sub-components of the initial component are spliced ​​to obtain the target component, and the target programming statement is generated from each target component corresponding to the initial programming statement.

[0442] In this way, through the target requirement expression corresponding to the target table and the target table content in the target table, sub-components of any initial component of the initial programming statement are generated, and then spliced ​​to obtain the target components corresponding to the initial programming statement. The target programming statement is generated from the target components corresponding to the initial programming statement, which can avoid the influence of the vocabulary scope and ensure the grammatical correctness and executableness of the generated programming statement.

[0443] In addition, in an embodiment of the present application, a multi-task model is pre-constructed. The multi-task model can be used to generate sub-components of each initial component of the initial programming statement, and the sub-components are spliced ​​to obtain target components corresponding to the initial programming statement. Finally, the target components corresponding to the initial programming statement are spliced ​​to obtain a complete target programming statement, which can avoid the influence of the vocabulary scope and ensure the grammatical correctness and executableness of the generated programming statement.

[0444] Based on this, Figure 2FIG. 1 is a schematic diagram of an implementation flow of another programming statement generation method provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0445] S201, obtaining a target table and a target requirement statement corresponding to the target table.

[0446] In the embodiment of the present application, this step is similar to the above-mentioned step S101, and the embodiment of the present application will not be described one by one here.

[0447] S202, determining a target header in a target table, and acquiring the header content filled in any header cell in the target header.

[0448] S203, determining the remaining cells in the column where the header cell is located except the header cell.

[0449] S204, select a target cell from the remaining cells, and obtain the cell content filled in the target cell.

[0450] S205, combining the header content with the cell content to obtain the header representation content corresponding to the header cell.

[0451] S206: Determine all the header representation contents as target table contents in the target table.

[0452] In the embodiment of the present application, for a target table, a target header in the target table may be determined, wherein the target header is usually the first row of cells in the target table and is filled with corresponding header content.

[0453] Based on this, for any header cell in the target header (in order to distinguish ordinary cells, it is called header cell), the header content filled in the header cell (in order to distinguish ordinary cells, the cell content filled in the header cell is called header content) is obtained.

[0454] Determine the remaining cells in the column where the header cell is located except the header cell, select the target cell from the remaining cells, obtain the cell content filled in the target cell, combine the header content with the cell content, and obtain the header representation content corresponding to the header cell.

[0455] In this way, for any header cell in the target header, the corresponding header representation content is obtained through the above steps. At this time, all header representation contents can be determined as target table contents in the target table.

[0456] It should be noted that the target header is usually the first row of cells in the target table, so the above determination of the remaining cells in the column where the header cell is located except the header cell, but if the target header is the first column of cells in the target table, then the above determination of the remaining cells in the row where the header cell is located except the header cell is related to the target header.

[0457] In addition, for the remaining cells (ordinary cells), the target cell can be randomly selected from the remaining cells. For example, if the header content "Date" is filled in the header cell C1, then the remaining cells in the column where the header cell C1 is located except for the header cell can be determined, and cell C3 can be randomly selected from the remaining cells as the target cell, and the cell content "2024 / 02 / 01" filled in cell C3 is obtained. The header content is combined with the cell content to obtain the header representation content "Date: 2024 / 02 / 01" corresponding to the header cell C1.

[0458] S207, input the target requirement statement and all header representation contents into the pre-trained multi-task model, and the pre-trained multi-task model performs the following processing.

[0459] In an embodiment of the present application, the target requirement statement and all header representation contents can be input into a pre-trained multi-task model. The pre-trained multi-task model executes the following steps S208~S210 to obtain sub-components of any initial component of the initial programming statement. The sub-components are spliced ​​to obtain the target component.

[0460] It should be noted that the pre-trained multi-task model is a Table-aware model based on Bert-wwm-ext. Here, Bert-wwm-ext is used as the basic model to perform semantic extraction on the target demand expression and all header representation contents. Bert-wwm-ext is a Bert model trained using more corpus and full-word masking. It pays more attention to the concept of words and is more friendly to Chinese tasks.

[0461] S208, splicing the target requirement statement and all the header representation contents according to the custom flag and the sequence flag to obtain a splicing result.

[0462] In the embodiment of the present application, for the target requirement expression and all the header representation contents, the target requirement expression is connected with each header representation content by using a custom flag and a sequence flag, wherein the sequence flag may be, for example, [SEP] Token, and the custom flag may be, for example, [XLS] Token.

[0463] It should be noted that since the [CLS] Token at the starting position is more used for classification prediction of NSP tasks in pre-training, it is replaced with [XLS] Token. After the token is changed, the accuracy of task classification prediction can be improved for the pre-trained multi-task model.

[0464] Based on this, the target demand expression is spliced ​​according to the custom mark and the sequence mark to obtain the first expression splicing result, wherein the custom mark is located at the starting position of the first expression splicing result, and the sequence mark is located at the end position of the first expression splicing result. For any header representation content, the header representation content is spliced ​​according to the sequence mark to obtain the second content splicing result, wherein the sequence mark is located at the end position of the second content splicing result. The first expression splicing result and all the second content splicing results are spliced ​​in sequence to obtain the splicing result.

[0465] For example, for the target demand expression "average collection...", the target demand expression is spliced ​​according to the custom mark and the sequence mark to obtain the first expression splicing result, wherein the custom mark is located at the starting position of the first expression splicing result, and the sequence mark is located at the end position of the first expression splicing result. The first expression splicing result is "

XLS

SEP

[0466] For the header representation content "Date 2024 / 02 / 01", the header representation content is spliced ​​according to the sequence mark to obtain a second content splicing result, wherein the sequence mark is located at the end of the second content splicing result, and the second content splicing result is "Date 2024 / 02 / 01 [SEP]".

[0467] The first expression concatenation result and all the second content concatenation results are concatenated in sequence to obtain a concatenation result, namely, “

XLS

SEP

SEP

SEP

[0468] S209, for any component content in the splicing result, vectorize the component content to obtain an embedding vector corresponding to the component content.

[0469] In an embodiment of the present application, for the splicing result, for any component content in the splicing result, the component content is vectorized to obtain an embedded vector corresponding to the component content, wherein the component content includes one of the following: a custom flag, a sequence flag, each character in the target requirement expression, and each character in the header representation content.

[0470] For example, for the above splicing result, that is, "

XLS

SEP

SEP

SEP

XLS

[0471] Similarly, for the component content "ping" in the splicing result, vectorize this component content to obtain the embedding vector corresponding to the component content. For the component content "ri" in the splicing result, vectorize this component content to obtain the embedding vector corresponding to the component content, which means that each component content has a corresponding embedding vector.

[0472] S210. For any initial component of the initial programming statement, generate sub-components of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result.

[0473] S211. Splice the sub-components of the initial component to obtain the target component.

[0474] In the embodiment of the present application, through the above processing, the embedding vector corresponding to each component content in the splicing result can be obtained. Therefore, for any initial component of the initial programming statement, sub-components of the initial component can be generated according to the embedding vector corresponding to the corresponding component content in the splicing result, and the sub-components of the initial component are spliced to obtain the target component.

[0475] Among them, for the initial restriction part of the initial programming statement, that is, the above LIMIT initial component, because its structure is simple and it is composed of a sub-component and the flag of the LIMIT initial component, it is relatively simple to generate the sub-components of the LIMIT initial component, and it can be generated depending on the semantic information in the target requirement statement.

[0476] Specifically, the semantic information in the target requirement statement is generally reflected by the embedding vector corresponding to the custom flag. Therefore, the embedding vector corresponding to the custom flag can be classified and predicted to generate the sub-components of the LIMIT initial component. Among them, the embedding vector corresponding to the custom flag can be classified and predicted by means of a classification model.

[0477] For this reason, as Figure 3 shown, it is a schematic flowchart of the implementation process of a method for generating sub-components of an initial restriction part provided by an embodiment of the present application. This method is applied to an electronic device and specifically may include the following steps:

[0478] S301. Search for the embedding vector corresponding to the custom flag from the embedding vectors corresponding to the component contents of the splicing result.

[0479] In the embodiment of the present application, for the splicing result, the component contents thereof include a custom mark, and thus the embedding vector corresponding to the custom mark can be searched from the embedding vectors corresponding to the component contents of the splicing result.

[0480] S302, classify the embedding vector corresponding to the custom mark to obtain the restriction probability of each restriction quantity corresponding to the initial restriction part.

[0481] In the embodiment of the present application, the embedding vector corresponding to the custom mark is classified and processed to obtain the restriction probabilities of each restriction quantity corresponding to the initial restriction part. The embedding vector corresponding to the custom mark can be classified and processed by means of a classification model.

[0482] To this end, the embedding vector corresponding to the custom logo is input into the pre-trained classification model to obtain the restriction probabilities of each restriction quantity corresponding to the initial restriction part. The pre-trained classification model includes a convolution layer, a pooling layer, a fully connected layer, and a Softmax function.

[0483] It should be noted that for the initial component of LIMIT, the range of its restriction quantity is generally 0~20, from which the restriction probability of each restriction quantity corresponding to the initial restriction part can be predicted, that is, 20 classifications are performed to obtain the restriction probability of each restriction quantity.

[0484] S303, selecting the maximum restriction probability, and determining the restriction quantity corresponding to the maximum restriction probability.

[0485] S304: Determine the restriction quantity corresponding to the maximum restriction probability as a subcomponent of the initial restriction part.

[0486] In the embodiment of the present application, for the restriction probabilities of various restriction quantities, the maximum restriction probability is selected, and the restriction quantity corresponding to the maximum restriction probability is determined, and the restriction quantity corresponding to the maximum restriction probability is determined as a sub-component of the initial restriction part.

[0487] Thus, the sub-components of the initial restriction part are generated, and the restriction quantity corresponding to the maximum restriction probability is concatenated with the sign of the initial restriction part to obtain the target restriction part, thereby realizing the generation of the target restriction part.

[0488] For example, for each restriction quantity 0 to 20, there is a corresponding restriction probability. The maximum restriction probability is selected, and the restriction quantity 2 corresponding to the maximum restriction probability is determined. The restriction quantity 2 is concatenated with the LIMIT mark of the initial restriction part to obtain the target restriction part, that is, LIMIT 2.

[0489] In addition, in an embodiment of the present application, the initial components of the initial programming statement include, in addition to the above-mentioned initial restriction part, the remaining parts. Compared with the generation of the initial restriction part, the generation of the remaining parts is more complicated and requires further processing of the header representation content.

[0490] Based on this, Figure 4 FIG. 1 is a schematic diagram of an implementation flow of a method for generating sub-components of an initial component provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0491] S401, for any header representation content, the following processing is performed to obtain a column representation embedding vector corresponding to the header representation content.

[0492] In the embodiment of the present application, for any header representation content (which may be referred to as Header for short), the following steps S402 to S404 are performed to obtain a column representation embedding vector (which may be referred to as ColumEmbedding for short) corresponding to the header representation content.

[0493] S402, searching for the embedding vector corresponding to each character in the header representation content and the embedding vector corresponding to the sequence mark spliced ​​with the header representation content from the embedding vectors corresponding to the constituent contents of the splicing result.

[0494] In an embodiment of the present application, for the splicing result, some of the constituent contents are spliced ​​together from the header representation content and the corresponding sequence markers. Therefore, the embedding vector corresponding to each character in the header representation content and the embedding vector corresponding to the sequence marker spliced ​​with the header representation content can be searched from the embedding vector corresponding to the constituent contents of the splicing result.

[0495] S403, the embedding vector corresponding to the custom logo, the embedding vector corresponding to each character in the header representation content, and the embedding vector corresponding to the sequence logo spliced ​​with the header representation content are processed by a self-attention mechanism to obtain a processing result.

[0496] In an embodiment of the present application, a secondary Self-Attention mechanism may be performed on the embedding vector corresponding to the custom logo, the embedding vector corresponding to each character in the header representation content, and the embedding vector corresponding to the sequence logo spliced ​​with the header representation content.

[0497] Based on this, the embedding vector corresponding to the custom logo, the embedding vector corresponding to each character in the header representation content, and the embedding vector corresponding to the sequence logo spliced ​​with the header representation content are processed by the self-attention mechanism to obtain the processing result.

[0498] S404, adding the embedding vector corresponding to the custom logo to the processing result to obtain the column representation embedding vector corresponding to the header representation content.

[0499] In an embodiment of the present application, for the processing results obtained above, the embedding vector corresponding to the custom logo can be added to the processing results to obtain the column representation embedding vector corresponding to the header representation content, so that each header representation content has a corresponding column representation embedding vector.

[0500] S405, generating sub-components of the initial component according to the embedding vectors corresponding to the corresponding component contents in the concatenation result and the column representation embedding vectors corresponding to any header representation contents.

[0501] In an embodiment of the present application, for any initial component other than the initial restricted part, sub-components of the initial component can be generated based on the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any header representation content, and the sub-components of the initial component can be spliced ​​to obtain the target component.

[0502] Among them, for any initial component other than the initial restricted part, when the initial component is the initial selected part (i.e., the SELECT initial component), the sub-components of the initial selected part can be generated by the embedding vector corresponding to the corresponding component content in the above splicing result and the column representation embedding vector corresponding to any header representation content.

[0503] Based on this, Figure 5 FIG. 1 is a schematic diagram of an implementation flow of a method for generating sub-components of an initial selection part provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0504] S501, classify the embedding vector corresponding to the custom logo to obtain the first column probability of each column quantity corresponding to the initial selection part.

[0505] S502, selecting the largest first column probability, and determining the number of columns corresponding to the largest first column probability.

[0506] In an embodiment of the present application, for the initial selection part, it usually uses several table columns, for example, SELECT ("Chinese score" + "Mathematics score"), which uses 2 table columns. Here, it is necessary to first predict the number of table columns used in the initial selection part. For the prediction of such tasks, it is necessary to rely on the semantic information in the target demand expression for prediction.

[0507] Specifically, the semantic information in the target requirement expression is generally reflected by the embedding vector corresponding to the custom flag, so the embedding vector corresponding to the custom flag can be classified and predicted to generate the number of table columns used in the initial selection part. Among them, the embedding vector corresponding to the custom flag can be classified and predicted with the help of a classification model.

[0508] Based on this, the embedding vector corresponding to the custom logo is classified to obtain the first column probability of each column quantity corresponding to the initial selection part, the largest first column probability is selected, and the number of columns corresponding to the largest first column probability is determined, for example, 2. The embedding vector corresponding to the custom logo can be classified with the help of a classification model.

[0509] To this end, the embedding vector corresponding to the custom logo is input into the pre-trained classification model to obtain the first column probability of each column number corresponding to the initial selection part. The pre-trained classification model includes a convolution layer, a pooling layer, a fully connected layer, and a Sigmoid function, and here, for example, 2 classifications can be performed, that is, the first column probability of the first column number 1 and the first column probability of the first column number 2 are predicted.

[0510] S503: Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a first usage probability of using each header representation content in the initial selection part.

[0511] S504, sorting the first usage probabilities and selecting the top N first usage probabilities, where N is the number of columns corresponding to the largest first column probability.

[0512] In an embodiment of the present application, the column representation embedding vectors corresponding to all the header representation contents are classified to obtain the first usage probability of using each header representation content in the initial selection part. The column representation embedding vectors corresponding to all the header representation contents can be classified by means of a classification model.

[0513] Based on this, the column representation embedding vectors corresponding to all the header representation contents are input into the pre-trained classification model to obtain the first usage probability of each header representation content used in the initial selection part, these first usage probabilities are sorted, and the top N first usage probabilities are selected, where N is the number of columns corresponding to the largest first column probability.

[0514] From then on, through the above steps S501~S502, the number of table columns to be used by the initial selection part can be known, and then through steps S503~S504, the first usage probability of each header representation content used by the initial selection part can be known. According to the number of table columns to be used by the initial selection part and following the first usage probability of each header representation content, the corresponding header representation content is selected.

[0515] S505: Generate sub-components of the initial selection part according to the first usage probabilities of the top N items.

[0516] In an embodiment of the present application, for the first usage probabilities of the top N names, sub-components of the initial selection part can be generated based on the first usage probabilities of the top N names. In essence, the sub-components of the initial selection part are generated based on the N header representation contents corresponding to the first usage probabilities of the top N names.

[0517] Specifically, determine the N header representation contents corresponding to the first usage probabilities of the top N, and obtain N header contents among the N header representation contents. Here, the N header contents are determined as the first sub-component of the initial selection part. For example, the two header contents "Chinese scores" and "Mathematics scores" are the first sub-components of the SELECT initial component.

[0518] The column representation embedding vectors corresponding to the N header representation contents are classified to obtain the first column-to-column probability of each column-to-column operation corresponding to the initial selection part, and the aggregation probability of each aggregation operation. The column representation embedding vectors corresponding to the N header representation contents are input into the pre-trained classification model to obtain the first column-to-column probability of each column-to-column operation corresponding to the initial selection part, and the aggregation probability of each aggregation operation.

[0519] It should be noted that, for inter-column operations, it refers to operations between table columns, such as "+", "-", "*", " / ". For aggregate operations, it refers to aggregate operations of table columns, such as "MAX", "MIN", "SUM", etc., which are not limited in the embodiments of the present application.

[0520] The largest first inter-column probability is selected, and the inter-column operation corresponding to the largest first inter-column probability is determined, and the inter-column operation corresponding to the largest first inter-column probability is determined as the second sub-component of the initial selection part. For example, if the inter-column operation corresponding to the largest first inter-column probability is "+", then "+" can be determined as the second sub-component of the initial selection part.

[0521] The maximum aggregation probability is selected, and the aggregation operation corresponding to the maximum aggregation probability is determined, and the aggregation operation corresponding to the maximum aggregation probability is determined as the third subcomponent of the initial selection part. For example, the aggregation operation corresponding to the maximum aggregation probability is "SUM", and "SUM" can be determined as the third subcomponent of the initial selection part.

[0522] In this way, several subcomponents of the initial selection part can be obtained, and the subcomponents can be spliced ​​to obtain the target selection part. To this end, the inter-column operation corresponding to the largest first inter-column probability is used to splice the N header contents to obtain the first selection splicing result; the aggregation operation corresponding to the largest aggregation probability is spliced ​​with the first selection splicing result to obtain the second selection splicing result; the second selection splicing result is spliced ​​with the mark of the initial selection part to obtain the target selection part.

[0523] For example, the inter-column operation corresponding to the largest first inter-column probability is "+", which can be used to concatenate the two header contents "Chinese score" and "Mathematics score", that is, concatenate "+" between the two header contents "Chinese score" and "Mathematics score" to obtain the first selection concatenation result "Chinese score" + "Mathematics score", and the aggregation operation corresponding to the largest aggregation probability is "SUM", which is concatenated with the first selection concatenation result to obtain the second selection concatenation result SUM ("Chinese score" + "Mathematics score"), and the second selection concatenation result is concatenated with the SELECT flag of the initial selection part to obtain the target selection part SELECT SUM ("Chinese score" + "Mathematics score").

[0524] In addition, for any initial component other than the initial restriction part, when the initial component is the initial grouping part (i.e., the GROUP BY initial component), the sub-components of the initial grouping part can be generated by the embedding vector corresponding to the corresponding component content in the above concatenation result and the column representation embedding vector corresponding to any header representation content.

[0525] Based on this, Figure 6 FIG. 1 is a schematic diagram of an implementation flow of a method for generating sub-components of an initial grouping part provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0526] S601, classify the embedding vector corresponding to the custom logo to obtain the second column probability of each column quantity corresponding to the initial grouping part.

[0527] S602, selecting the largest second column probability, and determining the number of columns corresponding to the largest second column probability.

[0528] In an embodiment of the present application, for the initial grouping part, it usually uses several table columns, for example, GROUPBY "Chinese scores" uses 1 table column. Here, it is necessary to first predict the number of table columns used in the initial grouping part. For the prediction of such tasks, it is necessary to rely on the semantic information in the target demand expression for prediction.

[0529] Specifically, the semantic information in the target demand expression is generally reflected by the embedding vector corresponding to the custom flag, so the embedding vector corresponding to the custom flag can be classified and predicted to generate the number of table columns used in the initial grouping part. Among them, the embedding vector corresponding to the custom flag can be classified and predicted with the help of a classification model.

[0530] Based on this, the embedding vector corresponding to the custom logo is classified to obtain the second column probability of each column quantity corresponding to the initial grouping part, the largest second column probability is selected, and the number of columns corresponding to the largest second column probability is determined, for example, 2. The embedding vector corresponding to the custom logo can be classified with the help of a classification model.

[0531] To this end, the embedding vector corresponding to the custom logo is input into the pre-trained classification model to obtain the second column probability of each column quantity corresponding to the initial grouping part. The pre-trained classification model includes a convolution layer, a pooling layer, a fully connected layer and a Softmax function, and here the embedding vector corresponding to the custom logo can be classified into, for example, 2 categories.

[0532] S603: Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a second usage probability of each header representation content being used in the initial grouping part.

[0533] S604, sort the second usage probabilities and select the top M second usage probabilities, where M is the number of columns corresponding to the largest second column probability.

[0534] In an embodiment of the present application, the column representation embedding vectors corresponding to all the header representation contents are classified to obtain the second usage probability of each header representation content used in the initial grouping part. The column representation embedding vectors corresponding to all the header representation contents can be classified by means of a classification model.

[0535] Based on this, the column representation embedding vectors corresponding to all the header representation contents are input into the pre-trained classification model to obtain the second usage probability of using each header representation content in the initial grouping part. These second usage probabilities are sorted, and the top M second usage probabilities are selected, where M is the number of columns corresponding to the largest second column probability.

[0536] From then on, through the above steps S601~S602, the number of table columns to be used in the initial grouping part can be known, and then through steps S603~S604, the second usage probability of using each header to represent the content in the initial grouping part can be known. According to the number of table columns to be used in the initial grouping part and following the second usage probability of each header to represent the content, the corresponding header representation content can be selected.

[0537] S605: Generate sub-components of the initial grouping part according to the second usage probabilities of the top M names.

[0538] In an embodiment of the present application, for the second usage probabilities of the top M names, sub-components of the initial grouping part can be generated based on the second usage probabilities of the top M names. In essence, the sub-components of the initial grouping part are generated based on the M header representation contents corresponding to the second usage probabilities of the M names.

[0539] Specifically, determine the M header representation contents corresponding to the second usage probabilities of the top M, obtain M header contents from the M header representation contents, and determine the M header contents as sub-components of the initial grouping part. For example, two header contents "Chinese score" and "math score" are sub-components of the initial component of GROUP BY.

[0540] In this way, the subcomponents of the initial grouping part can be obtained, and the subcomponents can be spliced ​​to obtain the target grouping part. For this purpose, the M header contents are spliced ​​with the flags corresponding to the initial grouping part to obtain the target grouping part. For example, the two header contents "Chinese score" and "Mathematics score" are spliced ​​with the flag GROUP BY of the initial grouping part to obtain the target grouping part GROUP BY "Chinese score" and "Mathematics score".

[0541] In addition, for any initial component other than the initial restricted part, when the initial component is the initial ascending and descending part (i.e., the ORDER BY initial component), the sub-components of the initial ascending and descending part can be generated by the embedding vector corresponding to the corresponding component content in the above concatenation result and the column representation embedding vector corresponding to any header representation content.

[0542] Based on this, Figure 7 FIG. 1 is a schematic diagram of an implementation flow of a method for generating sub-components of an initial ascending and descending order part provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0543] S701, classify the embedding vector corresponding to the custom mark to obtain the third column probability of each column quantity corresponding to the initial ascending and descending order part, and the ascending and descending order probability of each ascending and descending order operation.

[0544] S702, selecting the largest third column probability, and determining the number of columns corresponding to the largest third column probability.

[0545] S703, selecting the maximum ascending and descending probability, and determining the ascending and descending operation corresponding to the maximum ascending and descending probability.

[0546] In the embodiment of the present application, for the initial ascending and descending part, it usually uses several table columns, for example, ORDER BY "Chinese score", it uses 1 table column. Here, it is necessary to first predict the number of table columns used in the initial ascending and descending part and the specific ascending and descending operations. For the prediction of such tasks, it is necessary to rely on the semantic information in the target demand expression for prediction.

[0547] Specifically, the semantic information in the target demand expression is generally reflected by the embedding vector corresponding to the custom mark, so the embedding vector corresponding to the custom mark can be classified and predicted to generate the number of table columns used in the initial ascending and descending part and the specific ascending and descending operations. Among them, the embedding vector corresponding to the custom mark can be classified and predicted with the help of a classification model.

[0548] Based on this, the embedding vector corresponding to the custom logo is classified and processed to obtain the third column probability of each column quantity corresponding to the initial ascending and descending part, and the ascending and descending probability of each ascending and descending operation, select the largest third column probability, and determine the number of columns corresponding to the largest third column probability, such as 2, select the largest ascending and descending probability, and determine the ascending and descending operation corresponding to the largest ascending and descending probability, such as descending. Among them, the embedding vector corresponding to the custom logo can be classified with the help of a classification model.

[0549] To this end, the embedding vector corresponding to the custom logo is input into the pre-trained classification model to obtain the third column probability of each column quantity corresponding to the initial ascending and descending part, as well as the ascending and descending probability of each ascending and descending operation. The pre-trained classification model includes a convolution layer, a pooling layer, a fully connected layer, and a Sigmoid function, and can perform 3 classifications of the number of columns and 3 classifications of ascending and descending operations.

[0550] S704: Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a third usage probability of using each header representation content in the initial ascending and descending order part.

[0551] S705 , sort the third usage probabilities and select the top O third usage probabilities, where O is the number of columns corresponding to the largest third column probability.

[0552] In an embodiment of the present application, the column representation embedding vectors corresponding to all the header representation contents are classified to obtain the third usage probability of using each header representation content in the initial ascending and descending order. The column representation embedding vectors corresponding to all the header representation contents can be classified by means of a classification model.

[0553] Based on this, the column representation embedding vectors corresponding to all the header representation contents are input into the pre-trained classification model to obtain the third usage probability of each header representation content in the initial ascending and descending order, sort these third usage probabilities, and select the top O third usage probabilities, where O is the number of columns corresponding to the largest third column probability.

[0554] From then on, through the above steps S701~S702, the number of table columns to be used in the initial ascending and descending part can be known, and then through steps S704~S705, the third usage probability of using each header to represent the content in the initial ascending and descending part can be known. According to the number of table columns to be used in the initial ascending and descending part and following the third usage probability of each header to represent the content, the corresponding header representation content is selected.

[0555] S706: Generate sub-components of the initial ascending and descending order part according to the ascending and descending order operation corresponding to the third usage probability of the top 0 and the maximum ascending and descending order probability.

[0556] In an embodiment of the present application, for the ascending and descending order operations corresponding to the third usage probabilities of the top O names and the maximum ascending and descending order probabilities, sub-components of the initial ascending and descending order part can be generated based on the ascending and descending order operations corresponding to the third usage probabilities of the top O names and the maximum ascending and descending order probabilities. In essence, the ascending and descending order operations corresponding to the maximum ascending and descending order probability are the sub-components of the initial ascending and descending order part, and the remaining sub-components of the initial ascending and descending order part are generated based on the O header representation contents corresponding to the third usage probabilities of the top O names.

[0557] Specifically, the O header representation contents corresponding to the third usage probabilities of the top O are determined. The column representation embedding vectors corresponding to the O header representation contents are classified to obtain the second inter-column probabilities of the inter-column operations corresponding to the initial ascending and descending parts, wherein the column representation embedding vectors corresponding to the O header representation contents are input into the pre-trained classification model to obtain the second inter-column probabilities of the inter-column operations corresponding to the initial ascending and descending parts. The largest second inter-column probability is selected, and the inter-column operation corresponding to the largest second inter-column probability is determined.

[0558] Obtain O header contents from the O header representation contents, and determine the O header contents as the first subcomponent of the initial ascending and descending order part, such as the two header contents "Chinese score" and "Mathematics score"; determine the ascending and descending order operation corresponding to the largest ascending and descending order probability as the second subcomponent of the initial ascending and descending order part, such as asc (ascending); determine the inter-column operation corresponding to the largest second inter-column probability as the third subcomponent of the initial ascending and descending order part, such as "+".

[0559] In this way, several subcomponents of the initial ascending and descending order part can be obtained, and the subcomponents can be spliced ​​to obtain the target ascending and descending order part. To this end, the column operation corresponding to the largest second column inter-column probability is used to splice the contents of the O headers to obtain the first ascending and descending order splicing result; the ascending and descending order operation corresponding to the largest ascending and descending order probability is spliced ​​with the first ascending and descending order splicing result to obtain the second ascending and descending order splicing result; the second ascending and descending order splicing result is spliced ​​with the flag of the initial ascending and descending order part to obtain the target ascending and descending order part.

[0560] For example, the inter-column operation corresponding to the largest second inter-column probability is "+", which can be used to concatenate the two header contents "Chinese score" and "Mathematics score", that is, "+" is concatenated between the two header contents "Chinese score" and "Mathematics score" to obtain the first ascending and descending order concatenation result "Chinese score" + "Mathematics score", and the ascending and descending order operation corresponding to the largest ascending and descending order probability is "asc (ascending)", which is concatenated with the first ascending and descending order concatenation result to obtain the second ascending and descending order concatenation result ("Chinese score" + "Mathematics score") asc, and the second ascending and descending order concatenation result is concatenated with the ORDER BY flag of the initial ascending and descending order part to obtain the target ascending and descending order part ORDER BY ("Chinese score" + "Mathematics score") asc.

[0561] In addition, for any initial component other than the initial restriction part, when the initial component is the initial condition part (i.e., the WHERE initial component), the sub-components of the initial condition part can be generated by the embedding vector corresponding to the corresponding component content in the above splicing result and the column representation embedding vector corresponding to any header representation content.

[0562] Based on this, Figure 8 FIG. 1 is a schematic diagram of an implementation flow of a method for generating sub-components of an initial condition part provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0563] S801, classify the embedding vector corresponding to the custom mark to obtain the number probability of each condition number corresponding to the initial condition part and the relationship probability of each condition relationship.

[0564] S802, selecting the maximum number probability, and determining the number of conditions corresponding to the maximum number probability.

[0565] S803, selecting the maximum relationship probability, and determining the conditional relationship corresponding to the maximum relationship probability.

[0566] In the embodiment of the present application, for the initial condition part, it usually uses several conditions, and there is a certain relationship between the conditions, for example, WHERE ("class" = "class 3") OR ("English score" > "110"), it uses 2 conditions, and the relationship between the conditions is OR (or). Here, it is necessary to first predict the number of conditions used in the initial condition part and the relationship between the conditions. For the prediction of such tasks, it is necessary to rely on the semantic information in the target requirement expression for prediction.

[0567] Specifically, the semantic information in the target requirement expression is generally reflected by the embedding vector corresponding to the custom flag, so the embedding vector corresponding to the custom flag can be classified and predicted to generate the number of conditions used in the initial condition part and the relationship between the conditions. Among them, the embedding vector corresponding to the custom flag can be classified and predicted with the help of a classification model.

[0568] Based on this, the embedding vector corresponding to the custom logo is classified to obtain the number probability of each condition corresponding to the initial condition part, as well as the relationship probability of each condition relationship. The largest number probability is selected, and the number of conditions corresponding to the largest number probability is determined, such as 2. The largest relationship probability is selected, and the conditional relationship corresponding to the largest relationship probability is determined, such as OR.

[0569] The embedding vector corresponding to the custom logo is input into the pre-trained classification model to obtain the number probability of each condition number corresponding to the initial condition part and the relationship probability of each condition relationship. The pre-trained classification model includes a convolution layer, a pooling layer, a fully connected layer and a Sigmoid function, and here three classifications of conditional relationships and three classifications of the number of conditions can be performed.

[0570] S804, searching for the embedding vector corresponding to each character in the target requirement statement from the embedding vectors corresponding to the constituent contents of the concatenation result.

[0571] S805, classify the embedding vector corresponding to each character in the target requirement expression to obtain the condition value flag corresponding to each character in the target requirement expression.

[0572] S806, selecting a target character from the target requirement statement, wherein the conditional value mark of the target character is a preset value.

[0573] S807, forming M conditional values ​​from the target characters, where M is the number of conditions corresponding to the maximum number probability.

[0574] In the embodiment of the present application, for the target requirement expression, there is usually a condition value in the condition part, for example, for WHERE ("class" = "class 3") OR ("English score" > "110"), here "class 3" and "110" belong to the condition value of the condition part, and "class" and "English score" belong to the condition column of the condition part. Therefore, for the target requirement expression, it is necessary to mark the condition value therein.

[0575] Based on this, the embedding vector corresponding to each character in the target demand statement is found from the embedding vector corresponding to the component content of the splicing result, and the embedding vector corresponding to each character in the target demand statement is classified to obtain the conditional value flag corresponding to each character in the target demand statement. The target character is selected from the target demand statement, and the conditional value flag of the target character is a preset value. The target character constitutes M conditional values, and M is the number of conditions corresponding to the maximum number probability.

[0576] Among them, the embedding vector corresponding to each character in the target requirement expression is input into the pre-trained classification model to obtain the conditional value flag corresponding to each character in the target requirement expression. The conditional value flag here can be 1 or 0, for example. If the conditional value flag is 1, it indicates that the corresponding character belongs to the conditional value. In this way, the character with the conditional value flag of 1 can be selected from the target requirement expression as the target character, and the target characters constitute M conditional values.

[0577] From then on, through the above steps S801~S802, the number of conditions to be used in the initial condition part can be known, and then through steps S804~S807, the condition values ​​in the target requirement statement can be known, and the number of condition values ​​is equal to the number of conditions, which means that several condition values ​​in the target requirement statement can be marked according to the number of conditions.

[0578] S808, generating sub-components of the initial condition part according to the M condition values, the conditional relationship corresponding to the maximum relationship probability, and the column representation embedding vector corresponding to any header representation content.

[0579] In an embodiment of the present application, for M conditional values, the conditional relationship corresponding to the maximum relationship probability, and the column representation embedding vector corresponding to any header representation content, a sub-component of the initial conditional part can be generated based on the M conditional values, the conditional relationship corresponding to the maximum relationship probability, and the column representation embedding vector corresponding to any header representation content.

[0580] Among them, the conditional relationship corresponding to the largest relationship probability is the sub-component of the initial condition part, and the remaining sub-components of the initial condition part need to be generated based on the column representation embedding vector corresponding to the M condition values ​​and any header representation content.

[0581] Specifically, for any conditional value, the embedding vector corresponding to the target characters constituting the conditional value is matched with the column representation embedding vector corresponding to any header representation content to obtain the header representation content matching the conditional value; the conditional value and the header content in the header representation content matching the conditional value are determined as the first sub-component of the initial condition part, for example, the header content "class" and the conditional value "class 3", and the header content "English score" and the conditional value "110" are both the first sub-components of the initial condition part.

[0582] For any conditional value, the embedding vectors corresponding to the target characters constituting the conditional value and the column representation embedding vectors corresponding to the header representation content matched by the conditional value are classified and processed to obtain the logical probabilities of various logical operations corresponding to the conditional value; the largest logical probability is selected, and the logical operation corresponding to the largest logical probability is determined, such as "="; the logical operation corresponding to the largest logical probability is determined as the second sub-component of the initial condition part; the conditional relationship corresponding to the largest relationship probability is determined as the third sub-component of the initial condition part, such as "OR".

[0583] Among them, the embedding vector corresponding to the target character constituting the conditional value and the column representation embedding vector corresponding to the header representation content matched by the conditional value can be input into the pre-trained classification model to obtain the logical probability of each logical operation corresponding to the conditional value. For logical operations, for example, it can be ">", "<", "=", "≥", "≤", etc., which is not limited in the embodiments of the present application.

[0584] In this way, several subcomponents of the initial condition part can be obtained, and the subcomponents can be spliced ​​to obtain the target condition part. To this end, for any condition value, the logical operation corresponding to the maximum logical probability corresponding to the condition value is used to splice the condition value with the header content in the header representation content that matches the condition value to obtain the first condition splicing result; the condition relationship corresponding to the maximum relationship probability is used to splice all the first condition splicing results to obtain the second condition splicing result; the second condition splicing result is spliced ​​with the mark of the initial condition part to obtain the target condition part.

[0585] For example, for the conditional value "Class 3", the logical operation "=" corresponding to the maximum logical probability corresponding to the conditional value is used to splice the conditional value "Class 3" with the header content "Class" in the header representation content that matches the conditional value, and the first conditional splicing result is obtained, that is, the logical operation corresponding to the maximum logical probability corresponding to the conditional value is spliced ​​between the conditional value "Class 3" and the header content "Class" in the header representation content that matches the conditional value, and the first conditional splicing result "Class" = "Class 3" is obtained.

[0586] For the conditional value "110", the logical operation corresponding to the maximum logical probability corresponding to the conditional value is used to splice the conditional value "110" with the header content "English score" in the header representation content that matches the conditional value, and obtain the first conditional splicing result, that is, the logical operation corresponding to the maximum logical probability corresponding to the conditional value is spliced ​​between the conditional value "110" and the header content "English score" in the header representation content that matches the conditional value, and obtain the first conditional splicing result "English score" > "110".

[0587] Using the conditional relationship "OR" corresponding to the maximum relationship probability, all the first condition splicing results are spliced ​​to obtain the second condition splicing result, ("class" = "Class 3") OR ("English score" > "110"), and the second condition splicing result is spliced ​​with the sign WHERE of the initial condition part to obtain the target condition part, WHERE ("class" = "Class 3") OR ("English score" > "110").

[0588] In addition, in an embodiment of the present application, for any conditional value, in the process of matching the embedding vector corresponding to the target characters constituting the conditional value with the column representation embedding vector corresponding to any header representation content to obtain the header representation content that matches the conditional value, the usage probability of each header representation content used in the initial condition part can be pre-marked, and the embedding vector corresponding to the target characters constituting the conditional value can be matched with the column representation embedding vector corresponding to any header representation content according to the usage probability, thereby narrowing the matching range.

[0589] Based on this, the column representation embedding vectors corresponding to all header representation contents are classified and processed to obtain the fourth usage probability of each header representation content used in the initial condition part; according to the fourth usage probability, the embedding vector corresponding to the target characters constituting the conditional value is matched with the column representation embedding vector corresponding to any header representation content to obtain the header representation content matching the conditional value.

[0590] S212, generating a target programming statement from each target component corresponding to the initial programming statement.

[0591] In the embodiment of the present application, this step is similar to the above-mentioned step S104, and the embodiment of the present application will not be described one by one here.

[0592] In this way, a multi-task model is pre-constructed and used to generate sub-components of each initial component of the initial programming statement, and the sub-components are spliced ​​to obtain target components corresponding to the initial programming statement. Finally, the target components corresponding to the initial programming statement are spliced ​​to obtain a complete target programming statement, which can avoid the influence of the vocabulary range and ensure the grammatical correctness and executableness of the generated programming statement.

[0593] In addition, for the generated target programming statement, the target programming statement can be executed. Specifically, if the table is similar to the database table structure, the above target table can be converted into a database table, so that the target programming statement can be executed on the database table, or the target programming statement can be converted into the corresponding table formula, and then the table formula is executed on the target table.

[0594] In addition, before using the multi-task model to generate sub-components of each initial component of the initial programming statement, the multi-task model needs to be trained. Fig. 9 As shown, it is a schematic diagram of an implementation flow of a model training method provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0595] S901, obtaining a sample table and a sample requirement statement corresponding to the sample table, and determining all sample header representation contents in the sample table.

[0596] In the embodiment of the present application, a sample form can be obtained, wherein the sample form is similar to the target form, and can be a form of various industries. And the user can input a corresponding sample requirement statement for the sample form, thereby obtaining a sample requirement statement corresponding to the sample form.

[0597] In addition, for the sample table, the sample table content in the sample table also needs to be determined. The sample table content is usually composed of the sample header content filled in the sample header cell and the sample cell content filled in the remaining sample cells except the sample header cell.

[0598] Specifically, a sample header in the sample table is determined, wherein the sample header is usually the first row of cells in the sample table and is filled with corresponding sample header content. Based on this, for any sample header cell in the sample header, the sample header content filled in the sample header cell is obtained.

[0599] In addition, determine the remaining sample cells in the column where the sample header cell is located except the sample header cell, select the target sample cell from the remaining sample cells, obtain the sample cell content filled in the target sample cell, combine the sample header content with the sample cell content, and obtain the sample header representation content corresponding to the sample header cell, so as to obtain all the sample header representation contents in the sample table.

[0600] It should be noted that the sample header is usually the first row of cells in the sample table. Therefore, the above determination of the sample header cell's column includes the remaining sample cells except the sample header cell. However, if the sample header is the first column of cells in the sample table, the above determination of the sample header cell's row includes the remaining sample cells except the sample header cell, which is related to the sample header.

[0601] In addition, for the remaining sample cells, sample cells can be randomly selected from the remaining sample cells as target sample cells. For example, if the sample header content "Date" is filled in the sample header cell C1, then the remaining sample cells except the sample header cell in the column where the sample header cell C1 is located can be determined, and sample cell C3 can be randomly selected from the remaining sample cells as the target sample cell, and the sample cell content "2024 / 02 / 01" filled in the sample cell C3 is obtained, and the sample header content is combined with the sample cell content to obtain the sample header representation content "Date: 2024 / 02 / 01" corresponding to the sample header cell C1.

[0602] In addition, in order to increase the diversity of the corpus and avoid the corpus description being too single, for the sample header representation content, the Word2Vec word vector is used to calculate the similarity between the specific word and some words in the sample header representation content. When the similarity threshold is higher than, for example, 0.9, the specific word is determined as a synonym of some words in the sample header representation content, and some words in the sample header representation content are replaced with synonyms. For example, "tax payment" is a synonym of "tax amount". For some words in the sample header representation content, they may be typos. At this time, the accumulated typo dictionary can be used to replace some words in the sample header representation content. For example, "gathering time" is replaced with "holding time". For some words in the sample header representation content, they may be rarely used date expressions. At this time, they can be formatted. For example, "20240201" is replaced with "2024 / 02 / 01". Similarly, the above method is also applicable to some words in the sample demand expression, and the large language model can be used to generalize the sample demand expression, that is, to generate sample demand expressions in different expressions.

[0603] S902, input the sample requirement statement and all sample header representation contents into the multi-task model, and the multi-task model performs the following processing.

[0604] In an embodiment of the present application, the sample requirement statement and all sample header representation contents may be input into a multi-task model, and the multi-task model may execute the following steps S903 to S905 to generate a predicted sub-component of any sample component of the sample programming statement.

[0605] S903, splicing the sample requirement statement and all sample header representation contents according to the custom flag and the sequence flag to obtain a sample splicing result.

[0606] In the embodiment of the present application, for the sample requirement expression and all sample header representation contents, a custom mark and a sequence mark can be used to connect the sample requirement expression with each sample header representation content. For example, the sequence mark can be [SEP] Token, and for the custom mark, for example, it can be [XLS] Token.

[0607] It should be noted that since the [CLS] Token at the starting position is more used for classification prediction of NSP tasks in pre-training, it is replaced with [XLS] Token. After the token is changed, the accuracy of task classification prediction can be improved for the pre-trained multi-task model.

[0608] Based on this, the sample demand statements are spliced ​​according to the custom flag and the sequence flag to obtain the first sample statement splicing result, wherein the custom flag is located at the starting position of the first sample statement splicing result, and the sequence flag is located at the end position of the first sample statement splicing result. For any sample header representation content, the sample header representation content is spliced ​​according to the sequence flag to obtain the second sample content splicing result, wherein the sequence flag is located at the end position of the second sample content splicing result. The first sample statement splicing result and all the second sample content splicing results are spliced ​​in sequence to obtain a sample splicing result.

[0609] S904, for any sample component content in the sample splicing result, vectorize the sample component content to obtain a sample embedding vector corresponding to the sample component content.

[0610] In the embodiment of the present application, for the sample splicing result, for any sample component content in the sample splicing result, the sample component content is vectorized to obtain a sample embedding vector corresponding to the sample component content. The sample component content includes one of the following: a custom flag, a sequence flag, each character in the sample requirement expression, and each character in the sample header representation content.

[0611] S905 , for any sample component of the sample programming statement, predict a predicted subcomponent of the sample component according to a sample embedding vector corresponding to a corresponding sample component content in the sample splicing result.

[0612] S906, determining a loss value between a predicted sub-component of the sample component and a sample sub-component of the sample component.

[0613] In an embodiment of the present application, after the above processing, a sample embedding vector corresponding to each sample component content in the sample splicing result can be obtained. Therefore, for any sample component of the sample programming statement, a predicted sub-component of the sample component is generated according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result.

[0614] In addition, for any sample component of the sample programming statement, there is a corresponding sample subcomponent, thereby determining a loss value between the predicted subcomponent of the sample component and the sample subcomponent of the sample component. The number of loss values ​​can be multiple, and the loss value can be calculated using a cross entropy loss function.

[0615] Among them, for the sample restriction part of the sample programming statement, that is, the LIMIT component, due to its simple structure, it is composed of a prediction sub-component and the flag of the LIMIT component. Therefore, it is relatively simple to generate the prediction sub-component of the LIMIT component, which can be generated based on the semantic information in the sample requirement statement.

[0616] Specifically, the semantic information in the sample requirement expression is generally reflected by the sample embedding vector corresponding to the custom mark, so the sample embedding vector corresponding to the custom mark can be classified and predicted to generate the predicted sub-components of the LIMIT component. Among them, the sample embedding vector corresponding to the custom mark can be classified and predicted with the help of a classification model.

[0617] For this reason, Fig.10 FIG. 1 is a schematic diagram of an implementation flow of a method for generating a prediction subcomponent of a sample restriction part provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0618] S1001, searching for a sample embedding vector corresponding to a custom logo from sample embedding vectors corresponding to sample composition contents of a sample concatenation result.

[0619] In the embodiment of the present application, for the sample splicing result, the sample composition content includes a custom mark, so that the sample embedding vector corresponding to the custom mark can be found from the sample embedding vector corresponding to the sample composition content of the sample splicing result.

[0620] S1002, classify the sample embedding vector corresponding to the custom mark to obtain the sample restriction probability of each sample restriction quantity corresponding to the sample restriction part.

[0621] In the embodiment of the present application, the sample embedding vector corresponding to the custom mark is classified and processed to obtain the sample restriction probability of each sample restriction quantity corresponding to the sample restriction part. The sample embedding vector corresponding to the custom mark can be classified and processed by means of a classification model.

[0622] To this end, the sample embedding vector corresponding to the custom logo is input into the classification model to obtain the sample restriction probability of each sample restriction number corresponding to the sample restriction part. Among them, the classification model includes convolution layer, pooling layer, fully connected layer and Softmax function.

[0623] It should be noted that for the LIMIT component, the sample limit quantity generally ranges from 0 to 20, from which the sample limit probabilities of each sample limit quantity corresponding to the sample limit part can be predicted, that is, 20 classifications are performed to obtain the sample limit probability of each sample limit quantity.

[0624] S1003, selecting the maximum sample restriction probability, and determining the sample restriction quantity corresponding to the maximum sample restriction probability.

[0625] S1004, determining the sample restriction quantity corresponding to the maximum sample restriction probability as the prediction subcomponent of the sample restriction part.

[0626] In an embodiment of the present application, for the sample restriction probabilities of each sample restriction quantity, the largest sample restriction probability is selected, and the sample restriction quantity corresponding to the largest sample restriction probability is determined, and the sample restriction quantity corresponding to the largest sample restriction probability is determined as the prediction sub-component of the sample restriction part.

[0627] This allows us to determine the loss value between the predicted subcomponent of the sample restriction part (i.e., the sample restriction number corresponding to the maximum sample restriction probability) and the sample subcomponent of the sample restriction part (i.e., the labeled sample restriction number).

[0628] In addition, in the embodiment of the present application, the sample components of the sample programming statement, in addition to the above-mentioned sample restriction part, also include the remaining sample parts. Compared with the prediction of the sample restriction part, the remaining sample parts are more complicated, so the sample header representation content needs to be further processed.

[0629] Based on this, Fig.11 FIG. 1 is a schematic diagram of an implementation flow of a method for generating a predicted sub-component of a sample component provided by an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0630] S1101, for any sample header representation content, perform the following processing to obtain a sample column representation embedding vector corresponding to the sample header representation content.

[0631] In the embodiment of the present application, for any sample header representation content (which can be referred to as Header for short), the following steps S1102 to S1104 are executed to obtain a sample column representation embedding vector (which can be referred to as ColumEmbedding for short) corresponding to the sample header representation content.

[0632] S1102, searching for the sample embedding vector corresponding to each character in the sample header representation content and the sample embedding vector corresponding to the sequence mark spliced ​​with the sample header representation content from the sample embedding vector corresponding to the sample composition content of the sample splicing result.

[0633] In an embodiment of the present application, for the sample splicing result, part of the sample component content is spliced ​​by the sample header representation content and the corresponding sequence flag. Therefore, the sample embedding vector corresponding to each character in the sample header representation content and the sample embedding vector corresponding to the sequence flag spliced ​​with the sample header representation content can be searched from the sample embedding vector corresponding to the sample component content of the sample splicing result.

[0634] S1103, the sample embedding vector corresponding to the custom logo, the sample embedding vector corresponding to each character in the sample header representation content, and the sample embedding vector corresponding to the sequence logo spliced ​​with the sample header representation content are processed by a self-attention mechanism to obtain a sample processing result.

[0635] In an embodiment of the present application, a secondary Self-Attention mechanism may be performed on the sample embedding vector corresponding to the custom logo, the sample embedding vector corresponding to each character in the sample header representation content, and the sample embedding vector corresponding to the sequence logo spliced ​​with the sample header representation content.

[0636] Based on this, the sample embedding vector corresponding to the custom logo, the sample embedding vector corresponding to each character in the sample header representation content, and the sample embedding vector corresponding to the sequence logo spliced ​​with the sample header representation content are processed by the self-attention mechanism to obtain the sample processing result.

[0637] S1104, adding the sample embedding vector corresponding to the custom mark to the sample processing result to obtain the sample column representation embedding vector corresponding to the sample header representation content.

[0638] In an embodiment of the present application, for the sample processing results obtained in the above steps, the sample embedding vector corresponding to the custom flag can be added to the sample processing results to obtain the sample column representation embedding vector corresponding to the sample header representation content, so that the sample column representation embedding vector corresponding to each sample header representation content can be obtained.

[0639] S1105, predicting the predicted sub-components of the sample components according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content.

[0640] In an embodiment of the present application, for any sample component other than the sample restriction part, the predicted sub-component of the sample component can be generated based on the sample embedding vector corresponding to the corresponding sample composition content in the sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content.

[0641] Among them, for any component except the sample restriction part, when the component is the sample selection part (i.e., the SELECT component), the sample embedding vector corresponding to the corresponding sample composition content in the above-mentioned sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content can be used to generate the prediction sub-component of the sample selection part.

[0642] Based on this, Fig.12 FIG. 1 is a schematic diagram of an implementation flow of a method for generating a prediction subcomponent of a sample selection part provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0643] S1201, classify the sample embedding vector corresponding to the custom mark to obtain the first sample column probability of each sample column quantity corresponding to the sample selection part.

[0644] S1202, selecting the largest first sample column probability, and determining the number of sample columns corresponding to the largest first sample column probability.

[0645] In an embodiment of the present application, for the sample selection part, it usually uses several table columns, for example, SELECT ("Chinese score" + "Mathematics score"), which uses 2 table columns. Here, it is necessary to first predict the number of table columns used in the sample selection part. For the prediction of such tasks, it is necessary to rely on the semantic information in the sample demand statement for prediction.

[0646] Specifically, the semantic information in the sample requirement expression is generally reflected by the sample embedding vector corresponding to the custom mark, so the sample embedding vector corresponding to the custom mark can be classified and predicted to predict the number of table columns used in the sample selection part. Among them, the sample embedding vector corresponding to the custom mark can be classified and predicted with the help of a classification model.

[0647] Based on this, the sample embedding vector corresponding to the custom logo is classified, the first sample column probability of each sample column quantity corresponding to the sample selection part is obtained, the largest first sample column probability is selected, and the number of sample columns corresponding to the largest first sample column probability is determined, for example, 2. The sample embedding vector corresponding to the custom logo can be classified with the help of a classification model.

[0648] To this end, the sample embedding vector corresponding to the custom mark is input into the classification model to obtain the first sample column probability of each sample column quantity corresponding to the sample selection part. The classification model includes a convolution layer, a pooling layer, a fully connected layer, and a Sigmoid function, and here, for example, 2 classifications can be performed, that is, predicting the first sample column probability of sample column quantity 1 and the first sample column probability of sample column quantity 2.

[0649] S1203, classify and process the sample column representation embedding vectors corresponding to the contents represented by all sample headers, and obtain the first sample usage probability of each sample header representation content used by the sample selection part.

[0650] S1204, sorting the first sample usage probabilities and selecting the top N first sample usage probabilities, where N is the number of sample columns corresponding to the largest first sample column probability.

[0651] In an embodiment of the present application, the sample column representation embedding vectors corresponding to the content represented by all sample headers are classified and processed to obtain the first sample usage probability of each sample header representation content used by the sample selection part. The sample column representation embedding vectors corresponding to the content represented by all sample headers can be classified and processed with the help of a classification model.

[0652] Based on this, the sample column representation embedding vectors corresponding to the content represented by all sample headers are input into the classification model to obtain the first sample usage probability of each sample header representation content used in the sample selection part, these first sample usage probabilities are sorted, and the top N first sample usage probabilities are selected, where N is the number of sample columns corresponding to the largest first sample column probability.

[0653] From then on, through steps S1201~S1202, the number of table columns to be used by the sample selection part can be known, and then through steps S1203~S1204, the first sample usage probability of each sample header representation content used by the sample selection part can be known. According to the number of table columns to be used by the sample selection part and following the first sample usage probability of each sample header representation content, the corresponding sample header representation content is selected.

[0654] S1205 , predicting the prediction subcomponents of the sample selection part according to the usage probabilities of the first samples of the top N.

[0655] In an embodiment of the present application, for the usage probabilities of the top N first samples, the prediction sub-components of the sample selection part can be predicted based on the usage probabilities of the top N first samples. In essence, the prediction sub-components of the sample selection part are predicted based on the contents represented by the N sample headers corresponding to the usage probabilities of the top N first samples.

[0656] Specifically, N sample header representation contents corresponding to the top N first sample usage probabilities are determined, and N sample header contents among the N sample header representation contents are obtained; and the N sample header contents are determined as the first prediction subcomponent of the sample selection part.

[0657] The sample column representation embedding vectors corresponding to the N sample header representation contents are classified and processed to obtain the first sample column probability of each sample column operation corresponding to the sample selection part and the sample aggregation probability of each sample aggregation operation.

[0658] It should be noted that the operations between sample columns refer to the operations between table columns, such as "+", "-", "*", " / ". The sample aggregation operations refer to the aggregation operations of table columns, such as "MAX", "MIN", "SUM", etc., which are not limited in the embodiments of the present application.

[0659] Among them, the sample column representation embedding vector corresponding to the N sample header representation content is input into the classification model to obtain the first sample column probability of each sample column operation corresponding to the sample selection part and the sample aggregation probability of each sample aggregation operation.

[0660] Select the largest first inter-sample column probability, and determine the sample column operation corresponding to the largest first inter-sample column probability; select the largest sample aggregation probability, and determine the sample aggregation operation corresponding to the largest sample aggregation probability; determine the sample column operation corresponding to the largest first inter-sample column probability as the second prediction sub-component of the sample selection part; determine the sample aggregation operation corresponding to the largest sample aggregation probability as the third prediction sub-component of the sample selection part.

[0661] In this way, several prediction sub-components of the sample selection part can be obtained. For any prediction sub-component, the loss value between the prediction sub-component and the corresponding sample sub-component in the sample selection part can be determined.

[0662] In addition, the first sample column probabilities of each sample column quantity corresponding to the sample selection part are pre-labeled, and the loss value of the first sample column probabilities of each sample column quantity labeled in advance and the first sample column probabilities of each sample column quantity obtained in the above step S1201 can be determined to participate in the training of subsequent models.

[0663] Similarly, the probability of using the first sample of each sample header to represent the content in the sample selection part that is pre-annotated can determine the loss value between the probability of using the first sample of each sample header to represent the content that is pre-annotated and the probability of using the first sample of each sample header to represent the content obtained in the above step S1203, and participate in the training of subsequent models.

[0664] In addition, for any sample component other than the sample restriction part, when the sample component is a sample grouping part (i.e., a GROUP BY component), the predicted sub-component of the sample grouping part can be generated by using the sample embedding vector corresponding to the corresponding sample composition content in the above sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content.

[0665] Based on this, Fig.13 FIG. 1 is a schematic diagram of an implementation flow of a method for generating a prediction sub-component of a sample grouping part provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0666] S1301, classify the sample embedding vector corresponding to the custom mark to obtain the second sample column probability of each sample column quantity corresponding to the sample grouping part.

[0667] S1302: Select the largest second sample column probability, and determine the number of sample columns corresponding to the largest second sample column probability.

[0668] In the embodiment of the present application, for the sample grouping part, it usually uses several table columns, for example, GROUPBY "Chinese scores" uses 1 table column. Here, it is necessary to first predict the number of table columns used in the sample grouping part. For the prediction of such tasks, it is necessary to rely on the semantic information in the sample demand expression for prediction.

[0669] Specifically, the semantic information in the sample requirement expression is generally reflected by the sample embedding vector corresponding to the custom mark, so the sample embedding vector corresponding to the custom mark can be classified and predicted to predict the number of table columns used in the sample grouping part. Among them, the sample embedding vector corresponding to the custom mark can be classified and predicted with the help of a classification model.

[0670] Based on this, the sample embedding vector corresponding to the custom mark is classified, and the second sample column probability of each sample column number corresponding to the sample grouping part is obtained, the largest second sample column probability is selected, and the number of sample columns corresponding to the largest second sample column probability is determined, for example, 2. The sample embedding vector corresponding to the custom mark can be classified with the help of a classification model.

[0671] To this end, the sample embedding vector corresponding to the custom logo is input into the classification model to obtain the second sample column probability of each sample column quantity corresponding to the sample grouping part. The classification model includes a convolution layer, a pooling layer, a fully connected layer and a Softmax function, and the sample embedding vector corresponding to the custom logo can be classified into, for example, 2 categories.

[0672] S1303, classify and process the sample column representation embedding vectors corresponding to the contents represented by all sample headers to obtain the second sample usage probability of each sample header representation content used by the sample grouping part.

[0673] S1304, sort the second sample usage probabilities, and select the top M second sample usage probabilities, where M is the number of sample columns corresponding to the largest second sample column probability.

[0674] In an embodiment of the present application, the sample column representation embedding vectors corresponding to the content represented by all sample headers are classified and processed to obtain the second sample usage probability of each sample header representation content used by the sample grouping part. Wherein, the sample column representation embedding vectors corresponding to the content represented by all sample headers can be classified and processed with the help of a classification model.

[0675] Based on this, the sample column representation embedding vectors corresponding to the content represented by all sample headers are input into the classification model to obtain the second sample usage probability of each sample header representation content in the sample grouping part, these second sample usage probabilities are sorted, and the top M second sample usage probabilities are selected, where M is the number of sample columns corresponding to the largest second sample column probability.

[0676] From then on, through the above steps S1301~S1302, the number of table columns to be used by the sample grouping part can be known, and then through steps S1303~S1304, the second sample usage probability of each sample header representing the content can be known. According to the number of table columns to be used by the sample grouping part and following the second sample usage probability of each sample header representing the content, the corresponding sample header representation content can be selected.

[0677] S1305: Generate prediction subcomponents of the sample grouping part according to the second sample usage probabilities of the top M.

[0678] In an embodiment of the present application, for the second sample usage probabilities of the top M names, a prediction sub-component of the sample grouping part can be generated based on the second sample usage probabilities of the top M names. In essence, the prediction sub-component of the sample grouping part is generated based on the M sample header representation contents corresponding to the second sample usage probabilities of the top M names.

[0679] Specifically, M sample header representation contents corresponding to the top M second sample usage probabilities are determined, and M sample header contents among the M sample header representation contents are obtained; and the M sample header contents are determined as prediction subcomponents of the sample grouping part.

[0680] In this way, the predicted subcomponent of the sample grouping part can be obtained, and the loss value between it and the sample subcomponent of the sample grouping part can be determined. In addition, the second sample column probability of each sample column number corresponding to the sample grouping part can be pre-annotated, and the loss value between the second sample column probability of each sample column number corresponding to the sample grouping part obtained in step S1301 can be determined to participate in the training of the subsequent model.

[0681] Similarly, the probability of using the second sample of each sample header to represent the content in the sample grouping part can be pre-annotated, and the loss value between the probability of using the second sample of each sample header to represent the content in advance and the probability of using the second sample of each sample header to represent the content obtained in the above step S1303 can be determined to participate in the training of subsequent models.

[0682] In addition, for any sample component other than the current status part of the sample, when the sample component is the ascending and descending part of the sample, the predicted sub-component of the ascending and descending part of the sample can be generated by the sample embedding vector corresponding to the corresponding sample composition content in the above-mentioned sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content.

[0683] Based on this, Fig.14 FIG. 1 is a schematic diagram of an implementation flow of a method for generating a predicted sub-component of a sample ascending and descending order portion provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0684] S1401, classify the sample embedding vector corresponding to the custom mark to obtain the third sample column probability of each sample column quantity corresponding to the sample ascending and descending order part, and the sample ascending and descending order probability of each sample ascending and descending order operation.

[0685] S1402, selecting the largest third sample column probability, and determining the number of sample columns corresponding to the largest third sample column probability.

[0686] S1403, selecting the maximum sample ascending and descending probability, and determining the sample ascending and descending operation corresponding to the maximum sample ascending and descending probability.

[0687] In the embodiment of the present application, for the ascending and descending part of the sample, it usually uses several table columns, for example, ORDER BY "Chinese score", it uses 1 table column. Here, it is necessary to first predict the number of table columns used in the ascending and descending part of the sample and the specific ascending and descending operations. For the prediction of such tasks, it is necessary to rely on the semantic information in the sample demand expression for prediction.

[0688] Specifically, the semantic information in the sample requirement expression is generally reflected by the sample embedding vector corresponding to the custom mark, so the sample embedding vector corresponding to the custom mark can be classified and predicted to generate the number of table columns used in the ascending and descending part of the sample and the specific ascending and descending operations. Among them, the sample embedding vector corresponding to the custom mark can be classified and predicted with the help of a classification model.

[0689] Based on this, the sample embedding vector corresponding to the custom logo is classified and processed to obtain the third sample column probability of each sample column quantity corresponding to the sample ascending and descending part, as well as the sample ascending and descending probability of each sample ascending and descending operation. The largest third sample column probability is selected, and the number of sample columns corresponding to the largest third sample column probability is determined. The largest sample ascending and descending probability is selected, and the sample ascending and descending operation corresponding to the largest sample ascending and descending probability is determined.

[0690] The sample embedding vector corresponding to the custom logo can be classified by means of a classification model. For this purpose, the sample embedding vector corresponding to the custom logo is input into the classification model to obtain the third sample column probability of each sample column quantity corresponding to the sample ascending and descending part, and the sample ascending and descending probability of each sample ascending and descending operation. The classification model includes a convolution layer, a pooling layer, a fully connected layer, and a Sigmoid function, and can perform 3 classifications of the sample column quantity and 3 classifications of the sample ascending and descending operations.

[0691] S1404, classify and process the sample column representation embedding vectors corresponding to the contents represented by all sample headers to obtain the third sample usage probability of using each sample header representation content in the ascending and descending order parts of the samples.

[0692] S1405, sorting the third sample usage probabilities and selecting the top O third sample usage probabilities, where O is the number of sample columns corresponding to the largest third sample column probability.

[0693] In the embodiment of the present application, the sample column representation embedding vectors corresponding to the content represented by all sample headers are classified and processed to obtain the third sample usage probability of using each sample header representation content in the ascending and descending order of the sample. Wherein, the sample column representation embedding vectors corresponding to the content represented by all sample headers can be classified and processed with the help of a classification model.

[0694] Based on this, the sample column representation embedding vectors corresponding to the content represented by all sample headers are input into the classification model to obtain the third sample usage probability of each sample header representation content in the ascending and descending parts of the samples, these third sample usage probabilities are sorted, and the top O third sample usage probabilities are selected, where O is the number of sample columns corresponding to the largest third sample column probability.

[0695] From then on, through the above steps S1401~S1402, the number of table columns to be used in the sample ascending and descending part can be known, and then through steps S1404~S1405, the third sample usage probability of each sample header representing the content in the sample ascending and descending part can be known. According to the number of table columns to be used in the sample ascending and descending part and following the third sample usage probability of each sample header representing the content, the corresponding sample header representation content is selected.

[0696] S1406, generating a prediction subcomponent of the sample ascending and descending part according to the sample ascending and descending operation corresponding to the third sample usage probability of the top 0 and the maximum sample ascending and descending probability.

[0697] In the embodiment of the present application, for the sample ascending and descending operations corresponding to the third sample usage probabilities of the top 0 and the maximum sample ascending and descending probabilities, the prediction sub-components of the sample ascending and descending parts can be generated according to the sample ascending and descending operations corresponding to the third sample usage probabilities of the top 0 and the maximum sample ascending and descending probabilities. In essence, the sample ascending and descending operations corresponding to the maximum sample ascending and descending probability, i.e., the prediction sub-components of the sample ascending and descending parts, generate the remaining prediction sub-components of the sample ascending and descending parts according to the O sample header representation contents corresponding to the third sample usage probabilities of the top 0.

[0698] Specifically, determine the O sample header representation contents corresponding to the third sample usage probabilities of the top O, classify the sample column representation embedding vectors corresponding to the O sample header representation contents, obtain the second sample column probabilities of the sample column operations corresponding to the sample ascending and descending parts, select the largest second sample column probability, and determine the sample column operation corresponding to the largest second sample column probability;

[0699] Obtain O sample header contents among the O sample header representation contents, determine the O sample header contents as the first prediction sub-component of the sample ascending and descending order part, determine the sample ascending and descending order operation corresponding to the maximum sample ascending and descending order probability as the second prediction sub-component of the sample ascending and descending order part, and determine the sample inter-column operation corresponding to the maximum second sample inter-column probability as the third prediction sub-component of the sample ascending and descending order part.

[0700] In this way, several prediction sub-components of the sample ascending and descending order parts can be obtained. For any prediction sub-component, the loss value between the prediction sub-component and the sample sub-component corresponding to the sample ascending and descending order part can be determined.

[0701] In addition, the third sample column probability of each sample column quantity corresponding to the sample ascending and descending order parts and the sample ascending and descending order probability of each sample ascending and descending order operation can be pre-labeled, thereby determining the loss value between the third sample column probability of each sample column quantity corresponding to the sample ascending and descending order parts pre-labeled and the third sample column probability of each sample column quantity corresponding to the sample ascending and descending order parts obtained in the above step S1401, and determining the loss value between the sample ascending and descending order probabilities of each sample ascending and descending order operations corresponding to the sample ascending and descending order parts pre-labeled and the sample ascending and descending order probabilities of each sample ascending and descending order operations corresponding to the sample ascending and ascending order parts obtained in the above step S1401, to participate in the training of the post-model model.

[0702] Similarly, the probability of using the third sample in each sample header to represent the content can also be pre-annotated in ascending and descending order. This can determine the loss value between the probability of using the third sample in each sample header to represent the content and the probability of using the third sample in each sample header to represent the content obtained in the above step S1404, and participate in the training of subsequent models.

[0703] In addition, for any sample component other than the sample restriction part, when the sample component is the sample condition part (i.e., the WHERE component), the predicted sub-component of the sample condition part can be generated by the sample embedding vector corresponding to the corresponding sample component content in the above sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content.

[0704] Based on this, Fig.15 FIG. 1 is a schematic diagram of an implementation flow of a method for generating a prediction subcomponent of a sample condition part provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:

[0705] S1501, classify the sample embedding vector corresponding to the custom mark to obtain the sample number probability of each sample condition number corresponding to the sample condition part and the sample relationship probability of each sample condition relationship.

[0706] S1502, selecting the maximum sample number probability, and determining the sample condition number corresponding to the maximum sample number probability.

[0707] S1503, selecting the maximum sample relationship probability, and determining the sample conditional relationship corresponding to the maximum sample relationship probability.

[0708] In the embodiment of the present application, for the sample condition part, it usually uses several conditions, and there is a certain relationship between the conditions, for example, WHERE ("class" = "class 3") OR ("English score" > "110"), it uses 2 conditions, and the relationship between the conditions is OR (or). Here, it is necessary to first predict the number of conditions used in the sample condition part and the relationship between the conditions. For the prediction of such tasks, it is necessary to rely on the semantic information in the sample demand expression for prediction.

[0709] Specifically, the semantic information in the sample requirement expression is generally reflected by the sample embedding vector corresponding to the custom mark, so the sample embedding vector corresponding to the custom mark can be classified and predicted to predict the number of conditions used in the sample condition part and the relationship between the conditions. Among them, the sample embedding vector corresponding to the custom mark can be classified and predicted with the help of a classification model.

[0710] Based on this, the sample embedding vector corresponding to the custom logo is classified and processed to obtain the sample number probability of each sample condition number corresponding to the sample condition part, as well as the sample relationship probability of each sample condition relationship. The largest sample number probability is selected, and the sample condition number corresponding to the largest sample number probability is determined. The largest sample relationship probability is selected, and the sample condition relationship corresponding to the largest sample relationship probability is determined.

[0711] The sample embedding vector corresponding to the custom logo is input into the classification model to obtain the sample number probability of each sample condition number corresponding to the sample condition part, and the sample relationship probability of each sample condition relationship. The classification model includes a convolution layer, a pooling layer, a fully connected layer, and a Sigmoid function, and here three classifications of sample condition relationships and three classifications of sample condition numbers can be performed.

[0712] S1504, searching for a sample embedding vector corresponding to each character in the sample requirement statement from the sample embedding vectors corresponding to the sample composition content of the sample splicing result.

[0713] S1505, classify the sample embedding vector corresponding to each character in the sample requirement expression to obtain the sample condition value flag corresponding to each character in the sample requirement expression.

[0714] S1506, selecting a sample character from the sample requirement statement, wherein the sample condition value flag of the sample character is a preset value.

[0715] S1507, the sample characters form M sample condition values, where M is the number of sample conditions corresponding to the maximum sample number probability.

[0716] In the embodiment of the present application, for the sample requirement expression, there is usually a sample condition value of the sample condition part, for example, for WHERE ("class" = "class 3") OR ("English score" > "110"), here "class 3" and "110" belong to the sample condition values ​​of the sample condition part, and "class" and "English score" belong to the sample condition column of the sample condition part. Therefore, for the sample requirement expression, it is necessary to mark the sample condition value therein.

[0717] Based on this, the sample embedding vector corresponding to each character in the sample requirement statement is searched from the sample embedding vector corresponding to the sample composition content of the sample splicing result, and the sample embedding vector corresponding to each character in the sample requirement statement is classified to obtain the sample condition value flag corresponding to each character in the sample requirement statement. The sample character is selected from the sample requirement statement, and the sample condition value flag of the sample character is a preset value. The sample characters constitute M sample condition values, and M is the number of sample conditions corresponding to the maximum sample number probability.

[0718] Among them, the sample embedding vector corresponding to each character in the sample requirement statement is input into the classification model to obtain the sample condition value flag corresponding to each character in the sample requirement statement. The sample condition value flag here can be 1 or 0, for example. If the sample condition value flag is 1, it means that the corresponding character belongs to the sample condition value. In this way, the character with the sample condition value flag of 1 can be selected from the sample requirement statement as the sample character, and the sample characters constitute M sample condition values.

[0719] From then on, through the above steps S1501~S1502, the number of sample conditions to be used in the sample condition part can be known, and then through steps S1504~S1507, the sample condition values ​​in the sample requirement statement can be known, and the number of sample condition values ​​is equal to the number of sample conditions, which means that several sample condition values ​​in the sample requirement statement can be marked according to the number of sample conditions.

[0720] S1508, generating a prediction subcomponent of the sample condition part according to the M sample condition values, the sample condition relationship corresponding to the maximum sample relationship probability, and the sample column representation embedding vector corresponding to the content represented by any sample header.

[0721] In an embodiment of the present application, for M sample condition values, the sample condition relationship corresponding to the maximum sample relationship probability, and the sample column representation embedding vector corresponding to the content represented by any sample header, the prediction sub-component of the sample condition part can be generated based on this.

[0722] Among them, the sample conditional relationship corresponding to the largest sample relationship probability is the prediction sub-component of the sample conditional part, and the remaining prediction sub-components of the sample conditional part need to be generated based on the M sample conditional values ​​and the sample column representation embedding vector corresponding to the content represented by any sample header.

[0723] Specifically, for any sample condition value, the sample embedding vector corresponding to the sample characters constituting the sample condition value is matched with the sample column representation embedding vector corresponding to any sample header representation content to obtain the sample header representation content that matches the sample condition value, and the sample condition value and the sample header content in the sample header representation content that matches the sample condition value are determined as the first prediction sub-component of the sample condition part.

[0724] For any sample condition value, the sample embedding vectors corresponding to the sample characters constituting the sample condition value and the sample column representation embedding vectors corresponding to the sample header representation content matched by the sample condition value are classified and processed to obtain the sample logical probabilities of each sample logical operation corresponding to the sample condition value, select the largest sample logical probability, and determine the sample logical operation corresponding to the largest sample logical probability, determine the sample logical operation corresponding to the largest sample logical probability as the second prediction sub-component of the sample condition part, and determine the sample condition relationship corresponding to the largest sample relationship probability as the third prediction sub-component of the sample condition part.

[0725] Among them, the sample embedding vector corresponding to the sample characters constituting the sample condition value and the sample column representation embedding vector corresponding to the sample header representation content matched by the sample condition value can be input into the classification model to obtain the sample logical probability of each sample logical operation corresponding to the sample condition value. For example, the sample logical operation can be “>”, “<”, “=”, “≥”, “≤”, etc., which is not limited in the embodiments of the present application.

[0726] In this way, several prediction subcomponents of the sample condition part can be obtained. For any prediction subcomponent, the loss value between the prediction subcomponent and the sample subcomponent corresponding to the sample condition part can be determined.

[0727] In addition, in an embodiment of the present application, for any sample condition value, in the process of matching the sample embedding vector corresponding to the sample characters constituting the sample condition value with the sample column representation embedding vector corresponding to any sample header representation content to obtain the sample header representation content that matches the sample condition value, the sample condition part can be marked with the sample usage probability of using each sample header representation content, and according to the sample usage probability, the sample embedding vector corresponding to the sample characters constituting the sample condition value can be matched with the sample column representation embedding vector corresponding to any sample header representation content, thereby narrowing the matching range.

[0728] Based on this, the sample column representation embedding vectors corresponding to all sample header representation contents are classified and processed to obtain the fourth sample usage probability of each sample header representation content used in the sample condition part. According to the fourth sample usage probability, the sample embedding vectors corresponding to the sample characters constituting the sample condition value are matched with the sample column representation embedding vector corresponding to any sample header representation content to obtain the sample header representation content that matches the sample condition value.

[0729] In addition, in an embodiment of the present application, the sample number probabilities of each sample condition number corresponding to the sample condition part and the sample relationship probabilities of each sample condition relationship can be pre-labeled, and then the loss value between the sample number probabilities of each sample condition number corresponding to the pre-labeled sample condition part and the sample number probabilities of each sample condition number corresponding to the sample condition part obtained in the above step S1501 is determined, and the loss value between the sample relationship probabilities of each sample condition relationship corresponding to the pre-labeled sample condition part and the sample relationship probabilities of each sample condition relationship corresponding to the sample condition part obtained in the above step S1501 is determined for subsequent model training.

[0730] Similarly, the sample condition value flag corresponding to each character in the sample requirement statement can also be pre-marked, and then the loss value between the sample condition value flag corresponding to each character in the pre-marked sample requirement statement and the sample condition value flag corresponding to each character in the sample requirement statement obtained in the above step S1505 can be determined for subsequent model training.

[0731] Similarly, the sample condition part can also be pre-annotated with the probability of using the fourth sample of each sample header to represent the content, and then the loss value between the pre-annotated sample condition part using the fourth sample probability of using each sample header to represent the content and the sample condition part using the fourth sample probability of using each sample header to represent the content obtained in the above step can be determined for subsequent model training.

[0732] S907, training the multi-task model according to the loss value, and stopping the model training when the loss value meets the convergence condition to obtain a pre-trained multi-task model.

[0733] In an embodiment of the present application, after the above steps, multiple loss values ​​can be obtained, so that the multi-task model can be trained according to these loss values, and when the loss value meets the convergence condition, the model training is stopped to obtain a pre-trained multi-task model.

[0734] Among them, multiple loss values ​​can be weighted and summed to obtain a final loss value, and the multi-task model can be trained according to the final loss value. When the final loss value is less than a preset threshold, the model training is stopped to obtain a pre-trained multi-task model.

[0735] Corresponding to the above method embodiment, the present application embodiment also provides a programming statement generating device, such as Fig.16 As shown, the device may include: a table acquisition module 1610, a statement acquisition module 1620, a content determination module 1630, a part generation module 1640, a part splicing module 1650, and a sentence generation module 1660.

[0736] The table acquisition module 1610 is used to acquire a target table;

[0737] The expression acquisition module 1620 is used to acquire the target requirement expression corresponding to the target table;

[0738] A content determination module 1630, configured to determine the target table content in the target table;

[0739] A part generation module 1640 is used to generate a sub-component of any initial component of the initial programming statement according to the target requirement statement and the target table content;

[0740] A partial splicing module 1650 is used to splice the subcomponents of the initial component to obtain a target component;

[0741] The statement generation module 1660 is used to generate a target programming statement from each of the target components of the initial programming statement.

[0742] In an optional implementation, the content determination module is specifically configured to:

[0743] Determine a target header in the target table, and for any header cell in the target header, obtain the header content filled in the header cell;

[0744] Determine the remaining cells in the column where the header cell is located except the header cell;

[0745] Select a target cell from the remaining cells, and obtain the cell content filled in the target cell;

[0746] Combine the header content with the cell content to obtain the header representation content corresponding to the header cell;

[0747] All the header representation contents are determined as target table contents in the target table.

[0748] In an optional implementation, the part generation module specifically includes:

[0749] The expression and content input submodule is used to input the target requirement expression and all the header representation contents into the pre-trained multi-task model, and the pre-trained multi-task model performs the following processing:

[0750] The expression and content splicing submodule is used to splice the target demand expression and all the header representation contents according to the custom mark and sequence mark to obtain the splicing result;

[0751] A content processing module, used for performing vectorization processing on any component content in the splicing result to obtain an embedding vector corresponding to the component content;

[0752] The composition content includes one of the following: the custom mark, the sequence mark, each character in the target requirement statement, and each character in the header representation content;

[0753] The part generation submodule is used to generate a sub-component of any initial component of the initial programming statement according to the embedding vector corresponding to the corresponding component content in the splicing result.

[0754] In an optional implementation, the expression and content splicing submodule is specifically used for:

[0755] According to the custom flag and the sequence flag, the target demand expression is spliced ​​to obtain a first expression splicing result;

[0756] The custom mark is located at the beginning of the first expression splicing result, and the sequence mark is located at the end of the first expression splicing result;

[0757] For any of the header representation contents, splicing the header representation contents according to the sequence mark to obtain a second content splicing result;

[0758] Wherein, the sequence mark is located at the end of the second content splicing result;

[0759] The first expression splicing result and all the second content splicing results are sequentially spliced ​​to obtain a splicing result.

[0760] In an optional implementation, when the initial component is an initial restricted portion, the portion generating submodule is specifically configured to:

[0761] Searching for the embedding vector corresponding to the custom logo from the embedding vectors corresponding to the component contents of the splicing result;

[0762] Classify the embedding vector corresponding to the custom mark to obtain the restriction probability of each restriction quantity corresponding to the initial restriction part;

[0763] Selecting the maximum restriction probability, and determining the restriction quantity corresponding to the maximum restriction probability;

[0764] Determine the restriction quantity corresponding to the maximum restriction probability as a subcomponent of the initial restriction part;

[0765] The partial splicing modules are specifically used for:

[0766] The restriction quantity corresponding to the maximum restriction probability is concatenated with the sign of the initial restriction part to obtain the target restriction part.

[0767] In an optional embodiment, when the initial component is the remaining part except the initial restricted part, the part generation submodule specifically includes:

[0768] The content processing unit is used to perform the following processing on any of the header representation contents to obtain a column representation embedding vector corresponding to the header representation content:

[0769] A vector search unit, used to search the embedding vector corresponding to each character in the header representation content and the embedding vector corresponding to the sequence mark spliced ​​with the header representation content from the embedding vectors corresponding to the component contents of the splicing result;

[0770] A vector processing unit, configured to perform self-attention mechanism processing on the embedding vector corresponding to the custom logo, the embedding vector corresponding to each character in the header representation content, and the embedding vector corresponding to the sequence logo spliced ​​with the header representation content to obtain a processing result;

[0771] A vector adding unit, configured to add the embedding vector corresponding to the custom flag to the processing result to obtain a column representation embedding vector corresponding to the header representation content;

[0772] The part generating unit is used to generate a sub-component of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any of the header representation contents.

[0773] In an optional implementation, when the initial component is an initial selected part, the part generating unit specifically includes:

[0774] A first vector classification subunit is used to classify the embedding vector corresponding to the custom mark to obtain a first column probability of each column quantity corresponding to the initial selection part;

[0775] a column quantity determination subunit, configured to select the largest first column probability and determine the column quantity corresponding to the largest first column probability;

[0776] A second vector classification subunit is used to classify the column representation embedding vectors corresponding to all the header representation contents to obtain a first usage probability of each of the header representation contents used by the initial selection part;

[0777] a probability sorting subunit, configured to sort the first usage probabilities and select the top N first usage probabilities, where N is the number of columns corresponding to the largest first column probability;

[0778] The part generating subunit is used to generate subcomponents of the initial selected part according to the first usage probabilities of the top N names.

[0779] In an optional implementation, the part generation subunit is specifically used for:

[0780] Determine N header representation contents corresponding to the top N first usage probabilities, and obtain N header contents from the N header representation contents;

[0781] Determine N of the header contents as the first subcomponent of the initial selected part;

[0782] Classify the column representation embedding vectors corresponding to the N header representation contents to obtain first inter-column probabilities of each inter-column operation corresponding to the initial selected part and aggregation probabilities of each aggregation operation;

[0783] Selecting the largest first inter-column probability, and determining the inter-column operation corresponding to the largest first inter-column probability;

[0784] Selecting the maximum aggregation probability, and determining the aggregation operation corresponding to the maximum aggregation probability;

[0785] Determine the inter-column operation corresponding to the largest first inter-column probability as a second subcomponent of the initial selection part;

[0786] Determine the aggregation operation corresponding to the maximum aggregation probability as the third subcomponent of the initial selection part;

[0787] The partial splicing module is specifically used for:

[0788] Using the inter-column operation corresponding to the largest first inter-column probability, concatenate the N header contents to obtain a first selected concatenation result;

[0789] Splicing the aggregation operation corresponding to the maximum aggregation probability with the first selection splicing result to obtain a second selection splicing result;

[0790] The second selection splicing result is spliced ​​with the mark of the initial selection part to obtain the target selection part.

[0791] In an optional implementation, when the initial component is an initial grouping part, the part generating unit specifically includes:

[0792] A first vector classification subunit is used to classify the embedding vector corresponding to the custom mark to obtain second column probabilities of the number of columns corresponding to the initial grouping part;

[0793] a column quantity determination subunit, configured to select the largest second column probability and determine the column quantity corresponding to the largest second column probability;

[0794] A second vector classification subunit is used to classify the column representation embedding vectors corresponding to all the header representation contents to obtain a second usage probability of each of the header representation contents being used in the initial grouping part;

[0795] a probability sorting subunit, configured to sort the second usage probabilities and select the top M second usage probabilities, where M is the number of columns corresponding to the largest second column probability;

[0796] The part generating subunit is used to generate the subcomponents of the initial grouping part according to the second usage probabilities of the top M names.

[0797] In an optional implementation, the part generation subunit is specifically used for:

[0798] Determine M of the header representation contents corresponding to the top M second usage probabilities, and obtain M header contents from the M header representation contents;

[0799] Determining M header contents as subcomponents of the initial grouping part;

[0800] The partial splicing modules are specifically used for:

[0801] The M header contents are concatenated with the flag corresponding to the initial grouping part to obtain the target grouping part.

[0802] In an optional implementation, when the initial component is an initial ascending and descending order part, the part generating unit specifically includes:

[0803] A first vector classification subunit is used to classify the embedding vector corresponding to the custom mark to obtain the third column probability of each column quantity corresponding to the initial ascending and descending order part, and the ascending and descending order probability of each ascending and descending order operation;

[0804] a column quantity determination subunit, configured to select the largest third column probability and determine the column quantity corresponding to the largest third column probability;

[0805] An ascending and descending order operation determination subunit, used for selecting the largest ascending and descending order probability, and determining the ascending and descending order operation corresponding to the largest ascending and descending order probability;

[0806] A second vector classification unit is used to classify the column representation embedding vectors corresponding to all the header representation contents to obtain a third usage probability of each of the header representation contents being used in the initial ascending and descending order parts;

[0807] a probability sorting subunit, used to sort the third usage probabilities and select the top O third usage probabilities, where O is the number of columns corresponding to the largest third column probability;

[0808] The part generating subunit is used to generate the subcomponents of the initial ascending and descending order part according to the ascending and descending order operation corresponding to the third usage probability of the top 0 and the largest ascending and descending order probability.

[0809] In an optional implementation, the part generation subunit is specifically used for:

[0810] Determine O header representation contents corresponding to the top O third usage probabilities;

[0811] Classify the column representation embedding vectors corresponding to the O header representation contents to obtain second inter-column probabilities of inter-column operations corresponding to the initial ascending and descending order parts;

[0812] Selecting the largest second inter-column probability, and determining the inter-column operation corresponding to the largest second inter-column probability;

[0813] Obtain O header contents from the O header representation contents, and determine the O header contents as the first subcomponent of the initial ascending and descending order part;

[0814] Determine the ascending and descending operation corresponding to the largest ascending and descending probability as the second subcomponent of the initial ascending and descending part;

[0815] Determine the inter-column operation corresponding to the largest second inter-column probability as the third sub-component of the initial ascending and descending order part;

[0816] The partial splicing module is specifically used for:

[0817] Using the inter-column operation corresponding to the second inter-column probability with the largest value, concatenate the contents of the O headers to obtain a first ascending and descending order concatenation result;

[0818] Splicing the ascending and descending order operation corresponding to the largest ascending and descending order probability with the first ascending and descending order splicing result to obtain a second ascending and descending order splicing result;

[0819] The second ascending and descending sequence splicing result is spliced ​​with the mark of the initial ascending and descending sequence part to obtain the target ascending and descending sequence part.

[0820] In an optional implementation, when the initial component is an initial condition part, the part generation unit specifically includes:

[0821] A first vector classification subunit is used to classify the embedding vector corresponding to the custom mark to obtain the number probability of each condition number corresponding to the initial condition part and the relationship probability of each condition relationship;

[0822] A condition number determination subunit, used for selecting the maximum number probability and determining the condition number corresponding to the maximum number probability;

[0823] A conditional relationship determination subunit, used for selecting the maximum relationship probability and determining the conditional relationship corresponding to the maximum relationship probability;

[0824] A vector search subunit, used to search the embedding vector corresponding to each character in the target requirement expression from the embedding vectors corresponding to the component contents of the splicing result;

[0825] A second vector classification subunit is used to classify the embedded vector corresponding to each character in the target requirement expression to obtain a condition value flag corresponding to each character in the target requirement expression;

[0826] A character selection module, used for selecting a target character from the target requirement expression, wherein the conditional value flag of the target character is a preset value;

[0827] A character composition subunit, used for composing M conditional values ​​from the target character, wherein M is the number of conditions corresponding to the maximum probability of the number;

[0828] The part generating subunit is used to generate the subcomponent of the initial condition part according to the M condition values, the conditional relationship corresponding to the maximum relationship probability and the column representation embedding vector corresponding to any one of the header representation contents.

[0829] In an optional implementation, the part generation subunit is specifically used for:

[0830] For any of the conditional values, matching the embedding vector corresponding to the target character constituting the conditional value with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content matched by the conditional value;

[0831] Determine the condition value and the header content in the header representation content that matches the condition value as the first subcomponent of the initial condition part;

[0832] For any of the conditional values, classify the embedding vectors corresponding to the target characters constituting the conditional value and the column representation embedding vectors corresponding to the header representation content matched by the conditional value to obtain the logical probabilities of the logical operations corresponding to the conditional value;

[0833] Select the largest logical probability, and determine the logical operation corresponding to the largest logical probability;

[0834] Determine the logic operation corresponding to the largest logic probability as the second subcomponent of the initial condition part;

[0835] Determine the conditional relationship corresponding to the maximum relationship probability as the third subcomponent of the initial condition part;

[0836] The partial splicing modules are specifically used for:

[0837] For any of the conditional values, using the logical operation corresponding to the maximum logical probability corresponding to the conditional value, the conditional value is spliced ​​with the header content in the header representation content that matches the conditional value to obtain a first conditional splicing result;

[0838] Using the conditional relationship corresponding to the largest relationship probability, all the first conditional splicing results are spliced ​​to obtain a second conditional splicing result;

[0839] The second condition concatenation result is concatenated with the flag of the initial condition part to obtain the target condition part.

[0840] In an optional implementation, the part generation subunit is specifically used for:

[0841] Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a fourth usage probability of each of the header representation contents being used in the initial condition part;

[0842] According to the fourth usage probability, the embedding vector corresponding to the target character constituting the conditional value is matched with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content that matches the conditional value.

[0843] In an optional embodiment, the device further comprises:

[0844] A table and expression acquisition module, used to acquire a sample table and a sample requirement expression corresponding to the sample table;

[0845] A representation content determination module, used to determine the representation content of all sample headers in the sample table;

[0846] The expression and content input module is used to input the sample requirement expression and all the sample header representation contents into the multi-task model, and the multi-task model performs the following processing:

[0847] A statement and content splicing module, used to splice the sample requirement statement and all sample header representation contents according to a custom mark and a sequence mark to obtain a sample splicing result;

[0848] A component content processing module, used for performing vectorization processing on any sample component content in the sample splicing result to obtain a sample embedding vector corresponding to the sample component content;

[0849] The sample composition content includes one of the following: the custom mark, the sequence mark, each character in the sample requirement statement, and each character in the sample header representation content;

[0850] a partial prediction module, for predicting, for any sample component of the sample programming statement, a predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result;

[0851] a loss value determination module, used to determine a loss value between a predicted subcomponent of the sample component and a sample subcomponent of the sample component;

[0852] The model training module is used to perform model training on the multi-task model according to the loss value, and stop the model training when the loss value meets the convergence condition to obtain a pre-trained multi-task model.

[0853] In an optional implementation, the representation content determination module is specifically used to:

[0854] Determine a sample header in the sample table, and for any sample header cell in the sample header, obtain the sample header content filled in the sample header cell;

[0855] Determine the remaining sample cells in the column where the sample table header cell is located except the sample table header cell;

[0856] Select a target sample cell from the remaining sample cells, and obtain the sample cell content filled in the target sample cell;

[0857] The sample header content is combined with the sample cell content to obtain the sample header representation content corresponding to the sample header cell.

[0858] In an optional implementation, the expression and content splicing module is specifically used for:

[0859] splicing the sample requirement expressions according to the custom flag and the sequence flag to obtain a first sample expression splicing result;

[0860] The custom mark is located at the start position of the splicing result of the first sample representation, and the sequence mark is located at the end position of the splicing result of the first sample representation;

[0861] For any of the sample header representation contents, splicing the sample header representation contents according to the sequence mark to obtain a second sample content splicing result;

[0862] The sequence mark is located at the end of the concatenated result of the second sample content;

[0863] The first sample expression splicing result and all the second sample content splicing results are sequentially spliced ​​to obtain a sample splicing result.

[0864] In an optional implementation, when the sample component is a sample restriction portion, the partial prediction module is specifically configured to:

[0865] Searching for the sample embedding vector corresponding to the custom logo from the sample embedding vectors corresponding to the sample component contents of the sample splicing result;

[0866] Classify the sample embedding vector corresponding to the custom mark to obtain the sample restriction probability of each sample restriction quantity corresponding to the sample restriction part;

[0867] Selecting the maximum sample restriction probability, and determining the sample restriction quantity corresponding to the maximum sample restriction probability;

[0868] The sample restriction quantity corresponding to the maximum sample restriction probability is determined as the prediction subcomponent of the sample restriction part.

[0869] In an optional implementation, when the sample component is the remaining sample part except the sample restriction part, the part prediction module specifically includes:

[0870] The representation content processing submodule is used to perform the following processing on any of the sample header representation contents to obtain a sample column representation embedding vector corresponding to the sample header representation content:

[0871] A vector search submodule, used to search the sample embedding vector corresponding to each character in the sample header representation content and the sample embedding vector corresponding to the sequence mark spliced ​​with the sample header representation content from the sample embedding vector corresponding to the sample composition content of the sample splicing result;

[0872] A vector processing submodule, used to perform self-attention mechanism processing on the sample embedding vector corresponding to the custom logo, the sample embedding vector corresponding to each character in the sample header representation content, and the sample embedding vector corresponding to the sequence logo spliced ​​with the sample header representation content, to obtain a sample processing result;

[0873] A vector addition submodule, configured to add the sample embedding vector corresponding to the custom flag to the sample processing result to obtain a sample column representation embedding vector corresponding to the sample header representation content;

[0874] The partial prediction submodule is used to predict the predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result and the sample column representation embedding vector corresponding to any sample header representation content.

[0875] In an optional implementation, when the sample component is a sample selection part, the part prediction submodule specifically includes:

[0876] A first vector classification unit, configured to classify the sample embedding vector corresponding to the custom mark to obtain a first sample column probability of each sample column quantity corresponding to the sample selection part;

[0877] a column quantity determination unit, configured to select the largest probability of the first sample column, and determine the number of sample columns corresponding to the largest probability of the first sample column;

[0878] A second vector classification unit is used to classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a first sample usage probability of each sample header representation content used by the sample selection part;

[0879] a probability sorting unit, configured to sort the first sample usage probabilities and select the top N first sample usage probabilities, where N is the number of sample columns corresponding to the largest first sample column probability;

[0880] The part prediction unit is used to predict the prediction subcomponent of the sample selection part according to the usage probabilities of the first samples in the top N.

[0881] In an optional implementation, the partial prediction unit is specifically used for:

[0882] Determine N sample header representation contents corresponding to the top N first sample usage probabilities, and obtain N sample header contents from the N sample header representation contents;

[0883] Determining N sample header contents as the first prediction subcomponent of the sample selection part;

[0884] Classify the sample column representation embedding vectors corresponding to the N sample header representation contents to obtain a first sample column probability of each sample column operation corresponding to the sample selection part and a sample aggregation probability of each sample aggregation operation;

[0885] Selecting the largest first inter-sample column probability, and determining the inter-sample column operation corresponding to the largest first inter-sample column probability;

[0886] Selecting the largest sample aggregation probability, and determining the sample aggregation operation corresponding to the largest sample aggregation probability;

[0887] Determine the sample column operation corresponding to the largest first sample column probability as the second prediction subcomponent of the sample selection part;

[0888] The sample aggregation operation corresponding to the maximum sample aggregation probability is determined as the third prediction subcomponent of the sample selection part.

[0889] In an optional implementation, when the sample component is a sample grouping part, the part prediction submodule specifically includes:

[0890] A first vector classification unit is used to classify the sample embedding vector corresponding to the custom mark to obtain a second sample column probability of each sample column quantity corresponding to the sample grouping part;

[0891] a column quantity determination unit, configured to select the largest probability of the second sample column, and determine the number of sample columns corresponding to the largest probability of the second sample column;

[0892] A second vector classification unit is used to classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a second sample usage probability of each sample header representation content used by the sample grouping part;

[0893] a probability sorting unit, configured to sort the second sample usage probabilities and select the top M second sample usage probabilities, where M is the number of sample columns corresponding to the largest second sample column probability;

[0894] The partial prediction unit is used to generate a prediction sub-component of the sample grouping part according to the usage probabilities of the second samples in the top M.

[0895] In an optional implementation, the partial prediction unit specifically includes:

[0896] Determine M sample header representation contents corresponding to the top M second sample usage probabilities, and obtain M sample header contents from the M sample header representation contents;

[0897] The M sample header contents are determined as predicted subcomponents of the sample grouping part.

[0898] In an optional implementation, when the sample component is a sample ascending and descending order portion, the part prediction submodule specifically includes:

[0899] A first vector classification unit is used to classify the sample embedding vector corresponding to the custom mark to obtain a third sample column probability of each sample column quantity corresponding to the sample ascending and descending order part, and a sample ascending and descending order probability of each sample ascending and descending order operation;

[0900] a column quantity determination unit, configured to select the largest third sample column probability, and determine the number of sample columns corresponding to the largest third sample column probability;

[0901] An ascending and descending order determination unit, used for selecting the largest ascending and descending order probability of the sample, and determining the sample ascending and descending order operation corresponding to the largest ascending and descending order probability of the sample;

[0902] A second vector classification unit is used to classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a third sample usage probability of each sample header representation content being used in the sample ascending and descending order parts;

[0903] A probability sorting unit, used to sort the third sample usage probabilities and select the top O third sample usage probabilities, where O is the number of sample columns corresponding to the largest third sample column probability;

[0904] The partial prediction unit is used to generate a prediction subcomponent of the sample ascending and descending part according to the sample ascending and descending operation corresponding to the third sample usage probability of the top 0 and the maximum sample ascending and descending probability.

[0905] In an optional implementation, the partial prediction unit specifically includes:

[0906] Determine the representation contents of the O sample headers corresponding to the usage probabilities of the top O third samples;

[0907] Classify the sample column representation embedding vectors corresponding to the O sample header representation contents to obtain a second sample column probability of the inter-sample column operation corresponding to the sample ascending and descending order parts;

[0908] Selecting the largest second sample inter-column probability, and determining the sample inter-column operation corresponding to the largest second sample inter-column probability;

[0909] Obtain O sample header contents from the O sample header representation contents, and determine the O sample header contents as the first predicted subcomponent of the sample ascending and descending order part;

[0910] Determine the sample ascending and descending operation corresponding to the largest sample ascending and descending probability as the second prediction subcomponent of the sample ascending and descending part;

[0911] The sample-column operation corresponding to the largest second sample-column probability is determined as the third prediction subcomponent of the sample ascending and descending order part.

[0912] In an optional implementation, when the sample component is a sample condition part, the part prediction submodule specifically includes:

[0913] A first vector classification unit, configured to classify the sample embedding vector corresponding to the custom mark, and obtain a sample number probability of each sample condition number corresponding to the sample condition part, and a sample relationship probability of each sample condition relationship;

[0914] A condition number determination unit, used for selecting the maximum sample number probability and determining the sample condition number corresponding to the maximum sample number probability;

[0915] A conditional relationship determination unit, used for selecting the maximum sample relationship probability and determining the sample conditional relationship corresponding to the maximum sample relationship probability;

[0916] A vector search unit, used to search for a sample embedding vector corresponding to each character in the sample requirement statement from the sample embedding vector corresponding to the sample component content of the sample splicing result;

[0917] A second vector classification unit is used to classify the sample embedding vector corresponding to each character in the sample requirement expression to obtain a sample condition value flag corresponding to each character in the sample requirement expression;

[0918] A character selection unit, used for selecting a sample character from the sample requirement statement, wherein the sample condition value flag of the sample character is a preset value;

[0919] A character composition unit, used for composing M sample condition values ​​from the sample characters, wherein M is the number of sample conditions corresponding to the maximum probability of the number of samples;

[0920] The partial prediction unit is used to generate a prediction subcomponent of the sample condition part according to the M sample condition values, the sample condition relationship corresponding to the maximum sample relationship probability, and the sample column representation embedding vector corresponding to any sample header representation content.

[0921] In an optional implementation, the partial prediction unit is specifically used for:

[0922] For any of the sample condition values, matching the sample embedding vector corresponding to the sample characters constituting the sample condition value with the sample column representation embedding vector corresponding to any of the sample header representation contents to obtain the sample header representation contents matched by the sample condition value;

[0923] Determine the sample condition value and the sample header content in the sample header representation content that matches the sample condition value as a first prediction subcomponent of the sample condition part;

[0924] For any of the sample condition values, classify the sample embedding vectors corresponding to the sample characters constituting the sample condition value and the sample column representation embedding vectors corresponding to the sample header representation content matched by the sample condition value to obtain sample logical probabilities of each sample logical operation corresponding to the sample condition value;

[0925] Select the largest sample logical probability, and determine the sample logical operation corresponding to the largest sample logical probability;

[0926] Determine the sample logic operation corresponding to the maximum sample logic probability as the second prediction subcomponent of the sample condition part;

[0927] The sample condition relationship corresponding to the maximum sample relationship probability is determined as the third prediction subcomponent of the sample condition part.

[0928] In an optional implementation, the partial prediction unit is specifically used for:

[0929] Classify the sample column representation embedding vectors corresponding to all the sample header representation contents to obtain a fourth sample usage probability of each sample header representation content used in the sample conditional part;

[0930] According to the fourth sample usage probability, the sample embedding vector corresponding to the sample characters constituting the sample condition value is matched with the sample column representation embedding vector corresponding to any of the sample header representation contents to obtain the sample header representation content that matches the sample condition value.

[0931] The present application also provides an electronic device, such as Fig.17 As shown, it includes a processor 171, a communication interface 172, a memory 173 and a communication bus 174, wherein the processor 171, the communication interface 172, and the memory 173 communicate with each other through the communication bus 174.

[0932] Memory 173, for storing computer programs;

[0933] The processor 171 is used to execute the program stored in the memory 173 to implement the following steps:

[0934] Obtain a target table and a target requirement statement corresponding to the target table, and determine the target table content in the target table; for any initial component of the initial programming statement, generate subcomponents of the initial component according to the target requirement statement and the target table content; splice the subcomponents of the initial component to obtain the target component; generate the target programming statement from each of the target components of the initial programming statement.

[0935] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0936] The communication interface is used for communication between the above electronic device and other devices.

[0937] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0938] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0939] In another embodiment provided in the present application, a storage medium is also provided, in which instructions are stored. When the storage medium is run on a computer, the computer executes the programming statement generation method described in any one of the above embodiments.

[0940] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the programming statement generation method described in any one of the above embodiments.

[0941] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part 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, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a storage medium or transmitted from one storage medium to another storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0942] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0943] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0944] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A method for generating programming statements, characterized in that: The method comprises: Obtain a target table and a target requirement expression corresponding to the target table, and determine the target table content in the target table, including: determining a target header in the target table, and for any header cell in the target header, obtaining the header content filled in the header cell; determining the remaining cells in the column where the header cell is located except the header cell; selecting a target cell from the remaining cells, and obtaining the cell content filled in the target cell; combining the header content with the cell content to obtain the header representation content corresponding to the header cell; determining all the header representation contents as the target table content in the target table; For any initial component of the initial programming statement, a sub-component of the initial component is generated according to the target requirement statement and the target table content, including: inputting the target requirement statement and all the header representation contents into a pre-trained multi-task model, and the pre-trained multi-task model performs the following processing: splicing the target requirement statement and all the header representation contents according to a custom flag and a sequence flag to obtain a splicing result; for any component content in the splicing result, vectorizing the component content to obtain an embedding vector corresponding to the component content; wherein the component content includes one of the following: the custom flag, the sequence flag, each character in the target requirement statement, and each character in the header representation content; for any initial component of the initial programming statement, a sub-component of the initial component is generated according to the embedding vector corresponding to the corresponding component content in the splicing result; In the case where the initial component is the initial restricted part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result includes: searching for the embedding vector corresponding to the custom mark from the embedding vector corresponding to the component content of the splicing result; classifying the embedding vector corresponding to the custom mark to obtain the restriction probability of each restriction quantity corresponding to the initial restricted part; selecting the maximum restriction probability and determining the restriction quantity corresponding to the maximum restriction probability; determining the restriction quantity corresponding to the maximum restriction probability as the subcomponent of the initial restricted part; Alternatively, in the case where the initial component is the remaining part except the initial restricted part, the sub-components of the initial component are generated according to the embedding vector corresponding to the corresponding component content in the splicing result, including: for any of the header representation contents, the following processing is performed to obtain the column representation embedding vector corresponding to the header representation content: from the embedding vector corresponding to the component content of the splicing result, the embedding vector corresponding to each character in the header representation content and the embedding vector corresponding to the sequence mark spliced ​​with the header representation content are searched; the embedding vector corresponding to the custom mark, the embedding vector corresponding to each character in the header representation content, and the embedding vector corresponding to the sequence mark spliced ​​with the header representation content are processed by a self-attention mechanism to obtain a processing result; the embedding vector corresponding to the custom mark is added to the processing result to obtain the column representation embedding vector corresponding to the header representation content; the sub-components of the initial component are generated according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any of the header representation contents; splicing the subcomponents of the initial component to obtain a target component; A target programming statement is generated from each of the target components corresponding to the initial programming statement.

2. The method according to claim 1, characterized in that: The target requirement statement and all the header representation contents are spliced ​​according to the custom flag and the sequence flag to obtain a splicing result, including: According to the custom flag and the sequence flag, the target demand expression is spliced ​​to obtain a first expression splicing result; The custom mark is located at the beginning of the first expression splicing result, and the sequence mark is located at the end of the first expression splicing result; For any of the header representation contents, splicing the header representation contents according to the sequence mark to obtain a second content splicing result; Wherein, the sequence mark is located at the end of the second content splicing result; The first expression splicing result and all the second content splicing results are sequentially spliced ​​to obtain a splicing result.

3. The method according to claim 1, characterized in that The step of splicing the subcomponents of the initial component to obtain the target component includes: The restriction quantity corresponding to the maximum restriction probability is concatenated with the sign of the initial restriction part to obtain the target restriction part.

4. The method according to claim 1, characterized in that: In the case where the initial component is an initial selected part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any header representation content includes: Classify the embedding vector corresponding to the custom mark to obtain the first column probability of each column quantity corresponding to the initial selection part; Selecting the largest probability of the first column, and determining the number of columns corresponding to the largest probability of the first column; Classifying the column representation embedding vectors corresponding to all the header representation contents to obtain a first usage probability of each of the header representation contents being used by the initial selection part; Sorting the first usage probabilities and selecting top N first usage probabilities, where N is the number of columns corresponding to the largest first column probability; The subcomponents of the initial selection part are generated according to the first usage probabilities of the top N.

5. The method according to claim 4, characterized in that The step of generating subcomponents of the initial selection part according to the first usage probabilities of the top N names includes: Determine N header representation contents corresponding to the top N first usage probabilities, and obtain N header contents from the N header representation contents; Determine N of the header contents as the first subcomponent of the initial selected part; Classify the column representation embedding vectors corresponding to the N header representation contents to obtain first inter-column probabilities of each inter-column operation corresponding to the initial selected part and aggregation probabilities of each aggregation operation; Selecting the largest first inter-column probability, and determining the inter-column operation corresponding to the largest first inter-column probability; Selecting the maximum aggregation probability, and determining the aggregation operation corresponding to the maximum aggregation probability; Determine the inter-column operation corresponding to the largest first inter-column probability as a second subcomponent of the initial selection part; Determine the aggregation operation corresponding to the maximum aggregation probability as the third subcomponent of the initial selection part; The step of splicing the subcomponents of the initial component to obtain the target component includes: Using the inter-column operation corresponding to the largest first inter-column probability, concatenate the N header contents to obtain a first selected concatenation result; Splicing the aggregation operation corresponding to the maximum aggregation probability with the first selection splicing result to obtain a second selection splicing result; The second selection splicing result is spliced ​​with the mark of the initial selection part to obtain the target selection part.

6. The method according to claim 1, characterized in that In the case where the initial component is an initial grouping part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any header representation content includes: Classify the embedding vector corresponding to the custom mark to obtain second column probabilities of the number of columns corresponding to the initial grouping part; Selecting the largest probability of the second column, and determining the number of columns corresponding to the largest probability of the second column; Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a second usage probability of each header representation content being used by the initial grouping part; Sort the second usage probabilities and select the top M second usage probabilities, where M is the number of columns corresponding to the largest second column probability; The sub-components of the initial grouping part are generated according to the second usage probabilities of the top M names.

7. The method according to claim 6, characterized in that The step of generating subcomponents of the initial grouping part according to the second usage probabilities of the top M names includes: Determine M of the header representation contents corresponding to the top M second usage probabilities, and obtain M header contents from the M header representation contents; Determining M header contents as subcomponents of the initial grouping part; The step of splicing the subcomponents of the initial component to obtain the target component includes: The M header contents are concatenated with the flag corresponding to the initial grouping part to obtain the target grouping part.

8. The method according to claim 1, characterized in that In the case where the initial component is an initial ascending and descending order part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any header representation content includes: Classify the embedding vector corresponding to the custom mark to obtain the third column probability of each column quantity corresponding to the initial ascending and descending order part, and the ascending and descending order probability of each ascending and descending order operation; Select the largest third column probability, and determine the number of columns corresponding to the largest third column probability; Select the largest ascending and descending probability, and determine the ascending and descending operation corresponding to the largest ascending and descending probability; Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a third usage probability of each of the header representation contents being used in the initial ascending and descending order parts; Sorting the third usage probabilities and selecting the top 0 third usage probabilities, where 0 is the number of columns corresponding to the largest third column probability; The sub-components of the initial ascending and descending order part are generated according to the ascending and descending order operations corresponding to the third usage probabilities of the top 0 and the largest ascending and descending order probabilities.

9. The method according to claim 8, characterized in that The generating of the sub-components of the initial ascending and descending order part according to the ascending and descending order operation corresponding to the third usage probability of the top 0 and the maximum ascending and descending order probability comprises: Determine O header representation contents corresponding to the top O third usage probabilities; Classify the column representation embedding vectors corresponding to the O header representation contents to obtain second inter-column probabilities of inter-column operations corresponding to the initial ascending and descending order parts; Selecting the largest second inter-column probability, and determining the inter-column operation corresponding to the largest second inter-column probability; Obtain O header contents from the O header representation contents, and determine the O header contents as the first subcomponent of the initial ascending and descending order part; Determine the ascending and descending operation corresponding to the largest ascending and descending probability as the second subcomponent of the initial ascending and descending part; Determine the inter-column operation corresponding to the largest second inter-column probability as the third sub-component of the initial ascending and descending order part; The step of splicing the subcomponents of the initial component to obtain the target component includes: Using the inter-column operation corresponding to the second inter-column probability with the largest value, concatenate the contents of the O headers to obtain a first ascending and descending order concatenation result; Splicing the ascending and descending order operation corresponding to the largest ascending and descending order probability with the first ascending and descending order splicing result to obtain a second ascending and descending order splicing result; The second ascending and descending sequence splicing result is spliced ​​with the mark of the initial ascending and descending sequence part to obtain the target ascending and descending sequence part.

10. The method according to claim 1, characterized in that In the case where the initial component is an initial condition part, generating a subcomponent of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any header representation content includes: Classify the embedding vector corresponding to the custom mark to obtain the number probability of each condition number corresponding to the initial condition part and the relationship probability of each condition relationship; Selecting the largest probability of the number, and determining the number of conditions corresponding to the largest probability of the number; Select the largest relationship probability, and determine the conditional relationship corresponding to the largest relationship probability; From the embedding vectors corresponding to the component contents of the concatenated result, searching for the embedding vector corresponding to each character in the target requirement statement; Classify the embedding vector corresponding to each character in the target requirement expression to obtain a conditional value flag corresponding to each character in the target requirement expression; Select a target character from the target requirement statement, wherein the conditional value flag of the target character is a preset value; The target characters form M conditional values, where M is the number of conditions corresponding to the maximum probability of the number; Subcomponents of the initial condition part are generated according to the M condition values, the conditional relationship corresponding to the maximum relationship probability, and the column representation embedding vector corresponding to any of the header representation contents.

11. The method according to claim 10, characterized in that The generating subcomponents of the initial condition part according to the M condition values, the conditional relationship corresponding to the maximum relationship probability, and the column representation embedding vector corresponding to any of the header representation contents, comprises: For any of the conditional values, matching the embedding vector corresponding to the target character constituting the conditional value with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content matched by the conditional value; Determine the condition value and the header content in the header representation content that matches the condition value as the first subcomponent of the initial condition part; For any of the conditional values, classify the embedding vectors corresponding to the target characters constituting the conditional value and the column representation embedding vectors corresponding to the header representation content matched by the conditional value to obtain the logical probabilities of the logical operations corresponding to the conditional value; Select the largest logical probability, and determine the logical operation corresponding to the largest logical probability; Determine the logic operation corresponding to the largest logic probability as the second subcomponent of the initial condition part; Determine the conditional relationship corresponding to the maximum relationship probability as the third subcomponent of the initial condition part; The step of splicing the subcomponents of the initial component to obtain the target component includes: For any of the conditional values, using the logical operation corresponding to the maximum logical probability corresponding to the conditional value, the conditional value is spliced ​​with the header content in the header representation content that matches the conditional value to obtain a first conditional splicing result; Using the conditional relationship corresponding to the largest relationship probability, all the first conditional splicing results are spliced ​​to obtain a second conditional splicing result; The second condition concatenation result is concatenated with the flag of the initial condition part to obtain the target condition part.

12. The method according to claim 11, characterized in that The step of matching the embedding vector corresponding to the target character constituting the conditional value with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content matched by the conditional value includes: Classify the column representation embedding vectors corresponding to all the header representation contents to obtain a fourth usage probability of each of the header representation contents being used in the initial condition part; According to the fourth usage probability, the embedding vector corresponding to the target character constituting the conditional value is matched with the column representation embedding vector corresponding to any of the header representation contents to obtain the header representation content that matches the conditional value.

13. The method according to claim 1, characterized in that Before executing the method, the method further includes: Obtain a sample form and a sample requirement statement corresponding to the sample form, and determine all sample header representation contents in the sample form; The sample requirement statement and all sample header representation contents are input into the multi-task model, and the multi-task model performs the following processing: According to the custom flag and the sequence flag, the sample requirement statement and all the sample header representation contents are spliced ​​to obtain a sample splicing result; For any sample component content in the sample splicing result, vectorize the sample component content to obtain a sample embedding vector corresponding to the sample component content; The sample composition content includes one of the following: the custom mark, the sequence mark, each character in the sample requirement statement, and each character in the sample header representation content; For any sample component of the sample programming statement, predict a predicted subcomponent of the sample component according to the sample embedding vector corresponding to the corresponding sample component content in the sample splicing result; determining a loss value between a predicted subcomponent of the sample component and a sample subcomponent of the sample component; The multi-task model is trained according to the loss value, and when the loss value satisfies a convergence condition, the model training is stopped to obtain a pre-trained multi-task model.

14. A programming statement generating device, characterized in that: The device comprises: Table acquisition module, used to acquire the target table; A statement acquisition module, used to acquire the target requirement statement corresponding to the target table; a content determination module, used to determine the target table content in the target table; The content determination module is specifically used to: determine the target header in the target table, and for any header cell in the target header, obtain the header content filled in the header cell; determine the remaining cells in the column where the header cell is located except the header cell; select the target cell from the remaining cells, and obtain the cell content filled in the target cell; combine the header content with the cell content to obtain the header representation content corresponding to the header cell; determine all the header representation contents as the target table content in the target table; A part generation module, for generating, for any initial component of the initial programming statement, a sub-component of the initial component according to the target requirement statement and the target table content; The partial generation module specifically includes: a statement and content input submodule, which is used to input the target requirement statement and all the header representation contents into a pre-trained multi-task model, and the pre-trained multi-task model performs the following processing: a statement and content splicing submodule, which is used to splice the target requirement statement and all the header representation contents according to a custom flag and a sequence flag to obtain a splicing result; a content processing module, which is used to vectorize the component content for any component content in the splicing result to obtain an embedding vector corresponding to the component content; wherein the component content includes one of the following: the custom flag, the sequence flag, each character in the target requirement statement, and each character in the header representation content; a partial generation submodule, which is used to generate a subcomponent of the initial component for any initial component of the initial programming statement according to the embedding vector corresponding to the corresponding component content in the splicing result; In the case where the initial component is an initial restricted part, the part generation submodule is specifically used to: search for the embedding vector corresponding to the custom mark from the embedding vector corresponding to the component content of the splicing result; classify the embedding vector corresponding to the custom mark to obtain the restriction probability of each restriction quantity corresponding to the initial restricted part; select the maximum restriction probability and determine the restriction quantity corresponding to the maximum restriction probability; determine the restriction quantity corresponding to the maximum restriction probability as a subcomponent of the initial restricted part; Alternatively, in the case where the initial component is the remaining part except the initial restricted part, the part generation submodule specifically includes: a content processing unit, which is used to perform the following processing on any of the header representation contents to obtain the column representation embedding vector corresponding to the header representation content: a vector search unit, which is used to search for the embedding vector corresponding to each character in the header representation content and the embedding vector corresponding to the sequence mark spliced ​​with the header representation content from the embedding vector corresponding to the component content of the splicing result; a vector processing unit, which is used to perform self-attention mechanism processing on the embedding vector corresponding to the custom mark, the embedding vector corresponding to each character in the header representation content, and the embedding vector corresponding to the sequence mark spliced ​​with the header representation content to obtain a processing result; a vector addition unit, which is used to add the embedding vector corresponding to the custom mark to the processing result to obtain the column representation embedding vector corresponding to the header representation content; a part generation unit, which is used to generate a sub-component of the initial component according to the embedding vector corresponding to the corresponding component content in the splicing result and the column representation embedding vector corresponding to any of the header representation contents; A partial splicing module, used for splicing subcomponents of the initial component to obtain a target component; The statement generation module is used to generate a target programming statement from each of the target components corresponding to the initial programming statement.

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, for implementing any of the methods described in claims 1-13 when executing a program stored in a memory.

16. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.