Document processing method and device, electronic equipment and storage medium

By automatically identifying and applying formulas in the document processing system, the problem of low document processing efficiency caused by users' need to manually edit formulas is solved, and automatic acquisition of formulas and improvement of document processing efficiency is achieved.

CN119623426APending Publication Date: 2025-03-14ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311177815.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-11
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In the prior art, document-like applications provide formula editors in editable documents, and users need to manually edit formulas, resulting in low document processing efficiency.

Method used

By receiving the input target text at the first interface, the first formula for performing the calculation is determined based on the processing of the target text, and the formula is applied to the editing of the target area in the second interface, automatic acquisition of the formula is realized.

Benefits of technology

No need for user to manually edit formulas, which reduces user workload and improves document processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623426A_ABST
    Figure CN119623426A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a document processing method and device, electronic equipment and a storage medium. The document processing method can comprise the steps of receiving an input target text based on a first interface; determining a first formula for executing calculation on the basis of processing the target text; and applying the first formula to editing of a target area in a second interface. According to the embodiment of the invention, the document processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to, but is not limited to, the field of computer technology, and in particular to a document processing method and device, an electronic device, and a storage medium. Background Art

[0002] With the rapid development of computer technology, it is becoming more and more convenient to use document applications to process documents.

[0003] In the prior art, document applications provide a formula editor in an editable document, and users can use the formula editor to edit the formula to obtain the formula that needs to be inserted into the document. This method requires users to manually edit the formula, resulting in low document processing efficiency. Summary of the invention

[0004] Embodiments of the present disclosure provide a document processing method and device, an electronic device, and a 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 target text input based on the first interface;

[0007] Determining a first formula for performing a calculation based on processing the target text;

[0008] The first formula is applied to editing the target area in the second interface.

[0009] In one embodiment, determining a first formula for performing calculation based on processing the target text includes:

[0010] Process the target text using a first model to determine whether the target text involves calculation;

[0011] In response to the target text involving a calculation, the first formula is determined based on a second model.

[0012] In one embodiment, in response to the target text involving calculation, determining the first formula based on the second model includes:

[0013] In response to the target text involving calculation, constructing a first prompt word according to a first calculation intention extracted from the target text by the first model, and inputting the first prompt word into the second model to obtain the first formula output by the second model;

[0014] or,

[0015] In response to the target text involving calculation, the target text is input into the second model to obtain the first formula output by the second model.

[0016] In one embodiment, determining a first formula for performing calculation based on processing the target text includes:

[0017] Based on the processing of the target text, obtaining a second computing intent of the target text;

[0018] Constructing a second prompt word according to the second calculation intention and the formula description of the candidate formula in the preset database;

[0019] Determining, according to the second prompt word, a degree of matching between the second calculation intention and the candidate formula;

[0020] The first formula is determined according to the degree of matching between the second calculation intention and the alternative formula.

[0021] In one embodiment, determining the first formula according to the degree of matching between the second calculation intention and the candidate formula includes:

[0022] In response to the absence of an alternative formula that completely matches the second calculation intent, determining a degree of matching between each of the alternative formulas and the second calculation intent;

[0023] The first formula is determined based on at least one of the candidate formulas with the highest matching degree.

[0024] In one embodiment, determining the first formula based on at least one candidate formula with the highest matching degree includes:

[0025] Displaying the N candidate formulas with the highest matching degree, formula descriptions of the candidate formulas and / or first prompt information in the first interface, wherein the first prompt information is used to prompt modification suggestions for the candidate formulas, or to prompt the difference between the second calculation intention and the formula description of the candidate formula; N is a positive integer;

[0026] The first formula is determined according to a modification operation applied to any one of the displayed candidate formulas.

[0027] In one embodiment, determining the first formula based on at least one candidate formula with the highest matching degree includes:

[0028] Determine the difference between the candidate formula with the highest matching degree and the second calculation intention;

[0029] The candidate formula is modified according to the difference to obtain the first formula.

[0030] In one embodiment, the modification operation includes: a modification operation input by a user; or a modification operation determined based on a natural language input by the user.

[0031] In one embodiment, determining the first formula according to the degree of matching between the second calculation intent and the formula description of the candidate formula includes:

[0032] In response to there being multiple candidate formulas whose formula descriptions completely match the second calculation intention, outputting second prompt information in the first interface, wherein the second prompt information is used to prompt input of instruction information for selecting a target formula from the candidate formulas; the target formula is used to determine the first formula;

[0033] The first formula is determined according to an input operation based on the second prompt information.

[0034] In one embodiment, in response to the target text involving calculation, determining the first formula based on the second model includes:

[0035] In response to the target text involving calculation, determining a third calculation intention based on the second model;

[0036] The first formula is generated according to the third calculation intention.

[0037] In one embodiment, determining a first formula for performing calculation based on the target text includes:

[0038] Processing the target text using the first model to generate a second formula that performs a calculation;

[0039] Matching the second formula with candidate formulas in a preset database;

[0040] The first formula is determined based on the candidate formula with the highest matching degree.

[0041] In one embodiment, before applying the first formula to the editing of the target area in the second interface, the method further includes:

[0042] Demonstrating a calculation example in the first interface or the second interface according to the first formula;

[0043] According to the feedback operation acting on the calculation example, it is determined whether to apply the first formula to the editing of the target area in the second interface.

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

[0045] detecting an edit operation acting on the computing instance;

[0046] According to the editing operation, the first formula is updated to obtain an edited second formula applied to the target area.

[0047] In one embodiment, the determining whether to apply the first formula to the editing of the target area in the second interface according to the feedback operation acting on the calculation example includes:

[0048] In response to detecting a confirmation feedback operation acting on the calculation example, it is determined to apply the first formula to the editing of the target area in the second interface.

[0049] In one embodiment, applying the first formula to the editing of the target area in the second interface includes one of the following:

[0050] Writing the first formula into the target area;

[0051] The numerical value in the target area is calculated based on the first formula to obtain a calculation result displayed in the target area.

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

[0053] A receiving module, used for receiving a target text input based on the first interface;

[0054] A determination module, configured to determine a first formula for performing calculation based on processing of the target text;

[0055] A processing module is used to apply the first formula to the editing of the target area in the second interface.

[0056] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0057] processor;

[0058] a memory for storing processor-executable instructions;

[0059] Wherein, the processor is configured to: implement the document processing method described in any one of the first aspects when running the executable instructions.

[0060] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores an executable program, wherein when the executable program is executed by a processor, the document processing method described in any one of the first aspects is implemented.

[0061] The embodiments of the present disclosure provide a document processing method and apparatus, an electronic device, and a storage medium. The method receives a target text input based on a first interface, determines a first formula for performing a calculation based on processing the target text, and applies the first formula to editing of a target area in a second interface. In this way, there is no need for a user to manually edit a formula using a formula editor for an editable document, thereby achieving automatic acquisition of the formula, reducing the user's workload for editing the formula, and greatly improving document processing efficiency.

[0062] 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

[0063] 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.

[0064] Figure 1a The figure is a flowchart of a document processing method according to an exemplary embodiment.

[0065] Figure 1b It is a schematic diagram of an interface according to an exemplary embodiment.

[0066] Figure 2 The figure is a flowchart of a document processing method according to an exemplary embodiment.

[0067] Figure 3 The figure is a flowchart of a document processing method according to an exemplary embodiment.

[0068] Figure 4 The figure is a flowchart of a document processing method according to an exemplary embodiment.

[0069] Figure 5 The figure is a flowchart of a document processing method according to an exemplary embodiment.

[0070] Figure 6 The figure is a flowchart of a document processing method according to an exemplary embodiment.

[0071] Figure 7 The figure is a flowchart of a document processing method according to an exemplary embodiment.

[0072] Figure 8 The figure is a flowchart of a document processing method according to an exemplary embodiment.

[0073] Fig. 9 The diagram is a schematic diagram of the structure of a document processing device according to an exemplary embodiment.

[0074] Fig.10 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0075] 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.

[0076] 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.

[0077] 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".

[0078] 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.

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

[0080] 101: receiving a target text input based on the first interface;

[0081] 102: Determine a first formula for performing calculation based on processing of the target text;

[0082] 103: Apply the first formula to edit the target area in the second interface.

[0083] In this embodiment, the document processing method can be executed by an electronic device, which may include but is not limited to a terminal or a server, and the terminal may correspond to any form of terminal device. For example, the terminal device may include but is not limited to: a tablet computer, a desktop computer, a mobile phone, a vehicle-mounted device and / or a smart office device. The server may be an application server for a document application.

[0084] In some embodiments, a document application may have an application interface, in which a first interface and a second interface are provided. The first interface and the second interface may be independent interfaces, or the first interface may be a part of the second interface. When the first interface and the second interface are independent interfaces, the second interface and the first interface may be displayed side by side horizontally or side by side vertically in the application interface.

[0085] In some examples, the first interface may be a conversation panel for an artificial intelligence (AI) conversation. For example, the AI ​​conversation may be a natural language conversation with an AI model, and the conversation panel is used to receive a target text related to the calculation.

[0086] In some examples, the first interface can be a wizard interface for guiding user input in the process of determining the calculation formula. For example, the wizard interface can receive domain keywords regarding the calculation formula input by the user, and pop up a formula description window based on the received domain keywords to receive the formula description entered by the user under the calculation field.

[0087] The second interface can be used to display the document content of the target file. The target file can be various types of editable files; illustratively, the target file can be a presentation file, a text file and / or a table file. For example, the presentation file can be a slide, etc.; the presentation file can be used for presentation. For example, the text file can be a WORD file, a WPS file, etc. For example, the table file can be an EXCEL file, etc.

[0088] In some examples, the first interface may be displayed within the application window in response to a user triggering a shortcut key, or the first interface may be displayed within the application window in response to a user clicking a predefined function menu, or the first interface may be displayed within the application window in response to a selection operation on target content on the second interface.

[0089] In some examples, the target text input received by the first interface may be a target text in natural language, a target text converted from voice data, or text content selected in a target file displayed on the second interface.

[0090] For example, the first interface may include a text input box and / or a voice input control. The text input box may receive text input by a user through a keyboard, a handwriting board, etc., or the text input box may also receive text content selected by the user in the target file displayed on the second interface. The voice input control may receive voice input by the user.

[0091] For example, Figure 1b As shown, in Figure 1b The second interface (e.g., document interface) A is displayed on the left, and the first interface B is displayed on the right; the second interface A displays the document content of the target file. The user can input text information, such as natural language text, in the first interface (e.g., conversation panel) B. For example, the input content is "calculate the kinetic energy generated by an object with a mass of m after an initial velocity of V0, an acceleration of a, and a motion time of t". The electronic device determines the first formula for performing the calculation based on the processing of the target text, and applies the first formula to the editing of the target area in the second interface A.

[0092] In some examples, when a first formula for performing a calculation is determined, the first formula can be displayed in the first interface.

[0093] In some examples, the aforementioned AI model can run in a terminal or on a server.

[0094] 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 may include, but is not limited to, at least one of the following: a convolutional neural network (CNN) model, a recurrent neural network (RNN), a deep neural network (DNN), a generative adversarial network (GAN), a large-scale language model (LLMs), and a generative pre-trained transformer model (GPT).

[0095] In some examples, the AI ​​model may be a model trained with sample data. For example, the AI ​​model training process is: unsupervised pre-training on a large-scale corpus, and then fine-tuning on a specific task to achieve better results. For example, the specific task may be a text processing task for formula generation, etc.

[0096] In some examples, the AI ​​model may be a single model trained end-to-end. Or the AI ​​model may be a collection of multiple models. For example, the AI ​​model may include a text processing model, a formula generation model, etc. The text processing model and the formula generation model may be used in combination or in a cascaded manner.

[0097] In some examples, in the above step 102, the AI ​​model may perform semantic recognition on the target text, obtain the semantics of the target text, and determine a first formula for performing calculations based on the semantics of the target text when the target text involves calculations.

[0098] In some examples, obtaining the semantics of the target text by the AI ​​model may include: performing keyword extraction processing on the target text and performing semantic matching processing on the extracted keywords to obtain the semantics of the target text.

[0099] In some examples, when the target text does not involve calculation, the process can be ended.

[0100] In other examples, the target text can be processed based on the first model to obtain the calculation intent of the target text, and the calculation intent can be matched with the candidate formulas in the preset database, and the first formula can be determined according to the matching degree between the calculation intent and the candidate formula. In this example, the acquisition of the calculation intent, the matching of the calculation intent with the candidate formula, and the determination of the first formula can all be implemented using the same model.

[0101] In some examples, in the above step 102, a prompt word is constructed based on the processing of the target text, and a first formula for performing calculation is determined according to the prompt word.

[0102] Here, the prompt word can be used as a text prompt (or "instruction") input into the formula generation model to prompt or guide the formula generation model to determine the first formula for performing calculations, so that the formula generation model can output a more accurate first formula.

[0103] Exemplarily, the prompt word may include prompt data. For example, the prompt data may include semantic features, keywords or computational intents extracted from the target text, or the target text itself.

[0104] For example, semantic features, keywords, or computational intent may be extracted from the target text, and prompt words containing the semantic features, keywords, or computational intent may be generated based on a prompt word template.

[0105] For another example, the target text may be input into a preset prompt word template to obtain prompt words including the target text.

[0106] In some examples, determining a first formula for performing a calculation according to a prompt word may include:

[0107] The prompt word is input into the first model, and a first formula for performing calculation is determined based on the first model. In this example, the first model can be a formula generation model constructed based on a neural network and / or machine learning.

[0108] In other examples, constructing prompt words based on processing the target text, and determining a first formula for performing calculation according to the prompt words may include:

[0109] Inputting the target text into the first model for processing, and obtaining the computational intent output by the first model;

[0110] A prompt word is constructed according to the calculation intention, and the prompt word is input into the second model to obtain a first formula output by the second model.

[0111] In this example, the first model is a large-scale language model (LLMs) or a generative pre-trained transformer model (GPT). The second model is a dedicated model for formula generation or formula matching. For example, the second model can be a formula generation model built based on a neural network and / or machine learning.

[0112] In some examples, constructing a prompt word based on processing the target text, and determining a first formula for performing calculation according to the prompt word may include:

[0113] Based on the processing of the target text, the calculation intention of the target text is obtained; based on the calculation intention of the target text and the formula description of the candidate formula in the preset database, the prompt word is constructed;

[0114] The prompt word is input into the formula generation model, and a first formula for performing calculation is determined based on the formula generation model.

[0115] Here, considering that the number of alternative formulas in the preset database may be large, in order to reduce unnecessary calculations, at least one alternative formula whose matching degree with the calculation intent of the target text is greater than the preset matching degree can be screened out from the preset database, and then a prompt word can be constructed based on the calculation intent of the target text and the formula description of each screened alternative formula.

[0116] Exemplarily, inputting the prompt word into the formula generation model, and determining the first formula for performing calculation based on the formula generation model may include:

[0117] The prompt word is input into the formula generation model, the matching degree between the calculation intention of the target text and the candidate formula is determined based on the formula generation model, and the first formula is determined based on the matching degree between the calculation intention of the target text and the candidate formula.

[0118] For example, the first formula may be determined based on the candidate formula that has the highest degree of matching with the computational intent of the target text.

[0119] In this embodiment, the computational intent may represent the computational purpose of the target text.

[0120] Exemplarily, the calculation involved in the target text may be physical calculation, chemical calculation or mathematical calculation, etc.

[0121] For example, when the calculation involved in the target text is a chemical calculation, the first formula determined to perform the chemical calculation may be a chemical reaction equation.

[0122] Exemplarily, assuming that the calculation intention of the target text is: zinc reacts with concentrated sulfuric acid; the alternative formulas may include Formula 1 and Formula 2, the formula description of Formula 1 is: zinc reacts with dilute sulfuric acid, and the formula description of Formula 2 is: zinc reacts with concentrated sulfuric acid.

[0123] The prompt word template can be: calculation intent is "AAA", alternative formulas include: BBB, please calculate the matching degree of each alternative formula with the calculation intent, and display it in a list. After the prompt word is input into the formula generation model, a list containing the matching degree of the calculation intent and each alternative formula can be output based on the formula generation model.

[0124] In some embodiments, the prompt word template is updated according to the candidate formulas and their formula descriptions in a preset database.

[0125] For example, in the above example, the preset database includes: Formula 1 is described as "Zinc reacts with dilute sulfuric acid", Formula 2 is described as "Zinc reacts with concentrated sulfuric acid", then the prompt word template can be: the calculation intent is "AAA", and the alternative formulas include: Formula 1 is described as "Zinc reacts with dilute sulfuric acid", Formula 2 is described as "Zinc reacts with concentrated sulfuric acid", please calculate the matching degree of each alternative formula with the calculation intent, and display it in a list. After the prompt word is input into the formula generation model, a list containing the matching degree of the calculation intent and each alternative formula can be output based on the formula generation model.

[0126] Furthermore, based on the processing of the target text, the calculation intention of the target text is obtained; based on the calculation intention of the target text and the formula description of the candidate formula in the preset database, the prompt word is constructed.

[0127] For example, if the calculation intent is "zinc reacts with concentrated sulfuric acid", the constructed prompt word can be expressed as: the calculation intent is "zinc reacts with concentrated sulfuric acid", and the alternative formulas include: the formula description of formula 1 is "zinc reacts with dilute sulfuric acid", and the formula description of formula 2 is "zinc reacts with concentrated sulfuric acid". Please calculate the matching degree of each alternative formula with the calculation intent and display it in a list. After the prompt word is input into the formula generation model, a list containing the matching degree of the calculation intent and each alternative formula can be output based on the formula generation model.

[0128] In some examples, the first formula may be obtained by logically combining N calculation formulas, where the N calculation formulas respectively correspond to N calculation steps involved in the calculation intent of executing the target text; N is a positive integer greater than or equal to 1.

[0129] In this example, if the calculation intention involves multiple calculation steps, the calculation formulas corresponding to the N calculation steps involved in the calculation intention can be determined from the preset data based on the prompt words, and then the N calculation formulas can be logically combined according to the execution order of the corresponding calculation steps to obtain the first formula.

[0130] The disclosed embodiment provides a document processing method, which receives a target text input based on a first interface, determines a first formula for performing calculations based on processing of the target text, and applies the first formula to editing of a target area in a second interface. In this way, there is no need for a user to manually edit a formula using a formula editor for an editable document, thereby achieving automatic acquisition of formulas, reducing the user's workload for editing formulas, and greatly improving document processing efficiency.

[0131] In one embodiment, Figure 2 As shown, in the above step 102, the first formula for performing calculation is determined based on the processing of the target text, including:

[0132] 201: Processing a target text using a first model to determine whether the target text involves calculation;

[0133] 202: In response to the target text involving calculation, determine the first formula based on a second model.

[0134] In some examples, the first model may be a natural language processing model. The second model may be a formula generation model built based on a neural network and / or machine learning.

[0135] For example, the first model performs intent recognition on the target text, determines whether the target text involves calculation based on the intent recognition result of the target text, and then the second model determines the first formula for executing the calculation when the target text involves calculation.

[0136] Exemplarily, the natural language processing capability of the first model is stronger than that of the second model, and the formula processing capability of the second model is stronger than that of the first model.

[0137] In some examples, processing the target text using the first model to determine whether the target text involves calculation includes:

[0138] Extracting semantic features of the target text and semantic features of each word in the target text using the first model;

[0139] Whether the target text involves calculation is determined according to the semantic features of the target text and the semantic features of each word in the target text.

[0140] In some examples, determining whether the target text involves calculation according to the semantic features of the target text and the semantic features of each word in the target text may include:

[0141] According to the semantic features of the target text and the semantic features of each word in the target text, keywords are extracted from the target text, and it is determined whether the target text involves calculation according to the extracted keywords.

[0142] For example, determining whether the target text involves calculation based on the extracted keywords may include:

[0143] Obtain the textual intent of the target text based on the extracted keywords;

[0144] If the text intent is a calculation intent, it is determined that the target text involves calculation; if the text intent is not a calculation intent, it is determined that the target text does not involve calculation.

[0145] For another example, determining whether the target text involves calculation based on the extracted keywords may include:

[0146] When it is determined that the extracted keywords match the keywords corresponding to the preset calculation intent, it is determined that the target text involves calculation; when it is determined that the extracted keywords do not match the keywords corresponding to the preset calculation intent, it is determined that the target text does not involve calculation.

[0147] In some other examples, determining whether the target text involves calculation according to the semantic features of the target text and the semantic features of each word in the target text may include:

[0148] The semantic features of the target text and the semantic features of each word in the target text are input into a pre-trained intent classification model for classification processing, and when the intent classification model outputs information indicating a computational intent, it is determined that the target text involves computation. The intent classification model may be a neural network model, and the intent classification model is used to determine the text intent.

[0149] In one embodiment, a model volume of the second model is smaller than a model volume of the first model.

[0150] For example, the first model is a large language model (LLM), and the second model is a dedicated model for determining a formula. The dedicated model may be a formula generation model constructed based on a neural network and / or machine learning.

[0151] For example, the second model is a lightweight model for determining a formula, and the first model is a pre-trained model for natural language processing. The second model is a lightweight model, so that the second model can reduce the size and amount of calculation of the model while maintaining the model performance.

[0152] In this embodiment, the target text is processed by using the first model to determine whether the target text involves calculation. In response to the target text involving calculation, the first formula is determined based on the second model. Since different models have different processing capabilities, the combined use of models can improve the accuracy of the determined first formula compared to using a single model, so that the first formula applied to the document can better achieve the user's expected effect.

[0153] In one embodiment, in the above step 202, in response to the target text involving calculation, determining the first formula based on the second model may include:

[0154] In response to the target text involving calculation, a first prompt word is constructed according to a first calculation intention extracted from the target text by a first model, and the first prompt word is input into a second model to obtain a first formula output by the second model.

[0155] Here, the first calculation intention may include first information for determining the first formula.

[0156] For example, the first information may include the name of the first formula, or the first information may include keywords related to the calculation steps (or calculation logic) of the first formula.

[0157] In some examples, the first computing intent extracted from the target text by the first model may include a keyword intent group used to represent a computing step, and one keyword intent group is used to determine a computing formula corresponding to the computing step represented by the keyword intent group.

[0158] For example, if the calculation involved in the target text has N calculation steps, the first calculation intention includes N intention keyword groups, and the nth intention keyword group among the N intention keyword groups is used to determine the calculation formula of the nth calculation step among the N calculation steps, and n is a positive integer less than or equal to N.

[0159] In this embodiment, the calculation process involved in the target text can be decomposed into several calculation steps, and one calculation step is represented by an intention keyword group in the first calculation intention. An intention keyword group may include one or more intention keywords.

[0160] For example, the text input by the user on the first interface is "Calculate the kinetic energy generated by an object with a mass of m after an initial velocity of V0, an acceleration of a, and movement time t". The first calculation intent obtained by the first model after processing the text may include two intent keyword groups. The intent keywords included in one intent keyword group are: "acceleration" and "speed", and the intent keywords included in the other intent keyword group are: "speed" and "kinetic energy".

[0161] It is understandable that in some cases, the calculation involved in the target text may only involve one calculation step, that is, there is only one calculation formula required to process the target text. For example, the text entered by the user in the first interface is "calculate the speed of an object with a mass of m after an initial speed of V0, an acceleration of a, and a movement time of t", and the first calculation intent obtained by the first model after processing the text includes an intent keyword group, and the intent keywords included in the intent keyword group are "acceleration" and "speed".

[0162] In some examples, constructing a first prompt word according to a first computing intent extracted from a target text by a first model may include: constructing a first prompt word according to N intent keyword groups in the first computing intent.

[0163] For example, the first prompt word can be constructed according to the N intention keyword groups in the first computing intention and a preset prompt word template; or, the prompt data corresponding to each of the N intention keyword groups in the first computing intention can be determined, and the prompt data corresponding to each of the N intention keyword groups can be sequentially spliced ​​to form the first prompt word.

[0164] In some examples, the first prompt word is input into the second model to obtain a first formula output by the second model, including:

[0165] Inputting the first prompt word into the second model, and generating a first formula according to the prompt word through the second model;

[0166] Alternatively, the second model is used to match the first calculation intention with each candidate formula in the formula library based on the first prompt word, and the first formula is output based on the matched calculation formula.

[0167] Here, the second model may be a formula generation model.

[0168] In some examples, in response to the first prompt word lacking target prompt data, prompt information is output to prompt supplementary text input about the target prompt data. Here, the target prompt data may be key information for determining the first formula.

[0169] In this embodiment, the first model can be used to extract the first calculation intent from the target text, and a first prompt word can be constructed based on the first calculation intent. The first prompt word is input into the second model, and the second model processes the first prompt word to output the first formula. In this way, by using the combination of models, the accuracy of the determined first formula can be improved compared to using a single model, so that the first formula applied to the document can better achieve the expected effect of the user.

[0170] In one embodiment, Figure 3 As shown, in the above step 202, determining the first formula for performing calculation based on processing the target text may include:

[0171] 301: Obtaining a second computing intent of the target text based on processing the target text;

[0172] 302: constructing a second prompt word according to the second calculation intention and the formula description of the candidate formula in the preset database;

[0173] 303: Determine, according to the second prompt word, a matching degree between the second calculation intention and the candidate formula;

[0174] 304: Determine the first formula according to the matching degree between the second calculation intention and the candidate formula.

[0175] In some examples, the preset database may include alternative formulas in one or more computing fields, which may include but are not limited to: computational physics, computational chemistry, computational economics, computational materials science, finance and insurance, etc.

[0176] In some examples, the formula description of each candidate formula includes one or more keywords.

[0177] The keywords included in the formula description of the candidate formula may include at least one of the following:

[0178] The formula name of the alternative formula;

[0179] Synonyms for the formula names of alternative formulas;

[0180] Functional keywords of alternative formulas;

[0181] Synonyms for the function keywords of the alternative formula.

[0182] In some examples, function keywords may include formula parameter names.

[0183] In some examples, in step 301, intent recognition may be performed on the target text to obtain a second computing intent of the target text.

[0184] For example, the target text is subjected to intent recognition to determine whether the target text involves calculation, and a second calculation intent is obtained when the target text involves calculation.

[0185] In some examples, the second calculated intent includes at least one intent keyword group.

[0186] For example, the second calculation intention includes N intention keyword groups, and the nth intention keyword group among the N intention keyword groups is used to determine the calculation formula of the nth calculation step among N calculation steps, and n is a positive integer less than or equal to N.

[0187] In step 302, a second prompt word may be constructed according to each intention keyword group included in the second calculation intention and a formula description of an alternative formula in a preset database.

[0188] In step 303, the second prompt word may be input into the formula generation model to obtain the matching degree between the second calculation intention output by the formula generation model and the candidate formula.

[0189] Here, the matching degree between the second calculation intention and the candidate formula can be characterized as the similarity between the second calculation intention and the formula description of the candidate formula.

[0190] Here, the formula generation model can be used to match each intent keyword group included in the second calculation intention with the alternative formulas in the preset database according to the second prompt word, and obtain the matching degree of each intent keyword group included in the second calculation intention with different alternative formulas. In some examples, in step 304, the alternative formula with the highest matching degree for each intent keyword group can be determined based on the matching degree of each intent keyword group included in the second calculation intention with the alternative formula, and the first formula can be determined based on the alternative formula with the highest matching degree for each intent keyword group.

[0191] Exemplarily, determining the first formula according to the alternative formula with the highest matching degree for each intended keyword group may include:

[0192] The alternative formulas with the highest matching degree for each intended keyword group are logically combined to obtain the first formula.

[0193] For example, the second calculation intent includes the first intent keyword group and the second intent keyword group. For example, the first intent keyword group includes "acceleration" and "speed", and the second intent keyword group includes "speed" and "kinetic energy". The alternative formula with the highest matching degree of the first intent keyword group can be v t =v0+a*t,vt is the speed at time t, v0 is the initial speed, and a is the acceleration; the alternative formula with the highest matching degree of the second intention keyword group can be E k =mv 2 / 2. E k is the kinetic energy, m is the mass of the object, and v is the velocity; then the first formula can be determined as: E k =m(v0+a*t) 2 / 2.

[0194] In this embodiment, a second prompt word is constructed according to the second calculation intention of the target text and the formula description of the alternative formula in the preset database, and the matching degree between the second calculation intention and the alternative formula is determined according to the second prompt word. In this way, the matching degree between the calculation intention and the alternative formula is determined in the form of prompt words, and the first formula is determined according to the matching degree, so that the first formula is more accurate and more in line with the user's calculation intention.

[0195] In one embodiment, Figure 4 As shown, in the above step 303, determining the first formula according to the matching degree between the second calculation intention and the formula description of the candidate formula may include:

[0196] 401: In response to the absence of an alternative formula that completely matches the second calculation intent, determining a matching degree between each alternative formula and the second calculation intent;

[0197] 402: Determine a first formula based on at least one candidate formula with the highest matching degree.

[0198] In some examples, the existence of an alternative formula that completely matches the second calculation intent can be: there are alternative formulas that completely match the N intent keyword groups included in the second calculation intent, that is, there is an alternative formula that completely matches each of the N intent keyword groups.

[0199] In some examples, the absence of an alternative formula that fully matches the second calculation intent may mean that at least one intent keyword group included in the second calculation intent has an alternative formula that does not fully match.

[0200] The degree of match between the intent keyword group and the alternative formula can be determined based on the degree of match between the intent keywords included in the intent keyword group and the keywords included in the formula description of the alternative formula.

[0201] In some examples, step 401 may include: for each intent keyword group of the second computing intent, determining the degree of match between the intent keywords included in the intent keyword group and the keywords included in the formula description of each alternative formula.

[0202] For example, if each of the intent keywords included in the first intent keyword group has a completely matched keyword in the keywords included in the first formula description, then the first intent keyword group completely matches the first formula description, otherwise, the first intent keyword group does not completely match the first formula description. The first intent keyword group can be any intent keyword group of the second calculation intent, and the first formula description can be any formula description of an alternative formula in a preset database, or the first formula description can also be a formula description of an alternative formula in a preset database whose matching degree with the first intent keyword group is greater than a preset matching degree.

[0203] When an intent keyword group completely matches the formula description of an alternative formula, the intent keyword group also completely matches the alternative formula; when an intent keyword group does not completely match the formula description of an alternative formula, the intent keyword group also does not completely match the alternative formula.

[0204] In some examples, the degree of match between any intent keyword and a keyword included in the formula description may be determined based on the Euclidean distance and / or the normal form distance, etc., between the intent keyword and the keyword included in the formula description.

[0205] In some examples, step 402 may include:

[0206] For the nth intention keyword group of the second calculation intention, the candidate formula to which the formula description having the highest matching degree with the nth intention keyword group belongs can be determined according to the matching degree between the intention keywords included in the nth intention keyword group and the keywords included in the formula description of each candidate formula;

[0207] Determine the candidate formula to which the formula description with the highest degree of matching with the nth intention keyword group belongs as the candidate formula matching the nth intention keyword group;

[0208] According to the execution order of the calculation steps represented by each intention keyword group of the second calculation intention, the alternative formulas respectively matched by all the intention keyword groups of the second calculation intention are logically combined to obtain the first formula.

[0209] In this embodiment, when there is no formula description that completely matches the second calculation intention, the first formula is determined based on at least one alternative formula with the highest degree of match. In this way, the first formula determined by using at least one alternative formula with the highest degree of match with the second calculation intention can be more in line with the user's calculation intention, and the first formula provided by the second model can also be more accurate.

[0210] In some examples, for the N intent keyword groups of the second calculation intent, if all of the N intent keyword groups have formula descriptions of completely matching alternative formulas, the completely matching alternative formulas of each of the N intent keyword groups are logically combined to obtain a first formula.

[0211] In some examples, for the N intent keyword groups of the second calculation intent, if m intent keyword groups of the N intent keyword groups have a formula description of a completely matching candidate formula, and Nm intent keyword groups do not have a formula description of a completely matching candidate formula, after modifying the candidate formula with the highest matching degree of the Nm intent keyword groups, they are logically combined with the completely matching candidate formula of the m intent keyword groups to form a first formula. Wherein, m is a positive integer greater than or equal to 1 and less than N.

[0212] In one embodiment, in the above step 402, determining the first formula based on at least one candidate formula with the highest matching degree may include:

[0213] Displaying the N candidate formulas with the highest matching degree, formula descriptions of the candidate formulas and / or first prompt information in the first interface, wherein the first prompt information is used to prompt modification suggestions for the candidate formulas, or to prompt the difference between the second calculation intention and the formula description of the candidate formula; N is a positive integer;

[0214] A first formula is determined based on a modification operation applied to any one of the displayed candidate formulas.

[0215] In some examples, the nth candidate formula among N candidate formulas may be the candidate formula that has the highest degree of match with the nth intent keyword group among N intent keyword groups included in the second calculation intent, where n is a positive integer less than or equal to N.

[0216] The first prompt information may be displayed in a dialog panel or a dialog box, etc. The dialog panel or the dialog box may be located in the first interface.

[0217] The first prompt information provides modification suggestions for the alternative formula, or indicates the difference between the second calculation intention and the formula description of the alternative formula, so that the user can modify the alternative formula according to the modification suggestions or differences provided by the first prompt information.

[0218] In one embodiment, the modification operation includes: a modification operation input by a user; or a modification operation determined based on a natural language input by the user.

[0219] In some examples, the modification operation may include a modification operation input by a user. For example, after the user selects an alternative formula, the user may click a modification control for modifying the alternative formula to directly modify the alternative formula.

[0220] In other examples, the modification operation may include a modification operation determined based on natural language input by the user.

[0221] For example, after the user selects an alternative formula, a dialog box pops up, and based on the natural language received in the dialog box, a modification operation for the selected alternative formula is determined. Here, the natural language can be a modification requirement description input by the user in text form or voice form.

[0222] In some examples, the modification operation can be used to modify mathematical symbols, numbers, expressions, variables and / or operators in the candidate formula. For example, the modification operation is used to modify the first variable in the candidate formula to the second variable.

[0223] In one embodiment, the first formula may be determined by the second model based on a modification operation applied to any one of the displayed candidate formulas.

[0224] The second model may be an AIGC (Artificial Intelligence Generated Content) model, for example, a ChatGPT (Chat Generative Pre-trained Transformer) model. Here, the ChatGPT model is a Transformer-based language generation model trained with multilingual big data.

[0225] In this embodiment, by displaying the N alternative formulas with the highest degree of matching, formula descriptions of the alternative formulas and / or first prompt information in the first interface, and determining the first formula based on a modification operation performed on any displayed alternative formula, the modified alternative formula can be made to meet the user's intention, thereby improving the accuracy of the first formula.

[0226] In one embodiment, in the above step 402, determining the first formula based on at least one candidate formula with the highest matching degree may include:

[0227] Determine the difference between the formula description of the candidate formula with the highest matching degree and the second calculation intention;

[0228] The alternative formula is modified according to the difference to obtain the first formula.

[0229] In some examples, the second calculation intent includes N intent keyword groups, and the alternative formulas with the highest matching degree include N alternative formulas; the alternative formula with the highest matching degree with the nth intent keyword group among the N intent keyword groups is the nth alternative formula among the N alternative formulas.

[0230] In some examples, determining the difference between the formula description of the candidate formula with the highest matching degree and the second calculation intent may include:

[0231] For the nth candidate formula with the highest matching degree, the difference between the nth intent keyword group and the formula description of the nth candidate formula is determined in the N intent keyword groups of the second calculation intent.

[0232] The difference between the nth intention keyword group and the formula description of the nth candidate formula may be: the difference between the nth intention keyword group and the formula description of the nth candidate formula (eg, Euclidean distance and / or normal form distance).

[0233] In some examples, modifying the alternative formula according to the difference to obtain the first formula may include:

[0234] According to the difference between the formula description of the nth intention keyword group and the nth candidate formula, the nth candidate formula is modified, and the modified nth candidate formula is logically combined with the unmodified candidate formulas among the N candidate formulas to obtain the first formula.

[0235] Here, logically combining the modified nth alternative formula with the unmodified alternative formulas among the N alternative formulas to obtain the first formula may include: logically combining the modified nth alternative formula with the unmodified alternative formulas among the N alternative formulas according to the calling relationship between the N alternative formulas to generate the first formula.

[0236] Here, the calling relationship between the N alternative formulas can be determined according to the calculation steps represented by each of the N intention keyword groups in the second calculation intent. In this embodiment, by determining the difference between the formula description of the alternative formula with the highest matching degree and the second calculation intent, and modifying the formula parameters in the alternative formula according to the difference, so that the modified alternative formula meets the calculation intent, the first formula is obtained based on the modified alternative formula, which can better meet user needs.

[0237] In one embodiment, Figure 5 As shown, in the above step 302, determining the first formula according to the matching degree between the second calculation intention and the formula description of the candidate formula may include:

[0238] 501: In response to there being multiple candidate formulas that completely match the second calculation intention, outputting second prompt information in the first interface, wherein the second prompt information is used to prompt input of instruction information for selecting a target formula from the candidate formulas, and the target formula is used to determine the first formula;

[0239] 502: Determine a first formula according to an input operation based on the second prompt information.

[0240] In this embodiment, the second prompt information may be displayed in a dialog panel or a dialog box in the first interface.

[0241] In some examples, the second calculation intent includes N intent keyword groups, and in response to the complete matching alternative formulas of the nth intent keyword group among the N intent keyword groups including M alternative formulas, the second prompt information is output in the first interface; n is a positive integer greater than or equal to 1 and less than or equal to N. M is a positive integer greater than or equal to 1.

[0242] In some examples, there are m intention keyword groups among N intention keyword groups with multiple fully matched alternative formulas, and each of the Nm intention keyword groups has only one fully matched alternative formula or no fully matched alternative formula. In this case, the second prompt information can be output in the first interface only for the m intention keyword groups with multiple fully matched alternative formulas. Wherein, m is an integer greater than or equal to 1 and less than or equal to N.

[0243] In some examples, the input operation based on the second prompt information may include: a selection operation input by the user, or a selection operation determined based on a natural language input by the user.

[0244] For example, determining a selection operation based on a natural language input by a user may include: determining a selected candidate formula from a plurality of candidate formulas based on a natural language received in a dialog box in the first interface. Here, the natural language may include a formula description and / or number information of the candidate formula input by the user in text form or voice form.

[0245] In some examples, the implementation process of step 502 may include:

[0246] Among the N intent keyword groups of the second calculation intent, there are m intent keyword groups with multiple completely matched candidate formulas, and based on the input operation of the second prompt information, a target formula selected from the M candidate formulas that completely match the nth intent keyword group among the m intent keyword groups is determined;

[0247] A first formula is determined based on a target formula that fully matches each of the m intention keyword groups and an alternative formula that matches each of the Nm intention keyword groups.

[0248] The candidate formulas that match each of the Nm intention keyword groups may include: an candidate formula that fully matches each of the Nm intention keyword groups, or an alternative formula with the highest degree of match when there is an incomplete match.

[0249] For example, the second calculation intention includes intention keyword group A and intention keyword group B. The alternative formulas that fully match intention keyword group A include alternative formula a and alternative formula b. The alternative formula that fully matches intention keyword group B is alternative formula c. After the user selects alternative formula a from alternative formula a and alternative formula b as the target formula that fully matches intention keyword group A, alternative formula a and alternative formula c can be logically combined to form a first formula.

[0250] The second prompt information may prompt input of instruction information for selecting a target formula from alternative formulas, and the target formula may be used to determine the first formula, so that the user may modify the alternative formula according to actual needs or directly select the target formula for determining the first formula from the alternative formulas, so that the first formula can meet the actual needs of the user.

[0251] In one embodiment, Figure 6 As shown, in the above step 202, in response to the target text involving calculation, determining the first formula based on the second model may include:

[0252] 601: In response to the target text involving calculation, determining a third calculation intention based on the second model;

[0253] 602: Generate a first formula according to the third calculation intention.

[0254] In some examples, the second model can extract the third calculation intent from the target text, determine at least one calculation formula based on the calculation steps involved in the third calculation intent, and generate the first formula based on the calling relationship of the at least one calculation formula.

[0255] In one embodiment, the first formula may be modified by the second model according to a modification operation acting on the first formula.

[0256] The second model may be an AIGC model, for example, a ChatGPT model.

[0257] In some examples, the modification operation may include a modification operation determined based on natural language input by the user.

[0258] For example, after the second model outputs the first formula, a dialog box may pop up to receive natural language for modifying the first formula. Here, the natural language may be a description of the modification requirement input by the user in text form or voice form.

[0259] In some examples, the modification of the first formula by the second model may include modification of mathematical symbols, numbers, variables and / or operators in the first formula. For example, the second model modifies the first variable in the first formula into the second variable.

[0260] In this way, the generated first formula is modified through the second model so that the modified first formula can meet the user's intention, thereby improving the user's usage experience.

[0261] In this embodiment, the second model is used to generate the first formula based on the calculation intent involved in the target text, which eliminates the need for users to manually edit the formula, achieves automatic acquisition of the formula, and can improve document processing efficiency.

[0262] In some embodiments, the third computing intent can be interchangeable with the first computing intent, the second computing intent, and the computing intent.

[0263] In some embodiments, Figure 7 As shown, in the above step 102, determining the first formula for performing calculation based on processing the target text may include:

[0264] 701: Process the target text using the first model to generate a second formula for performing calculation;

[0265] 702: Match the second formula with candidate formulas in a preset database;

[0266] 703: Determine the first formula according to the matching degree between the second formula and the candidate formula.

[0267] In some examples, in step 701, the first model may be used to extract the calculation intent from the target text, and a second formula for performing the calculation may be generated according to the calculation intent. The second formula may be obtained by logically combining N calculation formulas, where the N calculation formulas correspond to N calculation steps involved in executing the calculation intent of the target text.

[0268] Here, the first model may be the formula generation model in the aforementioned embodiment.

[0269] Here, when the target text involves a relatively complex calculation task, there is a dependency or calling relationship between the calculation formulas used to respectively execute the N calculation steps involved in the target text. In this case, it is necessary to logically combine the calculation formulas for respectively executing the N calculation steps according to the execution order of the N calculation steps to generate a second formula.

[0270] In some examples, in step 702, the first model may be used to match each of the N calculation formulas included in the second formula with an alternative formula in a preset database.

[0271] In some examples, in step 703, the second formula may be modified to the first formula according to the degree of matching between each calculation formula included in the second formula and the candidate formula.

[0272] For example, based on the degree of matching between each calculation formula contained in the second formula and the alternative formula, without modifying the first calculation formula contained in the second formula that completely matches the first alternative formula, the second calculation formula contained in the second formula that does not completely match the second alternative formula is modified to the second alternative formula to obtain the first formula.

[0273] In this embodiment, by using the first model to automatically generate the formula, automatic acquisition of the formula is achieved, reducing the workload of the user in editing the formula.

[0274] In one embodiment, Figure 8 As shown, before the above step 103 is performed, the method may further include:

[0275] 801: Demonstrate a calculation example in the first interface or the second interface according to the first formula;

[0276] 802: Determine whether to apply the first formula to the editing of the target area in the second interface according to the feedback operation acting on the calculation example.

[0277] In some examples, in step 801, a calculation example may be demonstrated in the first interface or the second interface according to the calculation steps involved in the first formula. For example, if the first formula is obtained by combining N calculation formulas, then the first formula involves N calculation steps.

[0278] For example, the feedback operation may be a manual operation and / or voice operation performed by a user on the computing paradigm.

[0279] For example, the feedback operation may be a user operation on an "OK" and / or "Cancel" control.

[0280] The feedback operation may include a confirmation operation, and / or a denial operation.

[0281] Exemplarily, the feedback operation may include but is not limited to at least one of the following: a confirmation operation, indicating that the first formula is applied to the editing of the target area in the second interface, that is, the first formula is a valid formula; a denial operation, indicating that the first formula is not applied to the editing of the target area in the second interface, that is, the first formula is an invalid formula.

[0282] In this embodiment, by demonstrating a computing example in the first interface or demonstrating a computing example in the second interface, the friendliness of the interaction between the first interface or the second interface and the user can be improved by utilizing the demonstration of the computing example and the execution of feedback operations.

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

[0284] Detecting edit operations acting on computational examples;

[0285] According to the editing operation, the first formula is updated to obtain an edited second formula applied to the target area.

[0286] Exemplarily, an editing operation acting on a calculation example is detected, edited formula parameters in a first formula are determined, and according to the editing result of the edited formula parameters, the first formula is updated to obtain an edited second formula applied to a target area.

[0287] The editing operation may include modifying, deleting or adding formula parameters to the first formula.

[0288] In this embodiment, the first formula is updated according to the editing operation acting on the calculation example to obtain the second formula applied to the editing of the target area, so that the second formula can better meet the document editing needs of the user.

[0289] In one embodiment, in the above step 802, determining whether to apply the first formula to the editing of the target area in the second interface according to the feedback operation acting on the calculation example includes:

[0290] In response to detecting a confirmation feedback operation acting on the calculation example, a determination is made to apply the first formula to the edit of the target area in the second interface.

[0291] Exemplarily, the feedback operation may be a manual operation and / or voice operation performed by the user on the second prompt information.

[0292] For example, the second prompt information is displayed in the form of a dialog box, and the feedback operation may be a user operation acting on an "OK" and / or "Cancel" control in the dialog box.

[0293] The feedback operation may include a confirmation operation to confirm the execution, and / or a denial operation to cancel the execution.

[0294] In this way, according to the feedback operation acting on the second prompt information, erroneous operations are reduced and the execution quality of the target task is improved.

[0295] In one embodiment, in the above step 103, applying the first formula to the editing of the target area in the second interface includes one of the following:

[0296] Write the first formula into the target area;

[0297] The numerical value in the target area is calculated based on the first formula to obtain a calculation result displayed in the target area.

[0298] Exemplarily, when a preset operation is detected, the first formula is written into the target area. For example, the preset operation may be an operation in which the user drags the first formula displayed on the first interface into the target area.

[0299] Exemplarily, in response to a selection operation on the text content of the target area, the first formula may be used to calculate the numerical value in the selected text content to obtain a calculation result displayed in the target area.

[0300] Here, the calculation result obtained by calculating the numerical value in the target area based on the first formula can be used to verify the first formula. For example, if the calculation result verifies that the first formula is wrong, it indicates that the first formula is invalid, and if the calculation result verifies that there is no error in the first formula, it can be indicated that the first formula is valid.

[0301] In this embodiment, by writing the first formula into the target area in the second interface and calculating the numerical value in the target area based on the first formula, the calculation result displayed in the target area is obtained. On the one hand, the usability of the first formula can be ensured; on the other hand, the document processing efficiency can be improved.

[0302] Fig. 9 A schematic diagram of the structure of a document processing device provided by an embodiment of the present disclosure is shown. Fig. 9 As shown, the document processing device 100 includes:

[0303] A receiving module 110, configured to receive a target text input based on the first interface;

[0304] A determination module 120, configured to determine a first formula for performing calculation based on processing of the target text;

[0305] The processing module 130 is used to apply the first formula to edit the target area in the second interface.

[0306] In one embodiment, the determination module 120 includes:

[0307] a determination unit, configured to process the target text using a first model to determine whether the target text involves calculation;

[0308] The second determining unit is configured to determine the first formula based on a second model in response to the target text involving calculation.

[0309] In one embodiment, a model volume of the second model is smaller than a model volume of the first model.

[0310] In one embodiment, the second determining unit is configured to:

[0311] In response to the target text involving calculation, constructing a first prompt word according to a first calculation intention extracted from the target text by the first model, and inputting the first prompt word into the second model to obtain the first formula output by the second model;

[0312] or,

[0313] In response to the target text involving calculation, the target text is input into the second model to obtain the first formula output by the second model.

[0314] In one embodiment, the second determining unit is configured to:

[0315] Based on the processing of the target text, obtaining a second computing intent of the target text;

[0316] Constructing a second prompt word according to the second calculation intention and the formula description of the candidate formula in the preset database;

[0317] Determining, according to the second prompt word, a degree of matching between the second calculation intention and the candidate formula;

[0318] The first formula is determined according to the degree of matching between the second calculation intention and the alternative formula.

[0319] In one embodiment, the second determining unit is configured to:

[0320] In response to the absence of an alternative formula that completely matches the second calculation intent, determining a degree of matching between each of the alternative formulas and the second calculation intent;

[0321] The first formula is determined based on at least one of the candidate formulas with the highest matching degree.

[0322] In one embodiment, the second determining unit is configured to:

[0323] Displaying the N candidate formulas with the highest matching degree, formula descriptions of the candidate formulas and / or first prompt information in the first interface, wherein the first prompt information is used to prompt modification suggestions for the candidate formulas, or to prompt the difference between the second calculation intention and the formula description of the candidate formula; N is a positive integer;

[0324] The first formula is determined according to a modification operation applied to any one of the displayed candidate formulas.

[0325] In one embodiment, the modification operation includes: a modification operation input by a user; or a modification operation determined based on a natural language input by the user.

[0326] In one embodiment, the second determining unit is configured to:

[0327] Determine the difference between the formula description of the candidate formula with the highest matching degree and the second calculation intention;

[0328] The candidate formula is modified according to the difference to obtain the first formula.

[0329] In one embodiment, the second determining unit is configured to:

[0330] In response to there being multiple candidate formulas that completely match the second calculation intention, outputting second prompt information in the first interface, wherein the second prompt information is used to prompt input of instruction information for selecting a target formula from the candidate formulas, and the target formula is used to determine the first formula;

[0331] The first formula is determined according to an input operation based on the second prompt information.

[0332] In one embodiment, the second determining unit is configured to:

[0333] In response to the target text involving calculation, determining a third calculation intention based on the second model;

[0334] The first formula is generated according to the third calculation intention.

[0335] In one embodiment, the determining module 120 is used to:

[0336] Processing the target text using the first model to generate a second formula that performs a calculation;

[0337] Matching the second formula with candidate formulas in a preset database;

[0338] The first formula is determined according to the degree of matching between the second formula and the candidate formula.

[0339] In one embodiment, the processing module 130 is further configured to:

[0340] Demonstrating a calculation example in the first interface or the second interface according to the first formula;

[0341] According to the feedback operation acting on the calculation example, it is determined whether to apply the first formula to the editing of the target area in the second interface.

[0342] In one embodiment, the processing module 130 is further configured to:

[0343] detecting an edit operation acting on the computing instance;

[0344] According to the editing operation, the first formula is updated to obtain an edited second formula applied to the target area.

[0345] In one embodiment, the processing module 130 is further configured to:

[0346] In response to detecting a confirmation feedback operation acting on the calculation example, it is determined to apply the first formula to the editing of the target area in the second interface.

[0347] In one embodiment, the processing module 130 is configured to perform one of the following:

[0348] Writing the first formula into the target area;

[0349] The numerical value in the target area is calculated based on the first formula to obtain a calculation result displayed in the target area.

[0350] 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 embodiment of the document processing method, and will not be elaborated here.

[0351] An embodiment of the present disclosure further provides an electronic device, including:

[0352] processor;

[0353] a memory for storing processor-executable instructions;

[0354] The processor is configured to implement the document processing method of any embodiment of the present disclosure when running the executable instructions.

[0355] The electronic device can at least be a server and / or a terminal. One or more servers can constitute the server.

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

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

[0358] like Fig.10 , a structure of an electronic device 900 is shown according to an exemplary embodiment. For example, the electronic device 900 may be provided as a network side device. Fig.10 The electronic device 900 includes a processing component 922, which further includes one or more processors, and a memory resource represented by a memory 932 for storing instructions that can be executed by the processing component 922, such as an application. The application stored in the memory 932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 922 is configured as an executable program to execute the document processing method provided in any of the above embodiments.

[0359] The electronic device 900 may also include a power supply component 926 configured to perform power management of the electronic device 900, a wired or wireless network interface 950 configured to connect the electronic device 900 to a network, and an input / output (I / O) interface 958. The electronic device 900 may operate based on an operating system stored in the memory 932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0360] In an exemplary embodiment, an embodiment of the present disclosure 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 of the above embodiments is implemented.

[0361] The computer-readable storage medium may specifically be: a non-temporary computer-readable storage medium.

[0362] Exemplarily, for example, the memory 932 includes an executable program, and the above instructions can be executed by the processing component 922 of the electronic device 900 to complete the above method.

[0363] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

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

[0365] It should be understood that the embodiments of the present disclosure are not limited to the precise structures described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the embodiments of the present disclosure is limited only by the appended claims.

Claims

1. A document processing method, characterized in that: The method comprises: receiving a target text input based on the first interface; Determining a first formula for performing a calculation based on processing the target text; The first formula is applied to editing the target area in the second interface.

2. The method according to claim 1, characterized in that The step of determining a first formula for performing calculation based on processing the target text comprises: Process the target text using a first model to determine whether the target text involves calculation; In response to the target text involving a calculation, the first formula is determined based on a second model.

3. The method according to claim 2, characterized in that In response to the target text involving calculation, determining the first formula based on a second model includes: In response to the target text involving calculation, constructing a first prompt word according to a first calculation intention extracted from the target text by the first model, and inputting the first prompt word into the second model to obtain the first formula output by the second model; or, In response to the target text involving calculation, the target text is input into the second model to obtain the first formula output by the second model.

4. The method according to claim 1, characterized in that: The step of determining a first formula for performing calculation based on processing the target text comprises: Based on the processing of the target text, obtaining a second computing intent of the target text; Constructing a second prompt word according to the second calculation intention and the formula description of the candidate formula in the preset database; Determining, according to the second prompt word, a degree of matching between the second calculation intention and the candidate formula; The first formula is determined according to the degree of matching between the second calculation intention and the alternative formula.

5. The method according to claim 4, characterized in that The determining the first formula according to the matching degree between the second calculation intention and the candidate formula includes: In response to the absence of an alternative formula that completely matches the second calculation intent, determining a degree of matching between each of the alternative formulas and the second calculation intent; The first formula is determined based on at least one of the candidate formulas with the highest matching degree.

6. The method according to claim 5, characterized in that The determining the first formula based on at least one candidate formula with the highest matching degree comprises: Displaying the N candidate formulas with the highest matching degree, formula descriptions of the candidate formulas and / or first prompt information in the first interface, wherein the first prompt information is used to prompt modification suggestions for the candidate formulas, or to prompt the difference between the second calculation intention and the formula description of the candidate formula; N is a positive integer; The first formula is determined according to a modification operation applied to any one of the displayed candidate formulas.

7. The method according to claim 6, characterized in that The modification operation includes: a modification operation input by a user; or a modification operation determined based on a natural language input by the user.

8. The method according to claim 5, characterized in that The determining the first formula based on at least one candidate formula with the highest matching degree comprises: Determine the difference between the formula description of the candidate formula with the highest matching degree and the second calculation intention; The candidate formula is modified according to the difference to obtain the first formula.

9. The method according to claim 4, characterized in that The determining the first formula according to the matching degree between the second calculation intention and the candidate formula includes: In response to there being multiple candidate formulas that completely match the second calculation intention, outputting second prompt information in the first interface, wherein the second prompt information is used to prompt input of instruction information for selecting a target formula from the candidate formulas, and the target formula is used to determine the first formula; The first formula is determined according to an input operation based on the second prompt information.

10. The method according to claim 2, characterized in that In response to the target text involving calculation, determining the first formula based on a second model includes: In response to the target text involving calculation, determining a third calculation intention based on the second model; The first formula is generated according to the third calculation intention.

11. The method according to claim 1, characterized in that: The step of determining a first formula for performing calculation based on processing the target text comprises: Processing the target text using the first model to generate a second formula that performs a calculation; Matching the second formula with candidate formulas in a preset database; The first formula is determined according to the degree of matching between the second formula and the candidate formula.

12. The method according to claim 1, characterized in that The applying the first formula to the editing of the target area in the second interface includes one of the following: Writing the first formula into the target area; The numerical value in the target area is calculated based on the first formula to obtain a calculation result displayed in the target area.

13. A document processing device, characterized in that: The device comprises: A receiving module, used for receiving a target text input based on the first interface; A determination module, configured to determine a first formula for performing calculation based on processing of the target text; A processing module is used to apply the first formula to the editing of the target area in the second interface.

14. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: implement the document processing method described in any one of claims 1 to 12 when running the executable instructions.

15. A computer-readable storage medium, characterized in that: The readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the document processing method according to any one of claims 1 to 12.