Document processing method and device, equipment and storage medium

By receiving demand descriptions, obtaining structured data, generating prompt words and using AI models to generate target functions in form-based software, the existing technology's problems of user-specific scenario applicability and insufficient task accuracy are solved, and a higher level of accuracy is achieved. Applicability and accuracy.

CN119337828APending Publication Date: 2025-01-21ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310909381.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-21
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

Existing table software cannot be applied in user-specific scenarios, and the accuracy of executing tasks is not high, so it cannot deeply match the task requirements of users' customized inputs.

Method used

By receiving the demand description of the target document, obtain its structured data, generate prompt words, and use the AI ​​model to generate target functions to adapt to the user's specific tasks.

Benefits of technology

It improves the applicability and execution accuracy of the target function in users' specific tasks, and enhances the depth of matching between the data structure and user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337828A_ABST
    Figure CN119337828A_ABST
Patent Text Reader

Abstract

The invention provides a document processing method and device, equipment and a storage medium. The document processing method comprises the steps that demand description used for executing a target task is received for a target document; obtaining structured data of the target document; generating cue words according to the demand description of the target task and the structured data of the target document; and according to the prompt word, generating a target function for executing the target task in the target document. According to the embodiment of the invention, the applicability and the execution accuracy of the generated target function in the specific task link of the user can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a document processing method, apparatus, device and storage medium. Background Art

[0002] With the continuous advancement of technology, artificial intelligence (AI) has been widely used in various industries, such as office application scenarios.

[0003] Take spreadsheet software as an example. As the most frequently used, most in-depth and most user-friendly office software in office application scenarios, the complexity of its usage scenarios is extremely high. The functional design logic within the spreadsheet usually extracts a layer of general logic for a specific scenario and then designs the spreadsheet function. Since the functional design only extracts a layer of similarity based on common attributes, this will result in the designed spreadsheet function being unable to apply to the user's specific scenarios, and the accuracy of task execution is not high. Summary of the invention

[0004] Embodiments of the present disclosure provide a document processing method, apparatus, device, and storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a document processing method is provided, the method comprising:

[0006] Receiving a requirement description for executing a target task with respect to a target document;

[0007] Acquire structured data of the target document;

[0008] Generate prompt words according to the requirement description of the target task and the structured data of the target document;

[0009] According to the prompt word, a target function for executing the target task in the target document is generated.

[0010] In one embodiment, the requirement description includes a natural language requirement description, and generating prompt words according to the requirement description of the target task and the structured data of the target document includes:

[0011] The natural language requirement description and the structured data of the target document are input into a prompting project, and the prompting words obtained by the prompting project through conversion of the natural language requirement description are obtained.

[0012] In one embodiment, obtaining the structured data of the target document includes:

[0013] Acquire metadata of the target document; wherein the metadata includes multiple document elements; the multiple document elements include structural elements and content elements of the target document;

[0014] Extracting a target element from the plurality of document elements;

[0015] According to the target element, structured data of the target document is determined.

[0016] In one embodiment, the natural language requirement description and the structured data of the target document are input into a prompting project, and the prompting words obtained by the prompting project from converting the natural language requirement description include:

[0017] Performing semantic recognition on the natural language requirement description through the prompting project to obtain semantic information of multiple preset requirement items;

[0018] The prompt project converts the semantic information of the plurality of preset demand items based on the scene information obtained by semantically understanding the structured data, thereby obtaining a plurality of prompt data included in the prompt word.

[0019] In one embodiment, the method may further include:

[0020] In response to the lack of target prompt data in the prompt word, prompt information is output; wherein the prompt information is used to prompt the supplementary input of the requirement description of the target task.

[0021] In one embodiment, generating a target function for executing the target task in the target document according to the prompt word includes:

[0022] The prompt word is input into the artificial intelligence AI model to generate the target function.

[0023] In one embodiment, the AI ​​model includes a first module, and the step of inputting the prompt word into the artificial intelligence AI model to generate the target function includes:

[0024] Inputting the prompt word into the first module of the AI ​​model to generate the functional logic of the target function;

[0025] The target function is generated according to a programming statement corresponding to the functional logic of the target function.

[0026] In one embodiment, the AI ​​model further includes a second module, and the method further includes:

[0027] The target function is functionally debugged through the second module of the AI ​​model, and when the debugging result of the functional debugging meets the first preset condition, the debugged target function is output.

[0028] In one embodiment, the requirement description also includes a functional result sample; the step of inputting the prompt word into an artificial intelligence (AI) model to generate the target function includes:

[0029] Input the prompt word and the functional result sample into the AI ​​model to obtain the target function output by the AI ​​model and functional description information of the target function;

[0030] The functional description information of the target function includes functional capability information and / or functional logic introduction of the target function; the functional capability information is used to characterize the logic layer capability used to implement the target function.

[0031] In one embodiment, the method further comprises:

[0032] Obtaining a first execution result of the target function executing the target task;

[0033] Acquire a training label for training the AI ​​model according to feedback data for the first execution result;

[0034] During the training process of the AI ​​model, adjusting the parameters of the prompting project, and inputting the prompting words output by the adjusted prompting project into the AI ​​model to obtain a second execution result of the target function;

[0035] When the loss value determined according to the training label and the second execution result meets the second preset condition, stop training the AI ​​model.

[0036] According to a second aspect of an embodiment of the present disclosure, there is provided a document processing device, the device comprising:

[0037] A receiving module, used for receiving a requirement description of a target task to be executed with respect to a target document;

[0038] An acquisition module, used for acquiring structured data of the target document;

[0039] A first generating module, configured to generate prompt words according to the requirement description of the target task and the structured data of the target document;

[0040] The second generating module is used to generate a target function for executing the target task in the target document according to the prompt word.

[0041] In one embodiment, the requirement description includes a natural language requirement description, and the first generating module is used to:

[0042] The natural language requirement description and the structured data of the target document are input into a prompting project, and the prompting words obtained by the prompting project through conversion of the natural language requirement description are obtained.

[0043] In one embodiment, the acquisition module is used to:

[0044] Acquire metadata of the target document; wherein the metadata includes multiple document elements; the multiple document elements include structural elements and content elements of the target document;

[0045] Extracting a target element from the plurality of document elements;

[0046] According to the target element, structured data of the target document is determined.

[0047] In one embodiment, the first generating module is used to:

[0048] Performing semantic recognition on the natural language requirement description through the prompting project to obtain semantic information of multiple preset requirement items;

[0049] The prompt project converts the semantic information of the plurality of preset demand items based on the scene information obtained by semantically understanding the structured data, thereby obtaining a plurality of prompt data included in the prompt word.

[0050] In one embodiment, the device may further include:

[0051] The output module is used to output prompt information in response to the lack of target prompt data in the prompt word; wherein the prompt information is used to prompt the user to supplement the input of the requirement description of the target task.

[0052] In one embodiment, the second generating module is used to:

[0053] The prompt word is input into the artificial intelligence AI model to generate the target function.

[0054] In one embodiment, the AI ​​model includes a first module; the second generation module is used to:

[0055] Inputting the prompt word into the first module of the AI ​​model to generate the functional logic of the target function;

[0056] The target function is generated according to a programming statement corresponding to the functional logic of the target function.

[0057] In one embodiment, the AI ​​model further includes a second module, and the second generation module is further used to:

[0058] The target function is functionally debugged by the second module of the AI ​​model, and when the debugging result of the functional debugging meets the first preset condition, the debugged target function is output. In one embodiment, the requirement description also includes a functional result sample; the second generation module is used to:

[0059] Input the prompt word and the functional result sample into the AI ​​model to obtain the target function output by the AI ​​model and functional description information of the target function;

[0060] The functional description information of the target function includes functional capability information and / or functional logic introduction of the target function; the functional capability information is used to characterize the logic layer capability used to implement the target function.

[0061] In one embodiment, the apparatus further comprises a training module, wherein the training module is configured to:

[0062] Obtaining a first execution result of the target function executing the target task;

[0063] Acquire a training label for training the AI ​​model according to feedback data for the first execution result;

[0064] During the training process of the AI ​​model, adjusting the parameters of the prompting project, and inputting the prompting words output by the adjusted prompting project into the AI ​​model to obtain a second execution result of the target function;

[0065] When the loss value determined according to the training label and the second execution result meets the second preset condition, stop training the AI ​​model.

[0066] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the document processing method provided in any one of the first aspects is implemented.

[0067] According to a fourth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the document processing method provided in any one of the first aspects is implemented.

[0068] The disclosed embodiments provide a document processing method, apparatus, device and storage medium, which receive a requirement description for executing a target task for a target document; obtain structured data of the target document; and generate prompt words according to the requirement description of the target task and the structured data of the target document; thereby, with the help of the understanding of the document data structure and the ability to recognize structured data, deeply match the data structure and the requirement description of the target task input by the user, improve the accuracy of the prompt words, and then generate a target function for executing the target task in the target document according to the prompt words, which can improve the applicability and execution accuracy of the target function in the user's specific task link.

[0069] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0071] Figure 1 A schematic diagram of a process flow of a document processing method provided by an embodiment of the present disclosure is shown;

[0072] Figure 2 A schematic diagram of a process flow of a document processing method provided by an embodiment of the present disclosure is shown;

[0073] Figure 3 A schematic diagram of the structure of a model system architecture provided by an embodiment of the present disclosure is shown;

[0074] Figure 4 A partial structural diagram of a model system architecture provided by an embodiment of the present disclosure is shown;

[0075] Figure 5 A schematic diagram of a process flow of a document processing method provided by an embodiment of the present disclosure is shown;

[0076] Figure 6 A schematic diagram of a process flow of a document processing method provided by an embodiment of the present disclosure is shown;

[0077] Figure 7 A schematic diagram of the structure of a document processing device provided by an embodiment of the present disclosure is shown;

[0078] Figure 8 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0079] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present disclosure as detailed in the appended claims.

[0080] The terms used in the disclosed embodiments are only for the purpose of describing specific embodiments and are not intended to limit the disclosed embodiments. The singular forms of "a", "said" and "the" used in the disclosed embodiments and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0081] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the disclosed embodiments, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the disclosed embodiments, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0082] It can be understood that the description of various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0083] Figure 1 A schematic diagram of a document processing method provided by an embodiment of the present disclosure is shown. Figure 1 As shown, the document processing method may include:

[0084] Step 101: receiving a requirement description for executing a target task with respect to a target document;

[0085] Step 102: Obtain structured data of the target document;

[0086] Step 103: Generate prompt words according to the requirement description of the target task and the structured data of the target document;

[0087] Step 104: Generate a target function for executing a target task in a target document according to the prompt word.

[0088] In the embodiments of the present disclosure, the document processing method may be executed by an electronic device, which may include a terminal and / or a server. The terminal may include but is not limited to: a mobile terminal or a fixed terminal installed with a document application. The server may be, for example, an application server of the document application.

[0089] The document application may provide an application interface, which includes a first interface (eg, a session panel) and a second interface (eg, a document interface).

[0090] In some examples, the first interface can be used for a natural language-based conversation. The conversation can be an AI conversation or a logic conversation, wherein the AI ​​conversation can be a natural language conversation with an AI model, and the logic conversation can be a natural language conversation with a non-AI model (such as a logic rule interface).

[0091] For example, the first interface may be used to receive a target task requirement description for a target document. The second interface may be used to display the document content of the target document. For example, the second interface may be used to receive an editing operation for the target content in the target document.

[0092] In some examples, the first interface may be used to display functional description information of a target function for performing a target task.

[0093] Here, the target document may include, but is not limited to: a table file, a presentation file, or a document file. For example, a table file may be an EXCEL file. For example, a presentation file may include multiple slides. For example, a document file may be a WORD file, a WPS file, and / or a PDF file, etc.

[0094] Here, the target task can be a specific task that requires an AI model or a logic rule interface to generate a target function to meet specific processing requirements.

[0095] Exemplarily, the target document is a presentation file or a document file, and the target task can be a text processing task of the presentation file or the document file. For example, the text processing task can be summarizing the target content in the target document, performing sentiment recognition on the summary result, and highlighting the recognized sentiment words.

[0096] As another example, the target document is a table file, and the target task may be a table processing task. For example, the table processing task may be to count the table data in the table file, sort the statistical results from high to low, and highlight the cell rows where the top N statistical results are located.

[0097] It is understandable that the above is merely an example of a target task, and the target task may be any complex task that meets user-defined requirements in a document processing scenario, and may also be a simple task that meets user-defined requirements.

[0098] The requirement description of the target task may be a requirement description input by a user, which may be used to describe the requirement information related to the target task. For example, the requirement description of the target task may include at least one of: scenario description, function description, function execution module screening, and output result expected description.

[0099] In some examples, in step 101 above, a requirement description for executing the target task may be received for the target document based on a first interface (e.g., a session panel); or, a requirement specification for executing the target task may be received for the target document, the requirement specification including the requirement description for the target task; or, requirement items set for the target task may be received based on a third interface (e.g., a requirement setting interface) to obtain a requirement description for executing the target task.

[0100] The structured data of the target document can be used to characterize the structured features of the target document.

[0101] Exemplarily, the structured data of the target document includes but is not limited to at least one of the following: the file name and file type of the target document, the data type in the target document, and the like.

[0102] The structured data of target documents of different document types may be different.

[0103] For example, if the target document is a table file, the structured data of the target document may include: the file name of the target document, the worksheet name, the table header, the column data type (or the row data type). The column data type of a column may indicate whether the data of the column is a picture, text, or number.

[0104] For another example, the target document is a presentation file, and the structured data of the target document may include: the file name and title of the target document; the title may include, for example, a main title, a subtitle, a first-level title, a second-level title, and the like.

[0105] In some examples, in the above step 102, the structured data of the target document may be obtained from metadata of the target document, or the structured data of the target document may be obtained from other data sources.

[0106] For example, the document elements included in the metadata of the target document may be structurally identified to obtain the structured data; wherein the document elements may be referred to as document basic elements or basic elements.

[0107] In some examples, in the above step 103, the first semantic feature may be extracted from the structured data of the target document, the second semantic feature may be extracted from the requirement description of the target task, and a prompt word (Prompt) may be generated based on the first semantic feature and the second semantic feature. For example, the first semantic feature and the second semantic feature may be concatenated to obtain a concatenated feature, and a prompt word may be generated based on the concatenated feature.

[0108] The prompt word may include a plurality of prompt data arranged in sequence.

[0109] In other examples, in the above step 103, a first prompt word can be generated according to the structured data of the target document, a second prompt word can be generated according to the requirement description of the target task, and the first prompt word and the second prompt word can be concatenated to obtain the prompt word for generating the target function.

[0110] In some examples, the first prompt word may include a plurality of first prompt data sorted in sequence; and the second prompt word may include a plurality of second prompt data sorted in sequence.

[0111] In some examples, a first semantic feature may be extracted from the structured data of the target document, and a first prompt word may be generated according to the first semantic feature; and / or,

[0112] A second semantic feature is extracted from the requirement description of the target task, and a second prompt word is generated according to the second semantic feature.

[0113] In some examples, in step 104, the prompt word may be matched in a preset programming language database to obtain a target programming language, and a target function may be generated according to the target programming language. Here, the programming language database may include various programming languages, such as scripting languages, high-level programming languages, and / or function formulas.

[0114] In other examples, prompt words can be used as text prompts (or "instructions") input into the AI ​​model to prompt or guide the AI ​​model to generate a target function for performing a target task, thereby enabling the AI ​​model to generate a target function with better performance.

[0115] In some examples, in the above step 104, the prompt word is input into the AI ​​model to obtain the target function generated by the AI ​​model for performing the target task.

[0116] Here, the target function may be referred to as a “custom function”, for example, the target function may be a custom designed function of spreadsheet processing software.

[0117] The AI ​​model may be a model for processing document tasks. For example, the AI ​​model may be a dedicated model for processing form tasks.

[0118] The AI ​​model may include, but is not limited to, a deep learning model and / or a machine learning model. For example, the AI ​​model includes, but is not limited to, at least one of the following: a convolutional neural network, a feedback neural network, a generative adversarial network (GAN), a large language model (LLM), etc.

[0119] In some examples, the target function for executing the target task can be implemented by at least one of the logic layer capabilities such as scripting language, high-level programming language and function formula. The scripting language can be, for example, Python or vbscript, etc., the high-level programming language can be, for example, VBA (Visual Basic for Applications) code, Java, Python, JavaScript, C language or C++, etc.; the function formula can be various function formulas in the target document or formulas obtained from a formula library.

[0120] In some examples, the target function may be used to perform a target task after being locally embedded in a target document. For example, the target function may be embedded in a menu area of ​​the target document in the form of a button.

[0121] For example, taking the natural language design of a table function as an example, the user role is a teacher. The teacher may prefer that the designed target function can be used to perform a table task of statistically analyzing student performance in a table document.

[0122] For example, in step 101, a natural language requirement description input by a teacher user may be received for a table document, and the natural language requirement description may be "find the scores of the top three students in the student score table and highlight them in red"; in step 102, the structured data of the table document is obtained, and the structured data may include the file name of the table document (such as "student score table"), the worksheet name (such as "xx class student score table"), and the table header, etc.; for example, the table header may include "name", "student number", "Chinese", "mathematics", etc.; in step 103, prompt words are generated according to the natural language requirement description and the structured data of the table document, and the prompt words may include data such as role and task description; for example, the prompt words may include "teacher", "student score table", "calculate student average score", "mark the top three in average score in red", etc.; according to the prompt words generated in step 103, a target function is generated, and the target function can be used to perform a table task of statistically analyzing student scores in a table document, that is, the target function will perform the calculation of the average score of each student in the student score table, sort the average scores in descending order, filter out the top three average scores, and mark the rows corresponding to the top three average scores in red. After embedding the target function into the spreadsheet document in the form of a button, the teacher user can trigger the target function with one click to execute the spreadsheet task of statistically analyzing student scores.

[0123] The disclosed embodiment provides a document processing method, which receives a requirement description for executing a target task for a target document; obtains structured data of the target document; and generates prompt words according to the requirement description of the target task and the structured data of the target document; thereby, with the help of the understanding of the document data structure and the ability to recognize structured data, deeply matches the data structure and the requirement description of the target task input by the user, improves the accuracy of the prompt words, and then generates a target function for executing the target task in the target document according to the prompt words, which can improve the applicability and execution accuracy of the target function in the user's specific task link.

[0124] In some embodiments, the requirement description includes a natural language requirement description, such as Figure 2 As shown, based on Figure 1 In the above step 103, generating prompt words according to the requirement description of the target task and the structured data of the target document may include:

[0125] Step 1031: input the natural language requirement description and the structured data of the target document into the prompting project, and obtain the prompt words obtained by the prompting project from converting the natural language requirement description.

[0126] In some examples, the prompt project can be a pre-built natural language processing (NLP) model. For example, the model can be obtained by training a neural network using sample text (e.g., sample natural language) as input and using the labeled prompt words corresponding to the sample text as output.

[0127] In some examples, the natural language requirement description may be requirement description text received from a text input box of the first interface (eg, a conversation panel), or may be requirement description text converted based on voice data received by the first interface.

[0128] Here, the prompt words generated by the prompt project can also be called "high-quality prompt words".

[0129] The prompt words generated by the prompt project may include one or more prompt data. Exemplarily, the prompt data may include at least one of the following: role data, task description data, capability usage scenario data, and output result requirement data.

[0130] Role data can be used to indicate the role that the AI ​​model needs to play when generating target functions for performing target tasks. For example, the role can be a teacher, doctor, salesperson, etc.

[0131] Task description data can be used to indicate what tasks the target function generated by the AI ​​model can perform.

[0132] Capability usage scenario data can be used to indicate the functional capabilities used by the target functions generated by the AI ​​model. For example, the functional capabilities may include logical layer capabilities such as scripting languages, high-level programming languages ​​and / or function formulas used by the AI ​​model to generate the target functions.

[0133] Output result requirement data can be used to indicate the functional result output of the target function generated by the AI ​​model and / or the execution result output of the target function performing the target task.

[0134] Here, the presentation method of the functional result output of the target function may include: a method of displaying the functional capability information and / or functional logic introduction of the target function.

[0135] In some examples, in the above step 1031, the structured data of the target document can be semantically understood through the prompt engineering to obtain the scene information of the target document, and the prompt engineering can convert the natural language requirement description based on the scene information of the target document to obtain the prompt words.

[0136] Compared to extracting a layer of general logic to design functional prompt words for specific scenarios, this embodiment inputs the natural language demand description and the structured data of the target document into the prompt project. In this way, the prompt project can use the structured data of the target document to translate the user's natural language description into an efficient and standard prompt word, which can reflect the uniqueness of the application scenario and the user's personalized needs, thereby making the generated prompt word more accurate.

[0137] In some embodiments, in the above step 102, obtaining structured data of the target document may include:

[0138] Acquire metadata of a target document; wherein the metadata includes a plurality of document elements; the plurality of document elements include structural elements and content elements of the target document;

[0139] Extracting target elements from multiple document elements;

[0140] According to the target elements, the structured data of the target document is determined.

[0141] In some examples, the metadata of the target file may be XML (eXtensible Markup Language) format data of the target file.

[0142] For example, for a table file, the document elements of the table file may include but are not limited to at least one of the following: file format, file name, worksheet name, and cell information. For example, cell information may include but is not limited to at least one of the following: cell row height, column width, background color, line type and thickness of border lines, cell text alignment, and cell content information; cell content information may include cell content and data type of the content, and the data type of the content may be: text type, number type, date type, etc. Among them, the text type may indicate that the content of the cell is plain text.

[0143] In some examples, the structural elements of the target document may include various basic elements capable of determining the structural attributes of the target document. The content elements of the target document may include various basic elements capable of determining the content attributes of the target document.

[0144] When the document types of the target documents are different, the document elements of the target documents may be different.

[0145] For example, for a target document of table type, the structural elements of the target document may include basic elements such as the file name, table name, worksheet name and / or cell information of the target document.

[0146] For a target document of table type, the content elements of the target document may include basic elements such as the row data type or column data type of the target document.

[0147] Here, the target element may include key document elements among the plurality of document elements, such as key structural elements and / or key content elements. For example, the target element of a table document includes the table name, worksheet name, table header and / or table row data type of the table document. Here, the table header may be determined based on the cell information, for example, the table header includes the content on the cell contained in the table header.

[0148] In some examples, a target element may be extracted from a plurality of document elements of a target document, and the target element may be obtained from metadata of the target document, and the target element may be determined as structured data of the target document.

[0149] Exemplarily, the structured data of the table document may include, but is not limited to, at least one of the following: a file name of the table document, a table name, a table header, and a column data type of the table.

[0150] In this embodiment, the target elements in the metadata of the target document are used to obtain structured data of the target document, which can facilitate the subsequent identification of scenario information of the target document based on the structured data, and then use the scenario information to convert the user's target task requirement description into prompt words for the target function, thereby improving the accuracy of the prompt words.

[0151] In some embodiments, in the above step 1031, inputting the natural language requirement description and the structured data of the target document into the prompting project, and obtaining the prompt words obtained by the prompting project from converting the natural language requirement description may include:

[0152] Through the prompt engineering, semantic recognition is performed on the natural language requirement description to obtain the semantic information of multiple preset requirement items;

[0153] The prompt engineering converts the semantic information of the plurality of preset requirement items based on the scene information obtained by semantically understanding the structured data, thereby obtaining a plurality of prompt data included in the prompt word.

[0154] In some examples, the plurality of preset requirement items may include: scenario description, function description, function execution module screening, and expected description of output results.

[0155] Scenario description can be used to describe the application scenario of the target function; function description can be used to describe the specific functions of the target function; function execution module screening can be used to describe the logical layer capabilities used to implement the target function (for example, using a certain scripting language to implement the target function); output result expected description can be used to describe the expected output of the functional result of the target function and / or the expected output of the execution result of the target function executing the target task.

[0156] In this embodiment, the multiple prompt data contained in the prompt word can be sorted in a predetermined order, which can facilitate the subsequent rapid processing of the AI ​​model and help improve the generation efficiency of the target function.

[0157] Figure 3 A schematic diagram of a model system architecture provided by an embodiment of the present disclosure. Figure 3 As shown in the figure, from the natural language requirement description to the final custom function capability mapping, there are two stages of judgment and model processing, from the input layer to the two hidden layers, and finally the output layer. The input layer can be used to input the natural language requirement description, the first hidden layer is used to generate prompt words, the second hidden layer is used for custom function debugging (i.e., function debugging of the target function), and the output layer is used to output the capabilities and function introduction of the custom function (i.e., the target function).

[0158] In some embodiments, the method may further include:

[0159] In response to the lack of target prompt data in the prompt word, prompt information is output; wherein the prompt information is used to prompt the supplementary input of the requirement description of the target task.

[0160] In some examples, the plurality of prompt data include first-category prompt data and second-category prompt data, and the first-category prompt data is more important than the second-category prompt data.

[0161] The target prompt data may be the first type of prompt data.

[0162] Exemplarily, the first type of prompt data may include role data and task description data; the second type of prompt data may include capability usage scenario data and output result requirement data.

[0163] Figure 4 A partial structural diagram of a model system architecture provided by an embodiment of the present disclosure. Figure 4 As shown in the figure, the user needs described in natural language by the prompt engineering are semantically recognized, and the scene description, function description, function execution module screening, and expected output result description can be respectively matched to the role (Role) and usage scenario (Usage Scenario), task (Task), and requirement (Requirements) in the prompt word. In addition, the size of various parameters (Parameter), including temperature (Temperature), Top-P, Max_Token, etc., can be analyzed based on the user's scene cognition and function result samples. In addition, the function result samples can be used as a small number of samples (Few-shot) content, which can be provided as learning samples to the model learning.

[0164] Exemplarily, when the prompt word lacks task description data, prompt information may be output to prompt the user to add a requirement description input for the task description data in the first type of prompt data.

[0165] Exemplarily, when the prompt word does not lack target prompt data, the AI ​​model can generate a target function for performing the target task based on the prompt word.

[0166] In some examples, in response to the prompt word lacking the second category of prompt data and not lacking the first category of prompt data, the AI ​​model generates a target function for performing the target task based on the prompt word.

[0167] In some examples, the prompt word lacks the second category prompt data. The AI ​​model can use the first category prompt data contained in the prompt word and the specified second category prompt data to generate a target function for performing the target task.

[0168] Exemplarily, the specified second type of prompt data can be set by the AI ​​model based on user historical data, or can be pre-specified by the AI ​​model. For example, the specified second type of prompt data includes: specified capability usage scenario data, which can be used to instruct the AI ​​model to use VBA code to generate the target function according to the first type of prompt data, and / or, specified output result requirement data, which can be used to indicate that the function result output of the target function generated by the AI ​​model includes a function logic introduction.

[0169] In this embodiment, prompt information is output in response to the lack of target prompt data in the prompt word. In this way, the user can be prompted to supplement the input requirement description of the target task through the prompt information. In this way, the generation effect of the prompt word can be improved, thereby improving the quality of the subsequent AI model generating target functions using the prompt word.

[0170] In some embodiments, Figure 5 As shown, based on Figure 2 In the above step 104, generating a target function for executing a target task in a target document according to the prompt word may include the following steps:

[0171] 1041, input the prompt word into the AI ​​model to generate the target function.

[0172] In some examples, the AI ​​model may be a generative model, such as an LLM model, and the LLM model may be a GPT (Generative Pre-Trained Transformer), but is not limited thereto.

[0173] In some embodiments, the AI ​​model includes a first module. In step 1041, the prompt word is input into the artificial intelligence AI model to generate the target function, which may include:

[0174] Input the prompt words into the first module of the AI ​​model to generate the functional logic of the target function;

[0175] Generate the target function according to the programming statements corresponding to the functional logic of the target function.

[0176] Here, the functional logic of the target function may include the execution logic of the target function performing the target task.

[0177] Here, the programming statements corresponding to the functional logic may include: scripting language, high-level programming language and / or function formula, etc.

[0178] In some examples, the first module may match the prompt word in a pre-established functional logic library, determine the functional logic required to implement the target function and the programming statement corresponding to the functional logic based on the matching result, and generate the target function based on the programming statement.

[0179] In other examples, the first module may generate the functional logic of the target function based on the prompt word, and match it in a preset programming statement database based on the functional logic to obtain a programming statement that matches the functional logic, and generate the target function based on the programming statement.

[0180] It can be understood that when the target function is used to perform a relatively complex target task, the functional logic of the target function may include multiple sub-logics, and there are dependencies or calling relationships between different sub-logics. In this case, it is necessary to generate the target function based on the relationship between the multiple sub-logics and the programming statements corresponding to the different sub-logics.

[0181] In this embodiment, the functional logic of the target function is generated by the first module of the AI ​​model according to the prompt word, and the programming statement corresponding to the functional logic of the target function is used to generate the target function, which can improve the quality of the target function and is conducive to improving the applicability and execution accuracy of the target function in the user's specific task links.

[0182] In some embodiments, the AI ​​model further includes a second module, and the method may further include the following steps:

[0183] The target function is functionally debugged through the second module of the AI ​​model, and when the debugging result of the functional debugging meets the first preset condition, the debugged target function is output.

[0184] In some examples, when the debugging result of the function debugging indicates that the execution result of the target function executing the target task is successful, the debugging result of the function debugging meets the first preset condition. When the debugging result of the function debugging indicates that the execution result of the target function executing the target task is failed, the debugging result of the function debugging does not meet the first preset condition.

[0185] In some examples, the second module can perform functional debugging on the target function in response to the user's debugging operation. In this example, the AI ​​model is able to support user manual debugging of the target function.

[0186] Exemplarily, the target function generated by the AI ​​model is used to execute the target task to obtain an execution result. If the user feedback data for the execution result indicates that the execution result is a failure, the functional logic of the target function and / or the programming statement corresponding to the functional logic can be adjusted based on the adjustment information entered by the user in the functional debugging interface to obtain a new target function, and functional debugging is performed for the new target function. In this way, after functional debugging of the target function, a target function that meets the first preset condition can be obtained.

[0187] In other examples, the second module performing functional debugging on the target function can be automatically performed by the AI ​​model.

[0188] For example, the AI ​​model can use the target function to automatically execute the target task to obtain the execution result, and automatically confirm the execution result of the target function executing the target task (here, the automatic confirmation result can include the feedback data of the AI ​​model on whether the execution result is successful), and when the execution result is a failure, the AI ​​module can automatically adjust the functional logic of the target function and / or the programming statement corresponding to the functional logic to obtain a new target function, and perform functional debugging on the new target function. In this way, after performing functional debugging of the target function, a target function that meets the first preset condition can be obtained.

[0189] In some examples, the method may further include:

[0190] The function debugging data of the target function is used as the training sample data to conduct intensive training on the AI ​​model to further improve the performance of the AI ​​model.

[0191] In this embodiment, by debugging the target function through the second module of the AI ​​model, the quality of the generated target function can be further improved, and the applicability and execution accuracy of the target function in the user's specific task links can be improved.

[0192] In some embodiments, the requirement description also includes a functional result sample; in the above step 1041, generating a target function for executing the target task through an AI model according to the prompt word may include:

[0193] The prompt words and function result samples are input into the AI ​​model to obtain the target function output by the AI ​​model and the function description information of the target function.

[0194] In some examples, the function result sample can be used as a sample reference of the function result of the target function. For example, the function result sample can be used to determine the presentation method of the function description information of the target function.

[0195] In some examples, the function result sample can be uniquely identified by sample information (eg, sample identification).

[0196] In other examples, functional result samples can be used for few-shot learning of AI models, so that by updating the model parameters of the AI ​​model on a small number of samples, the model can achieve better task performance.

[0197] In this embodiment, by inputting prompt words and function result samples into the AI ​​model, on the one hand, the AI ​​model can output the target function and target function description information required by the user, and on the other hand, the function result samples can be used to optimize the AI ​​model and improve model performance.

[0198] In some embodiments, the functional description information of the target function includes functional capability information and / or functional logic introduction of the target function; the functional capability information is used to characterize the logic layer capabilities used to implement the target function.

[0199] Exemplarily, the logic layer capabilities used to implement the target function may include but are not limited to at least one of the following: scripting language, programming language and function formula. The scripting language may be, for example, Python or vbscript, etc., and the high-level programming language may be, for example, VBA (Visual Basic for Applications) code, Java, Python, JavaScript, C language or C++, etc.; the function formula may be various function formulas in the target document.

[0200] Exemplarily, the functional logic introduction may include: an execution logic introduction of the target function executing the target task. For example, the execution logic introduction may be a description of the steps in the process of the target function executing the target task.

[0201] In some embodiments, Figure 6 As shown, the method may further include the following steps:

[0202] 201: Obtaining a first execution result of a target function executing a target task;

[0203] 202: Obtaining a training label for training the AI ​​model according to feedback data for the first execution result;

[0204] 203: During the training process of the AI ​​model, adjust the parameters of the prompt project, and input the prompt words output by the adjusted prompt project into the AI ​​model to obtain a second execution result of the target function;

[0205] 204: When the loss value determined according to the training label and the second execution result meets the second preset condition, stop training the AI ​​model.

[0206] In some examples, the content acted upon by the target function when executing the target task may be specified content in the target document, for example, the specified content may be a picture or text or table data specified in the target document.

[0207] In some examples, the feedback data for the first execution result may include confirmation feedback data, or denial feedback data.

[0208] Here, the confirmation feedback data is used to indicate that the execution result is successful, and the denial feedback data is used to indicate that the execution result is unsuccessful.

[0209] For example, when the feedback data for the first execution result is negative feedback data, it may indicate that the first execution result is an erroneous execution result or an execution result that the user is not satisfied with.

[0210] Exemplarily, the feedback data for the execution result may be determined based on a user's feedback operation on the execution result.

[0211] For example, prompt information regarding the execution result may be displayed in the form of a dialog box to prompt the user to input feedback data regarding the execution result.

[0212] In another exemplary embodiment, the feedback data for the execution result may be output by the AI ​​model. For example, the feedback data for the execution result may be included in the record data obtained by the AI ​​model automatically confirming the execution result of the target function.

[0213] The feedback data on the execution results can be used as training labels to construct a sample training set for the AI ​​model; wherein the sample training set includes negative samples (bad cases), and the negative samples can be constructed based on the negative feedback data of the execution results.

[0214] In some examples, in the above step 203, during the training process of the AI ​​model, the parameters of the prompt project can be adjusted based on the parameter adjustment information, and the prompt words output by the adjusted prompt project can be input into the AI ​​model to obtain a second execution result of the target function.

[0215] In some examples, the parameter adjustment information may include a parameter change amount for adjusting a parameter of the prompting project.

[0216] In some examples, the parameters adjusted in the prompting process may be related parameters that affect the prompting words. For example, the parameters may include but are not limited to at least one of the following parameters: temperature, Top-P, and the maximum number of tokens.

[0217] The temperature parameter can affect the randomness of the model output. When the temperature value is increased, the model output will become more random and innovative; when the temperature value is decreased, the model output will become more deterministic and consistent, tending to output the most likely results.

[0218] Top-P, also known as kernel sampling or probability sampling, determines the cumulative probability distribution used to sample the next token in the generated response. By setting the value of top P, you can control the diversity of the output. A higher top P value (such as 0.9) model considers more options when sampling, resulting in more diverse results. Conversely, a lower P value (such as 0.3) limits the selection and produces more concentrated results.

[0219] The maximum number of tokens is used to define the maximum number of tokens in the generated response. Tokens can be words or characters (here, for the code used to implement the target function, code is essentially text). By setting the maximum token value, you can limit the length of the generated output.

[0220] In other examples, adjusting the parameters of the prompt project may include: adjusting the weights of one or more network nodes in a network layer included in the prompt project, so that the prompt words output by the adjusted prompt project are input into the AI ​​model.

[0221] In the above step 203, based on the prompt words output by the adjusted prompt engineering, the AI ​​model can regenerate the target function, and a second execution result can be obtained after executing the target task using the regenerated target function.

[0222] The second execution result can be compared with the feedback data of the first execution result (i.e., the training label), and a loss value can be obtained based on the difference between the second execution result and the feedback data. Based on the loss value, it can be determined whether it is necessary to continue training the preset model. If it is necessary to continue training the model, at least part of the parameters of the preset model can be updated first, and the training and calculation of the loss value of the model can continue until the loss value meets the second preset condition, and then stop training the AI ​​model.

[0223] In some examples, the second preset condition may include: the loss value obtained in the current round of training is less than the preset value, and / or the difference between the loss value obtained in the current round of training and the loss value obtained in the previous round of training is less than the preset difference. In this embodiment, the loss function of the model is optimized by adjusting the parameters of the prompting project during the training process of the AI ​​model, so that the accuracy of the entire system architecture is continuously enhanced, which can improve the quality of the final target function.

[0224] Continue to refer to Figure 3 , taking the AI ​​model as the LLM model for illustrative explanation. The LLM model can be expressed as: W = LLM (α, β, γ). Among them, α is the subject content related to the prompt engineering, β is the semantic understanding after metadata structuring, γ is the user's natural language demand description, α, β and γ are inputs that are highly matched with the task content, and W is the action code automatically generated by the model (for example, the action code can be used to achieve the target function).

[0225] Using the feedback data of the execution results obtained by automatic machine confirmation or manual user confirmation, a negative sample (bad case) training set is constructed to continuously strengthen the model's capabilities. The feedback of the second hidden layer is denoted as f. The loss equation between the feedback of the execution results of the second hidden layer and the model execution is calculated as:

[0226] Loss(W,f)=Loss(LLM(α,β,γ),f);

[0227] After training, the parameter α of the prompt engineering and the semantic understanding β after metadata structured recognition are continuously adjusted to optimize the overall loss function Loss(W,f), so that the entire system architecture continuously enhances accuracy and thus improves overall performance.

[0228] It should be noted that those skilled in the art can understand that the method provided in the embodiments of the present disclosure can be executed alone or together with some methods in the embodiments of the present disclosure or some methods in related technologies.

[0229] In order to further explain any embodiments of the present disclosure, some specific embodiments are provided below.

[0230] In the related technologies, there are two types of functional designs for AI: one is general tasks that use the understanding and coding capabilities of LLM to generate code based on the understanding of user questions and table data to complete task execution; the other is special tasks that have clear tasks and clear logic for accessing LLM. The functional logic is described with prompts in the background, and when accessing the model, the user questions are assembled with the designed general prompts for the task, and the access is packaged to achieve task execution.

[0231] Both of the above methods face an unsolvable problem, namely, the user scenario and the problem of functional customization when it is determined. The accuracy and breadth of general script execution tasks are limited. The accuracy in the user's customized scenario depends on the accuracy of code generation, which is currently low. The breadth cannot fully cover the various capabilities of LLM, so it is also limited. The specific task approach faces another problem, that is, when designing prompts, a layer of common functional design logic is extracted from the specific scenario. However, when it comes to the user's usage scenario, each user has his or her own unique task, and the concrete description of the applicable scenario will naturally affect the accuracy of the task execution results and the satisfaction of task completion.

[0232] For example, for roles in different industries (teachers, salespeople, human resource managers, etc.), their demands for the same complex functions such as conditional formatting and content extraction must be different. When designing functions, product managers can only extract a layer of similarity based on common attributes and design functions, but ignore the uniqueness of their application scenarios and the personalized needs of users.

[0233] The solution provided by the disclosed embodiments can improve the applicability and execution accuracy of large-scale language models in user-specific task links in spreadsheet software. Through the task description, scenario description, task execution module screening, and output result expected description of specific tasks with user-defined input, and with the help of the understanding of the table data structure and the ability to recognize structured data, the two core elements of data structure and user-defined input are more deeply matched, thereby improving the feedback accuracy and applicability of function design of large language models in user-specific scenarios.

[0234] The solution provided by the embodiment of the present disclosure translates the user's natural language description into an efficient and standard LLM prompt word by performing structured recognition and data type recognition on metadata in terms of data structure, thereby realizing the design concept of "Prompt is script", allowing users to realize the functions of custom-designed spreadsheet products through demand description with the help of LLM, and can store custom-designed functional tools in the toolbox.

[0235] The user's natural language description generates high-quality prompt words for the model and ensures the reusability of custom functions. The final result output includes functional capability output and custom function logic introduction, achieving end-to-end semantic-level matching. The ability to design custom functions can greatly improve the applicability and task accuracy of functions in user-specific scenarios.

[0236] The solution provided by the embodiments of the present disclosure has a wide range of applications and fields, and can be used in a variety of office spreadsheet product directions. The applicable products are mainly spreadsheet-related products, such as local spreadsheets, online spreadsheets, light-dimensional spreadsheets, database-like spreadsheets, etc. However, the overall design idea can be used for various product functions that use LLM to package application scenarios, and is not limited to spreadsheet products. The applicable scenarios are diverse. With the enrichment of the task execution process, vertical models can be combined with each other to achieve the inclusion of multiple methods in the execution process (code generation, spreadsheet function generation, content generation, etc.), thereby enriching the ability to customize functions and increasing application depth and scenario diversity.

[0237] In the disclosed embodiments, users can be assisted in custom designing product functions based on a large-scale language model, achieving semantic matching of natural language with the feature level of custom function capabilities and custom function introductions, and ensuring the accuracy and speed of natural language design table functions; in addition, logical layer operations such as formula generation and code generation are added during the execution process to increase the capability richness of custom functions, while achieving mutual matching between natural language requirement descriptions and LLM high-quality prompts and related parameters of function design.

[0238] Reference Figure 3 As shown in the figure, from natural language to the final custom function capability mapping, it will go through two stages of judgment and model processing, from the input layer (Input layer) to two hidden layers (Hidden Layer), and finally get the output layer (Output Layer).

[0239] The key process in this architecture is that the prompt engineer converts the natural language requirement description input by the user into high-quality prompt words for the custom function (i.e., the target function in the aforementioned embodiment), thereby re-accessing the LLM to perform automated functional debugging of a specific task (i.e., the target task in the aforementioned embodiment) and finally obtain the capabilities and functional profile output of the custom function.

[0240] (1) Generate custom prompt words, and generate custom functions based on the custom prompt words.

[0241] Step 1: Structural identification of metadata. The goal is to read loose metadata into a structured form.

[0242] Ⅰ. Identify basic elements such as file name, table name, and table header for table files.

[0243] II. Identify the data types of each column based on the column type of the table.

[0244] III. Concatenate the table header information and column data type in a specific format to form a prompt in a specific format.

[0245] Step 2: Match and transform the necessary elements of the natural language requirement description and the function design prompt. The goal is to transform the natural language requirement description of the user into high-quality prompts for function execution by combining the scenario information identified by metadata structure. This process can be referred to Figure 4 shown.

[0246] Ⅰ. Perform semantic recognition based on user needs described in natural language.

[0247] II. Match the scenario description, function description, function execution module screening, and expected output result description to the role, usage scenario, task, and requirements in the prompt.

[0248] Ⅲ. Analyze the size of various parameters (Parameter), including temperature (Temperature), Top-P, Max_Token, etc. according to the user's scenario cognition and functional result samples.

[0249] IV. Use the functional result samples as a small number of samples (Few-shot) and provide them as learning samples for model learning.

[0250] Ⅴ. According to the user's functional execution module screening, you can choose various logical layer capabilities such as VBA code, table formula, Java script, etc.

[0251] Step 3: Complete the debugging of the custom functions of the second hidden layer. The goal is to debug with more realistic function output results and align with the core needs of users.

[0252] Ⅰ. Based on the high-quality prompt generated by the second layer, the LLM is used to test and obtain the corresponding results.

[0253] II. In the early stage, this layer can be exposed to users as a debugging and confirmation platform to make secondary confirmation of functional logic and functional results. In the later stage, automatic reinforcement learning can be used to perform testing and debugging through machine execution.

[0254] III. Record the debugging and self-testing process and use it as reinforcement learning data to feed back to the prompt engineering to improve the overall performance.

[0255] Step 4: Results presentation: The goal is to present the results of the task designed with custom functions.

[0256] Ⅰ. Functional capability output of custom designed functions, which can be saved by pressing a button;

[0257] II. Functional introduction output of custom design functions;

[0258] III. Ensure functional reusability.

[0259] (2) Reinforcement learning based on user feedback or machine feedback

[0260] The LLM model can be expressed as: W = LLM (α, β, γ). LLM has three parts of input: parameters related to the prompt project (for example, subject content) α, semantic understanding of metadata structured as β, and user's natural language demand description as γ. Using these inputs that are highly matched with the task content, the action code automatically generated by the model is recorded as W. The parameters α and β here can be Figure 6 Parameters adjusted by the methods shown.

[0261] The disclosed embodiment provides two learning iteration mechanisms to make the coordination between the model and the task execution module more accurate.

[0262] In the second hidden layer, after automatic machine confirmation or manual user confirmation, the actual success or failure results of the execution process are fed back. By recording these user feedbacks, a training set of negative samples (bad cases) is prepared to continuously strengthen the model's capabilities. The feedback of this layer is denoted as f. The loss equation for calculating the feedback of the execution results of the second hidden layer and the model execution is:

[0263] Loss(W,f)=Loss(LLM(α,β,γ),f)

[0264] Then, the parameter α of the prompt engineering and the semantic understanding β after metadata structured recognition are continuously adjusted to optimize the overall loss function Loss(W,f), so that the accuracy of the entire system is continuously enhanced.

[0265] It is understandable that for simple tasks, users can directly input model prompt words. Without high-quality translation of the prompt project, the task effect is extremely limited and only extremely simple functions can be designed.

[0266] As the most frequently used, most in-depth, and most user-friendly office software in office scenarios, spreadsheet software has extremely complex usage scenarios. The functional design logic within the spreadsheet is to extract a layer of general logic before designing the spreadsheet function. The prompt words generated based on natural language understanding will essentially become a new type of script. Users can design reusable custom functions through natural language demand descriptions, greatly improving the adaptability of functions and scenarios and the accuracy of function result output.

[0267] Through natural language dialogue, we can generate custom functions to perform specific tasks, which greatly reduces the threshold for users to customize the design of table functions. By building GAN, we can achieve end-to-end semantic-level matching on hardware, greatly improving the speed and accuracy of matching. This improves the completion rate and overall response speed of complex tasks in user scenarios, and custom functions can be deposited in the toolbox to generate reuse value.

[0268] Figure 7 A schematic diagram of the structure of a document processing device provided by an embodiment of the present disclosure is shown. Figure 7 As shown, the document processing device 100 may include:

[0269] A receiving module 110 is used to receive a requirement description of a target task to be executed with respect to a target document;

[0270] An acquisition module 120, configured to acquire structured data of the target document;

[0271] A first generating module 130, configured to generate prompt words according to the requirement description of the target task and the structured data of the target document;

[0272] The second generating module 140 is used to generate a target function for executing the target task in the target document according to the prompt word.

[0273] In one embodiment, the requirement description includes a natural language requirement description, and the first generating module 130 is used to:

[0274] The natural language requirement description and the structured data of the target document are input into a prompting project, and the prompting words obtained by the prompting project through conversion of the natural language requirement description are obtained.

[0275] In one embodiment, the acquisition module 120 is used to:

[0276] Acquire metadata of a target document; wherein the metadata includes a plurality of document elements; the plurality of document elements include structural elements and content elements of the target document;

[0277] Extracting a target element from the plurality of document elements;

[0278] According to the target element, structured data of the target document is determined.

[0279] In one embodiment, the first generating module 130 is used to:

[0280] Performing semantic recognition on the natural language requirement description through the prompting project to obtain semantic information of multiple preset requirement items;

[0281] The prompt project converts the semantic information of the plurality of preset demand items based on the scene information obtained by semantically understanding the structured data, thereby obtaining a plurality of prompt data included in the prompt word.

[0282] In one embodiment, the device may further include:

[0283] The output module is used to output prompt information in response to the lack of target prompt data in the prompt word; wherein the prompt information is used to prompt the user to supplement the input of the requirement description of the target task.

[0284] In one embodiment, the second generating module 140 is used to:

[0285] The prompt word is input into the artificial intelligence AI model to generate the target function.

[0286] In one embodiment, the AI ​​model includes a first module; the second generation module 140 is used to:

[0287] Inputting the prompt word into the first module of the AI ​​model to generate the functional logic of the target function;

[0288] The target function is generated according to a programming statement corresponding to the functional logic of the target function.

[0289] In one embodiment, the AI ​​model further includes a second module, and the second generation module 140 is further used to:

[0290] The target function is functionally debugged through the second module of the AI ​​model, and when the debugging result of the functional debugging meets the first preset condition, the debugged target function is output.

[0291] In one embodiment, the requirement description further includes a functional result sample; the second generating module 140 is used to:

[0292] Input the prompt word and the functional result sample into the AI ​​model to obtain the target function output by the AI ​​model and functional description information of the target function;

[0293] The functional description information of the target function includes functional capability information and / or functional logic introduction of the target function; the functional capability information is used to characterize the logic layer capability used to implement the target function.

[0294] In one embodiment, the apparatus further comprises a training module, wherein the training module is configured to:

[0295] Obtaining a first execution result of the target function executing the target task;

[0296] Acquire a training label for training the AI ​​model according to feedback data for the first execution result;

[0297] During the training process of the AI ​​model, adjusting the parameters of the prompting project, and inputting the prompting words output by the adjusted prompting project into the AI ​​model to obtain a second execution result of the target function;

[0298] When the loss value determined according to the training label and the second execution result meets the second preset condition, stop training the AI ​​model.

[0299] Regarding the document processing device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the corresponding method embodiment, and will not be elaborated here.

[0300] An embodiment of the present disclosure further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the document processing method provided by any embodiment of the present disclosure when executing the program.

[0301] The device may be, but is not limited to: a terminal and / or a server. The terminal may be, but is not limited to, a mobile phone, a tablet computer, a computer, a wearable device, etc.; the server may be various types of servers; for example, the server may be, but is not limited to, a cloud server or a local server, etc.

[0302] The memory may include various types of storage media, which are non-transitory computer storage media that can continue to memorize information stored thereon after the communication device loses power.

[0303] The processor may be connected to the memory via a bus or the like, and is used to read an executable program stored in the memory, for example, to implement the document processing method provided by any embodiment of the present disclosure.

[0304] An embodiment of the present disclosure further provides a computer-readable storage medium, which stores an executable program. When the executable program is executed by a processor, the document processing method provided by any embodiment of the present disclosure is implemented.

[0305] Figure 8 A block diagram of an electronic device 800 is shown according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a document processor, a computer, a tablet device, a personal digital assistant, etc. Figure 8, the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0306] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0307] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0308] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0309] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0310] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0311] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0312] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0313] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0314] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0315] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0316] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the claims.

[0317] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A document processing method, characterized in that: The method comprises: Receiving a requirement description for executing a target task with respect to a target document; Acquire structured data of the target document; Generate prompt words according to the requirement description of the target task and the structured data of the target document; According to the prompt word, a target function for executing the target task in the target document is generated.

2. The method according to claim 1, characterized in that The requirement description includes a natural language requirement description, and the generating of prompt words according to the requirement description of the target task and the structured data of the target document includes: The natural language requirement description and the structured data of the target document are input into a prompting project, and the prompting words obtained by the prompting project through conversion of the natural language requirement description are obtained.

3. The method according to claim 1, characterized in that The obtaining of structured data of the target document includes: Acquire metadata of the target document; wherein the metadata includes multiple document elements; the multiple document elements include structural elements and content elements of the target document; Extracting a target element from the plurality of document elements; According to the target element, structured data of the target document is determined.

4. The method according to claim 2, characterized in that: Inputting the natural language requirement description and the structured data of the target document into a prompting project, and obtaining the prompting words obtained by the prompting project from converting the natural language requirement description, comprises: Performing semantic recognition on the natural language requirement description through the prompting project to obtain semantic information of multiple preset requirement items; The prompt project converts the semantic information of the plurality of preset demand items based on the scene information obtained by semantically understanding the structured data, thereby obtaining a plurality of prompt data included in the prompt word.

5. The method according to claim 4, characterized in that The method may further comprise: When the prompt word lacks target prompt data, prompt information is output; wherein the prompt information is used to prompt the user to input a supplementary requirement description of the target task.

6. The method according to any one of claims 2 to 5, characterized in that: The step of generating a target function for executing the target task in the target document according to the prompt word includes: The prompt word is input into the artificial intelligence AI model to generate the target function.

7. The method according to claim 6, characterized in that The AI ​​model includes a first module, wherein the prompt word is input into the artificial intelligence AI model to generate the target function, including: Inputting the prompt word into the first module of the AI ​​model to generate the functional logic of the target function; The target function is generated according to a programming statement corresponding to the functional logic of the target function.

8. The method according to claim 7, characterized in that The AI ​​model further includes a second module, and the method further includes: The target function is functionally debugged through the second module of the AI ​​model, and when the debugging result of the functional debugging meets the first preset condition, the debugged target function is output.

9. The method according to claim 6, characterized in that The requirement description also includes a functional result sample; the step of inputting the prompt word into an artificial intelligence (AI) model to generate the target function includes: Input the prompt word and the functional result sample into the AI ​​model to obtain the target function output by the AI ​​model and functional description information of the target function; The functional description information of the target function includes functional capability information and / or functional logic introduction of the target function; the functional capability information is used to characterize the logic layer capability used to implement the target function.

10. The method according to claim 6, characterized in that The method further comprises: Obtaining a first execution result of the target function executing the target task; Acquire a training label for training the AI ​​model according to feedback data for the first execution result; During the training process of the AI ​​model, adjusting the parameters of the prompting project, and inputting the prompting words output by the adjusted prompting project into the AI ​​model to obtain a second execution result of the target function; When the loss value determined according to the training label and the second execution result meets the second preset condition, stop training the AI ​​model.

11. A document processing device, characterized in that: The device comprises: A receiving module, used for receiving a requirement description for executing a target task with respect to a target document; An acquisition module, used for acquiring structured data of the target document; A first generating module, configured to generate prompt words according to the requirement description of the target task and the structured data of the target document; The second generating module is used to generate a target function for executing the target task in the target document according to the prompt word.

12. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the document processing method according to any one of claims 1 to 10 is implemented.

13. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the document processing method according to any one of claims 1 to 10 is implemented.