Text processing method and device, electronic equipment and storage medium

The target text is pre-edited through a large language model, pre-edited text is generated and user confirmation or editing is performed, which solves the low efficiency problem in traditional document editing, achieves the effect of quickly discovering editing areas and reducing reading volume.

CN118821736BActive Publication Date: 2025-10-10SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410875358.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-30
Publication Date
2025-10-10
Estimated Expiration
2044-06-30

AI Technical Summary

Technical Problem

In traditional document editing methods, users need to read a lot of previous content before finding the editing location, resulting in low editing efficiency.

Method used

The target text is pre-edited using the large language model and the first prompt text to generate a pre-edited text, which is then returned to the user for confirmation or editing. The user-edited text is then intelligently fused to generate the target edited text.

Benefits of technology

It reduces the amount of content users need to read, reduces the amount of editing, improves editing efficiency and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118821736B_ABST
    Figure CN118821736B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a text processing method, which comprises the following steps: obtaining a target text to be edited and a first prompt text corresponding to the target text; performing first text processing on the target text based on the first prompt text and a large language model to obtain a pre-edited text; returning the pre-edited text to a user to enable the user to perform a confirmation operation or an editing operation on the pre-edited text; receiving a user-edited text returned by the user; determining a second prompt text based on the user-edited text; and performing second text processing on the target text based on the second prompt text and the large language model to obtain a target edited text. By performing pre-editing on the target text, the area of the target text that the user intends to edit can be quickly found, the area of the target text that the user intends to edit is pre-edited, the reading amount of the user for the front content is reduced, meanwhile, the pre-edited content that can be referred to is provided, the editing amount of the user is reduced, and the editing efficiency of the text is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a text processing method, device, electronic device and storage medium. Background Art

[0002] Traditional document editing methods require users to find the areas in the document that require editing, perform the edits there, and then complete the document. However, in some long documents with many pages, users need to read a lot of preceding content to find the areas that need editing, which makes editing more laborious for users. Therefore, traditional document editing methods are not very efficient. Summary of the Invention

[0003] An embodiment of the present invention provides a text processing method, which aims to solve the problem of low editing efficiency in existing document editing methods. The target text is pre-edited through a large language model and a first prompt text, and the pre-edited text is then returned to the user, so that the user can confirm or re-edit the pre-edited content in the pre-edited text, thereby obtaining the user-edited text, and intelligently fusing the user-edited text to obtain the final target edited text. The area in the target text that the user intends to edit can be quickly discovered, and the area that the user intends to edit can be pre-edited, thereby reducing the user's reading of the preceding content and providing reference pre-edited content, thereby reducing the user's editing amount, thereby improving the user's editing efficiency for the text and enhancing the user's editing experience.

[0004] In a first aspect, an embodiment of the present invention provides a text processing method, the method comprising the following steps:

[0005] Obtaining a target text to be edited and a first prompt text corresponding to the target text, wherein the first prompt text includes a first prompt field corresponding to the area to be edited, a second prompt field corresponding to the editing mode, and a first result generation prompt field;

[0006] Performing a first text processing on the target text based on the first prompt text and the large language model to obtain a pre-edited text, wherein the pre-edited text includes at least one pre-selected editing area, and each pre-selected editing area corresponds to at least one pre-selected editing content;

[0007] Returning the pre-edited text to the user, so that the user can perform a confirmation operation or an editing operation on the pre-edited text;

[0008] receive a user edited text returned by the user, the user edited text being a text after the user confirms or edits the pre-edited text, the user edited text including at least one user edited area, each user edited area corresponding to at least one user edited content;

[0009] determine a second prompt text based on the user edited text, the second prompt text including a third prompt field corresponding to the user edited area, a fourth prompt field corresponding to the user edited content, and a second result generation prompt field;

[0010] perform a second text processing on the target text based on the second prompt text and the large language model to obtain a target edited text.

[0011] Optionally, the obtaining of the target text to be edited and the first prompt text corresponding to the target text includes:

[0012] obtaining a target text input by the user;

[0013] performing semantic analysis processing on the target text to obtain a text semantic label and a text editing method label of the target text;

[0014] generating a first prompt field corresponding to the area to be edited based on the text semantic label selected by the user, and generating a second prompt field corresponding to the editing method based on the text editing method label selected by the user;

[0015] Alternatively, obtaining historical editing data of the user, the historical editing data including historical editing content and a historical editing area corresponding to the historical editing content;

[0016] determining a user semantic label and a user editing method label of the user based on the historical editing data;

[0017] generating a first prompt field corresponding to the area to be edited based on the user semantic label, and generating a second prompt field corresponding to the editing method based on the user editing method label;

[0018] filling the first prompt field and the second prompt field into a first prompt template to obtain the first prompt text corresponding to the target text, the first prompt template having a first result generation prompt field by default.

[0019] Optionally, the performing of the first text processing on the target text based on the first prompt text and the large language model to obtain the pre-edited text includes:

[0020] determining at least one area to be edited in the target text based on the first prompt field through the large language model;

[0021] For one of the regions to be edited, extracting a first text content corresponding to the region to be edited from the target text using the large language model;

[0022] Based on the second prompt field, editing the first text content using the large language model to obtain at least one pre-selected editing content corresponding to the area to be edited;

[0023] Marking the target text based on at least one of the to-be-edited regions to obtain at least one pre-selected editing region, each pre-selected editing region corresponding to one of the to-be-edited regions;

[0024] At least one corresponding pre-selected editing content is added to the pre-selected editing area to obtain a pre-edited text.

[0025] Optionally, the adding of the corresponding at least one pre-selected editing content in the pre-selected editing area to obtain the pre-edited text includes:

[0026] For one of the pre-selected editing areas, if there is only one corresponding pre-selected editing content, then the corresponding pre-selected editing content is added to the pre-selected editing area;

[0027] If there are multiple corresponding pre-selected edit contents, then adding the multiple pre-selected edit contents to the pre-selected edit area in descending order of confidence of the pre-selected edit contents, where the confidence is obtained from the output of the large language model;

[0028] After at least one corresponding pre-selected editing content is added to all the pre-selected editing areas, a pre-edited text is obtained.

[0029] Optionally, determining the second prompt text based on the user edited text includes:

[0030] Extracting at least one user-edited area and at least one user-edited content corresponding to the user-edited area from the user-edited text;

[0031] generating at least one third prompt field based on at least one user editing area, wherein each user editing area corresponds to one third prompt field;

[0032] For one of the user editing areas, generating at least one fourth prompt field based on at least one of the user edited contents corresponding to the user editing area, wherein each of the user edited contents corresponds to one fourth prompt field;

[0033] The third prompt field and the fourth prompt field are filled in the second prompt template to obtain a second prompt text, and the second prompt template is provided with a second result generation prompt field by default.

[0034] Optionally, generating at least one fourth prompt field based on at least one user-edited content, where each user-edited content corresponds to one fourth prompt field, includes:

[0035] For one of the user-edited contents, determining whether the version of the user-edited content is a user-confirmed version or a user-edited version, wherein the user-edited content of the user-confirmed version is configured as the pre-selected edited content for the user to perform a confirmation operation, and the user-edited content of the user-edited version is configured as the pre-selected edited content for the user to perform an editing operation;

[0036] If the version of the user-edited content is the user-confirmed version, generating a fourth prompt field corresponding to the user-edited content based on the user-edited content;

[0037] If the version of the user-edited content is the user-edited version, a fourth prompt field corresponding to the user-edited content is generated based on the user-edited content and pre-edited content corresponding to the user-edited content.

[0038] Optionally, performing second text processing on the target text based on the second prompt text and the large language model includes:

[0039] Based on the third prompt field, determining at least one target editing region in the target text by using a large language model, each target editing region corresponding to a user editing region;

[0040] For one target editing area, determining in the fourth prompt field at least one user-edited content corresponding to the target editing area;

[0041] Determining, in the target text, second text content corresponding to the target editing area using the large language model;

[0042] If the number of the user-edited content corresponding to the target editing area is one, replacing the second text content with the user-edited content using the large language model;

[0043] If the user edited content data corresponding to the target editing area is one, multiple second text contents are fused through the large language model to obtain fused edited content, and the second text content is replaced with the fused edited content.

[0044] In a second aspect, an embodiment of the present invention further provides a text processing device, the text editing device comprising:

[0045] An acquisition module, configured to acquire a target text to be edited and a first prompt text corresponding to the target text, wherein the first prompt text includes a first prompt field corresponding to the area to be edited, a second prompt field corresponding to the editing mode, and a first result generation prompt field;

[0046] a first processing module, configured to perform a first text processing on the target text based on the first prompt text and a large language model to obtain a pre-edited text, wherein the pre-edited text includes at least one pre-selected editing area, each pre-selected editing area corresponding to at least one pre-selected editing content;

[0047] A return module, configured to return the pre-edited text to the user, so that the user can perform a confirmation operation or an editing operation on the pre-edited text;

[0048] a receiving module, configured to receive a user-edited text returned by the user, wherein the user-edited text is the text after the user performs a confirmation operation or an editing operation on the pre-edited text, and the user-edited text includes at least one user-editing area, each of which corresponds to at least one user-edited content;

[0049] A second processing module is configured to determine a second prompt text based on the user edited text, where the second prompt text includes a third prompt field corresponding to the user editing area, a fourth prompt field corresponding to the user edited content, and a second result generation prompt field;

[0050] The third processing module is configured to perform a second text processing on the target text based on the second prompt text and the large language model to obtain a target edited text.

[0051] In a third aspect, an embodiment of the present invention provides an electronic device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the text processing method provided in the embodiment of the present invention when executing the computer program.

[0052] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the text processing method provided in the embodiment of the invention are implemented.

[0053] In an embodiment of the present invention, a target text to be edited and a first prompt text corresponding to the target text are obtained, the first prompt text including a first prompt field corresponding to the area to be edited, a second prompt field corresponding to the editing mode, and a first result generation prompt field; a first text processing is performed on the target text based on the first prompt text and a large language model to obtain a pre-edited text, the pre-edited text including at least one pre-selected editing area, each pre-selected editing area corresponding to at least one pre-selected editing content; the pre-edited text is returned to the user so that the user performs a confirmation operation or an editing operation on the pre-edited text; a user edited text returned by the user is received, the user edited text being the text after the user performs a confirmation operation or an editing operation on the pre-edited text, the user edited text including at least one user editing area, each user editing area corresponding to at least one user editing content; a second prompt text is determined based on the user edited text, the second prompt text including a third prompt field corresponding to the user editing area, a fourth prompt field corresponding to the user editing content, and a second result generation prompt field; a second text processing is performed on the target text based on the second prompt text and a large language model to obtain a target edited text. The target text is pre-edited through a large language model and the first prompt text, and the pre-edited text is then returned to the user, so that the user can confirm or re-edit the pre-edited content in the pre-edited text, and then obtain the user-edited text. The user-edited text is intelligently integrated to obtain the final target edited text. The area in the target text that the user intends to edit can be quickly discovered, and the area that the user intends to edit can be pre-edited, which reduces the user's reading of the previous content and provides reference pre-edited content, reducing the user's editing amount, thereby improving the user's editing efficiency for the text and enhancing the user's editing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0055] Figure 1 is a flowchart of a text processing method provided by an embodiment of the present invention;

[0056] Figure 2 is a structural diagram of a text processing device provided in an embodiment of the present invention;

[0057] Figure 3 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0059] like Figure 1 As shown, Figure 1 1 is a flowchart of a text processing method provided by an embodiment of the present invention, including:

[0060] 101. Obtain a target text to be edited and a first prompt text corresponding to the target text.

[0061] In an embodiment of the present invention, the above-mentioned text editing method can be applied to a text editing platform. The above-mentioned text editing platform can be built based on a server or a distributed server. The above-mentioned text editing platform is deployed with functional applications such as text editing applications, large language models or interfaces of large language models that support intelligent text editing. The text editing application calls the large language model through the interface to perform text processing.

[0062] The target text to be edited may be a text uploaded by a user to a text editing platform via a user terminal, or may be a text downloaded from a text link specified by the user.

[0063] The first prompt text may be text filled in and submitted by the user, or may be text automatically generated by the text editing platform based on the target text after automatic analysis. The first prompt text includes a first prompt field corresponding to the area to be edited, a second prompt field corresponding to the editing method, and a first result generation prompt field.

[0064] The first prompt field is used to indicate the editing area that the user intends to edit. For example, if the user wants to edit the content of the target text introducing "XX Movie", the first prompt field may be "Search for the area related to XX Movie as the area to be edited A". The second prompt field is used to indicate the editing method that the user intends to use. The editing method may be expanding, deleting, modifying, or stylizing the area to be edited. For example, if the user expands the content of the target text introducing "XX Movie", the second prompt field may be "Expand the area to be edited A".

[0065] Specifically, in the first prompt text, the first prompt field is one or more, and each first prompt field corresponds to at least one second prompt field. Each first prompt field represents an editing area of a type of user intention to edit, and each second prompt field represents an editing manner of a type of user intention to edit. That is, the user can simultaneously edit one or more types of editing areas, and for an editing area of a type, one or more editing manners can be used for intelligent editing.

[0066] The first result generation prompt field is used to represent the user's intention to generate a result, such as: the user wants to output all the text, and the first result generation prompt field can be: "output the complete edited text", or the user wants to output partial text, and the first result generation prompt field can be: "output the edited text corresponding to the to-be-edited area".

[0067] 102, based on the first prompt text and the large language model, the target text is first text processed to obtain a pre-edited text.

[0068] In the embodiment of the application, after obtaining the first prompt text, the first prompt text and the target text can be input into the large language model for first text processing, or the corresponding large language model can be called through the large language model interface to perform first text processing on the target text according to the first prompt text.

[0069] The large language model can be a special large language model trained by itself, or an open source large language model providing a calling interface. Through the large language model and the first prompt text, the user's intention to edit the editing area (i.e., the to-be-edited area) and the editing manner of the user's intention to edit are analyzed, and then the corresponding text area in the target text as the pre-selected editing area is found according to the user's intention to edit the editing area, and the text content of the text area is pre-edited through the corresponding editing manner to obtain pre-selected editing content.

[0070] The pre-edited text includes at least one pre-selected editing area, and each pre-selected editing area corresponds to at least one pre-selected editing content.

[0071] The pre-edited text can include a hierarchical directory of pre-selected editing areas, and multiple types of pre-selected editing areas can be indexed through the directory, and multiple positions of pre-selected editing areas of a type can be indexed through a subdirectory. The pre-selected editing content can be displayed in the form of annotations or recorded in the form of link jumping. The user clicks the link to jump to the display page of the corresponding pre-selected editing content.

[0072] 103, return the pre-edited text to the user to enable the user to perform a confirmation operation or an editing operation on the pre-edited text.

[0073] In an embodiment of the present invention, after obtaining the pre-edited text, the text editing platform may return the pre-edited text to the user terminal, and the user may perform a confirmation operation or an editing operation on the pre-edited text on the user terminal.

[0074] In the pre-edit text, each pre-selected editing area is provided with a corresponding confirmation component or deletion component. The user can confirm the pre-selected editing area through the confirmation component, and can delete the pre-selected editing area through the deletion component. It should be noted that since the pre-selected editing area is selected by the large language model, there may be certain errors. Therefore, the user is required to confirm or delete it. If the pre-selected editing area is the editing area that the user wants to edit, the user can confirm the pre-selected area through the confirmation component. If the pre-selected editing area is not the editing area that the user wants to edit, the user can delete the pre-selected editing area through the deletion component. Of course, the above-mentioned pre-edit text can also include an addition component, and the user can also add an editing area to the pre-edit text by adding a component. The pre-selected editing area confirmed by the user and the editing area added by the user can be determined as the user editing area.

[0075] Each pre-selected editing area corresponds to at least one pre-selected editing content, each pre-selected editing content is an editable text, and is provided with a corresponding confirmation component or deletion component. The user can confirm the pre-selected editing content that he wants to keep through the confirmation component, delete the pre-selected editing content that he does not want to keep, and can also edit the pre-selected editing content again, and then edit the content that is more suitable for him based on the pre-selected editing content. Of course, a content addition component can also be provided, and the user can add new editing content to the pre-selected editing area through the content addition component. The pre-selected editing content that has been confirmed by the user and the user's editing is completed, as well as the editing content newly added by the user, can be used as user editing content.

[0076] 104. Receive the user edited text returned by the user.

[0077] In an embodiment of the present invention, after the user writes a confirmation operation or an editing operation on the pre-edited text, a user-edited text can be obtained. The user can send the above-mentioned user-edited text to the text editing platform through the user terminal. After the text editing platform receives the user-edited text returned by the user, it enters the text editing process of the subsequent steps.

[0078] The user-edited text is the text after the user performs a confirmation operation or an editing operation on the pre-edited text. The user-edited text includes at least one user-editing area, and each user-editing area corresponds to at least one user-edited content.

[0079] User edit text can include a hierarchical directory of user edit areas. Multiple types of user edit areas can be indexed by directory, and multiple locations of the same type of user edit areas can be indexed by subdirectories. User edit content can be displayed as annotations or recorded via links, and specific user edit content can be accessed through links. This allows large language models to quickly locate user edit areas based on the hierarchical directory and quickly access user edit content through annotations or links.

[0080] 105. Determine a second prompt text based on the text edited by the user.

[0081] In an embodiment of the present invention, the second prompt text may be text filled in and submitted by the user, or may be text automatically generated by the text editing platform based on the user edited text. The second prompt text includes a third prompt field corresponding to the user editing area, a fourth prompt field corresponding to the user edited content, and a second result generation prompt field.

[0082] The third prompt field is used to prompt the user to confirm the editing area to be edited, and the editing area confirmed by the user to be edited is the user editing area in the user editing text. The fourth prompt field is used to prompt the user to confirm the editing content, and the editing content confirmed by the user is the user editing content in the user editing text.

[0083] Specifically, in the second prompt text, there are one or more third prompt fields, each of which corresponds to at least one fourth prompt field. Each third prompt field represents a type of user editing area, and each fourth prompt field represents a user editing content.

[0084] The above-mentioned second result generation prompt field is used to indicate the final generation result of the user's intention. For example, if the user wants to output the entire text, the second result generation prompt field may be: "Output the complete final edited text", or if the user wants to output partial text, the second result generation prompt field may be: "Output the final edited text corresponding to the user editing area".

[0085] 106. Perform second text processing on the target text based on the second prompt text and the large language model to obtain a target edited text.

[0086] In an embodiment of the present invention, after obtaining the second prompt text, the second prompt text and the target text can be input into the large language model for second text processing, or the corresponding large language model can be called through the large language model interface to perform second text processing on the target text according to the second prompt text.

[0087] The user editing area is found in the target text by the large language model and a third prompt field in the second prompt text, and the found user editing area is determined as a target editing area. At least one user editing content corresponding to the target editing area is found in the target text by the large language model and a fourth prompt field in the second prompt text, and the at least one user editing content is replaced with original text content in the target editing area, thereby obtaining a final edited text.

[0088] Specifically, for a target editing area, if there is only one user editing content corresponding to the target editing area, the one user editing content is replaced with original text content in the target editing area to obtain a target editing text. If there are multiple user editing contents corresponding to the target editing area, the multiple user editing contents can be merged or selected to obtain a final user editing content, which is replaced with the original text content in the target editing area.

[0089] In the embodiment of the application, the target text to be edited and the first prompt text corresponding to the target text are obtained, the first prompt text includes a first prompt field corresponding to the editing area, a second prompt field corresponding to the editing mode, and a first result generation prompt field; the target text is processed based on the first prompt text and the large language model to obtain a pre-editing text, the pre-editing text includes at least one pre-selected editing area, and each pre-selected editing area corresponds to at least one pre-selected editing content; the pre-editing text is returned to the user to enable the user to perform a confirmation operation or an editing operation on the pre-editing text; the user editing text returned by the user is received, the user editing text is the text after the user performs a confirmation operation or an editing operation on the pre-editing text, and the user editing text includes at least one user editing area, and each user editing area corresponds to at least one user editing content; the second prompt text is determined based on the user editing text, the second prompt text includes a third prompt field corresponding to the user editing area, a fourth prompt field corresponding to the user editing content, and a second result generation prompt field; and the target editing text is obtained by processing the target text based on the second prompt text and the large language model. The target text is pre-edited by the large language model and the first prompt text, and then the pre-editing text is returned to the user, so that the user can confirm or re-edit the pre-editing content in the pre-editing text, thereby obtaining the user editing text. The user editing text is intelligently fused to obtain the final target editing text, the area in the target text intended to be edited by the user can be quickly found, and the area intended to be edited by the user is pre-edited, thereby reducing the amount of reading of the user for the pre-editing content, providing referenceable pre-editing content, reducing the editing amount of the user, and improving the editing efficiency of the user for the text, and improving the editing experience of the user.

[0090] It should be noted that the text editing method provided in the embodiment of the present invention can be applied to electronic devices that can perform text editing, such as mobile phones, tablets, computers, servers, etc.

[0091] It is understandable that in the specific implementation of this application, data related to text, users, etc. is involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data, as well as the training, deployment and calling of large language models, must comply with relevant laws, regulations and standards of relevant countries and regions.

[0092] Optionally, in the step of obtaining the target text to be edited and the first prompt text corresponding to the target text, the target text input by the user can be obtained; the target text is semantically analyzed to obtain the text semantic label and text editing method label of the target text; based on the text semantic label selected by the user, a first prompt field corresponding to the area to be edited is generated, and based on the text editing method label selected by the user, a second prompt field corresponding to the editing method label is generated; or, the user's historical editing data is obtained, the historical editing data includes historical editing content and historical editing areas corresponding to the historical editing content; based on the historical editing data, the user's user semantic label and user editing method label are determined; based on the user semantic label, a first prompt field corresponding to the area to be edited is generated, and based on the user editing label, a second prompt field corresponding to the editing method is generated; the first prompt field and the second prompt field are filled in the first prompt template to obtain the first prompt text corresponding to the target text, and the first prompt template is set with a first result generation prompt field by default.

[0093] In an embodiment of the present invention, the first prompt text can be automatically generated in a text-based manner in combination with the first prompt template, or it can be automatically generated in a user-based manner. The first prompt template is set by default. The first prompt template is used to fill in the corresponding label to obtain the corresponding prompt field. For example, the first prompt field is generated based on the text semantic label or the user semantic label, and the second prompt field is generated based on the text editing mode label or the user editing mode label.

[0094] In a text-based approach, semantic analysis can be performed on the target text to obtain a semantic tag and editing mode tag for the target text. These tags are returned to the user terminal for selection. Semantic analysis can be performed on the target text using a natural language processing model (such as a recurrent neural network (RNN) or a long short-term memory (LSTM) network), or directly using a large language model.

[0095] The user can select text semantic tags and text editing tags on the display interface of the user terminal, and the selected text semantic tags and text editing mode tags are returned to the text editing platform through the user terminal.

[0096] Based on the text semantic tag selected by the user, the text semantic tag is automatically generated into a first prompt field corresponding to the area to be edited. Based on the text editing tag selected by the user, the text editing method tag is automatically generated into a second prompt field corresponding to the edited content. The text semantic tag can be directly determined as the first prompt field, the text editing method tag can be directly determined as the second prompt field, or the text semantic tag can be filled into a preset first prompt field template to generate the first prompt field, and the text editing method tag can be filled into a preset second prompt field template to generate the second prompt field.

[0097] In a user-based approach, the content and editing methods previously edited by the user in the user's historical edit data can be classified to obtain the user's preferred editing semantic type and preferred editing method. The user semantic label is determined based on the user's preferred editing semantic type, and the user editing method label is determined based on the user's preferred editing method. Natural language processing models (such as recurrent neural networks (RNNs) and long short-term memory (LSTMs)) can be used to classify the content and editing methods previously edited by the user in the historical edit data, or large language models can be directly used to classify the content and editing methods previously edited by the user in the historical edit data.

[0098] The user semantic label and user editing mode label can be directly generated into corresponding first and second prompt fields, with one user semantic label corresponding to one first prompt field and one user editing mode label corresponding to one second prompt field. The user semantic label can be directly determined as the first prompt field, the user editing mode label can be directly determined as the second prompt field, or the user semantic label can be entered into a preset first prompt field template to generate the first prompt field, and the user editing mode label can be entered into a preset second prompt field template to generate the second prompt field.

[0099] In a possible embodiment, the user semantic tag and the user editing tag may be returned to the user terminal for the user to select, and the user semantic tag and the user editing method tag selected by the user may be generated to obtain the corresponding first prompt field and second prompt field.

[0100] The first prompt field is automatically filled into the first prompt template, and the second prompt field is automatically filled into the first prompt template to obtain the first prompt text.

[0101] By generating the first and second prompt fields in a text-based manner, the first and second prompt fields can be more closely aligned with the target text, making them more accurate. By generating the first and second prompt fields in a user-based manner, the first and second prompt fields can be generated in batches based on the user's preferred editing content and editing method, eliminating the need for semantic analysis of each target text. This makes it suitable for rapid batch editing of similar texts, further improving text editing efficiency.

[0102] Optionally, in the step of performing first text processing on the target text based on the first prompt text and the large language model to obtain pre-edited text, at least one area to be edited can be determined in the target text based on the first prompt field through the large language model; for one area to be edited, the first text content corresponding to the area to be edited can be extracted from the target text through the large language model; based on the second prompt field, the first text content is edit-processed through the large language model to obtain at least one pre-selected editing content corresponding to the area to be edited; the target text is area-marked based on the at least one area to be edited to obtain at least one pre-selected editing area, each pre-selected editing area corresponding to one area to be edited; and at least one corresponding pre-selected editing content is added to the pre-selected editing area to obtain pre-edited text.

[0103] In an embodiment of the present invention, the first prompt field is used to prompt the large language model to find an area to be edited related to the semantic tag content in the target text. The area to be edited may be a text area such as a chapter, section, page, paragraph, sentence, or word.

[0104] The large language model can be used to extract the text content of each to-be-edited region in the target text, thereby obtaining the first text content. One first text content can be correspondingly extracted from each to-be-edited region.

[0105] The above-mentioned second prompt field is used to prompt the large language model on the editing method when editing the first text content. It should be noted that in the first prompt text, there is a corresponding relationship between the first prompt field and the second prompt field, and each first prompt field will correspond to at least one second prompt field. Therefore, each area to be edited can also correspond to at least one second prompt field, that is, each area to be edited will correspond to at least one editing method label. After extracting the first text content, the first text content can be edited by the large language model according to the editing method corresponding to the editing method label, and then at least one pre-selected editing content corresponding to the first text content is obtained. Each area to be edited can correspond to at least one pre-selected editing content. For an area to be edited, there can be one or more pre-selected editing contents. The number of pre-selected editing contents depends on the number of large language model outputs (the number of large language model outputs can be set in the first result generation prompt field), and can also depend on the number of editing method labels.

[0106] After the large language model finds the area to be edited in the target text, it will uniquely mark the area to be edited. The unique mark includes different types of type identifiers and serial number identifiers of the same type. There can be one or more areas to be edited in the target text. After the editing of the first text content corresponding to the area to be edited is completed, at least one pre-selected editing content corresponding to the area to be edited is obtained, and the area to be edited is determined as the pre-selected editing area. After the pre-editing of the target text is completed, each pre-selected editing area corresponds to an area to be edited, and each pre-selected editing area corresponds to at least one pre-selected editing content. By pre-editing the target text through the first prompt text and the large language model, the edited text can be quickly obtained for the user to re-edit, reducing the user's pre-reading amount and editing workload, thereby improving the user's editing efficiency.

[0107] Optionally, in the step of appending at least one corresponding preselected editing content to the preselected editing area to obtain the preselected text, for one preselected editing area, if there is only one corresponding preselected editing content, then the corresponding preselected editing content is appended to the preselected editing area; if there are multiple preselected editing contents, then the multiple preselected editing contents are appended to the preselected editing area in descending order of the confidence of the preselected editing contents, and the confidence is obtained by the output of the large language model; after appending at least one corresponding preselected editing content to all preselected editing areas, the preselected text is obtained.

[0108] In the embodiment of the present invention, it should be noted that since different editing methods can produce different numbers of editing results, for example, deleting the corresponding editing method will produce one editing result, while expanding the corresponding editing method will produce multiple editing results. Therefore, for a first text content, the large language model can output a corresponding number of pre-selected editing contents according to different editing methods. Each pre-selected editing content corresponds to a confidence level output by a large language model, and the confidence level is used to illustrate the credibility of the corresponding pre-selected editing content.

[0109] After obtaining the pre-selected edit content generated by the large language model, for a pre-selected edit area, if there is only one pre-selected edit content, it means that the pre-selected edit content does not need to be sorted, and the pre-selected edit content is attached to the corresponding pre-selected edit area in the form of an annotation or link. If there are multiple pre-selected edit contents, it means that the pre-selected edit contents need to be sorted, and multiple pre-selected edit contents are attached to the pre-selected edit area in descending order of confidence. When the user views the pre-selected edit content, the pre-selected edit content can be viewed in order in the pre-edit text. Therefore, when a large amount of pre-selected edit content is provided, the user can view the corresponding pre-selected edit content in an orderly manner, thereby improving the user's viewing efficiency of the pre-selected edit content.

[0110] Optionally, in the step of determining the second prompt text based on the user-edited text, at least one user-edited area and at least one user-edited content corresponding to the user-edited area can be extracted from the user-edited text; based on the at least one user-edited area, at least one third prompt field is generated, and each user-edited area corresponds to a third prompt field; for a user-edited area, based on the at least one user-edited content corresponding to the user-edited area, at least one fourth prompt field is generated, and each user-edited content corresponds to a fourth prompt field; the third prompt field and the fourth prompt field are filled in the second prompt template to obtain the second prompt text, and the second prompt template is set with a second result generation prompt field by default.

[0111] In this embodiment of the present invention, it should be noted that the user editing area in the user-edited text is a pre-selected editing area or a newly added editing area confirmed by the user in the pre-edited text, and each user editing area corresponds to at least one user-edited content. The user-edited content is the pre-selected editing content confirmed or edited by the user in the pre-edited text or the editing content added based on the newly added editing area.

[0112] After receiving the user-edited text returned by the user, at least one user-edited region can be extracted from the user-edited text, and a third prompt field corresponding to each user-edited region can be generated. The third prompt field is used to prompt the user to confirm the edited region. The user-edited region can be a text region with a unique identifier, such as a chapter, section, page, paragraph, sentence, or word. The user-edited region can be directly determined as the third prompt field, or the user-edited region can be entered into a third prompt field template to generate the third prompt field.

[0113] The user edited content corresponding to each user edited area is extracted from the user edited text. Each user edited area corresponds to at least one user edited content. For each user edited area or a third prompt field, at least one corresponding fourth prompt field is generated based on at least one user edited content. One user edited content corresponds to one fourth prompt field, and one fourth prompt field belongs to one third prompt field. The fourth prompt field is used to prompt the user to confirm the edited content. The user edited content can be directly determined as the fourth prompt field, or the user edited content can be filled in the fourth prompt field template to generate the fourth prompt field.

[0114] After obtaining the third and fourth prompt fields, the third and fourth prompt fields are entered into the default second prompt template to obtain the second prompt text. The second prompt template includes a default second result generation prompt field. This second result generation prompt field is used to prompt the large language model to output the target edited text after replacing the original text content with the user's edited content. By constructing the second prompt text, the large language model can perform second text processing based on confirmed user intent, further improving the accuracy of text editing.

[0115] Optionally, in the step of generating at least one fourth prompt field based on at least one user-edited content, and each user-edited content corresponds to a fourth prompt field, it is possible to determine, for one user-edited content, whether the version of the user-edited content is a user-confirmed version or a user-edited version, the user-edited content of the user-confirmed version is configured as pre-edited content for the user to perform confirmation operations, and the user-edited content of the user-edited version is configured as pre-edited content for the user to perform editing operations; if the version of the user-edited content is the user-confirmed version, a fourth prompt field corresponding to the user-edited content is generated based on the user-edited content; if the version of the user-edited content is the user-edited version, a fourth prompt field corresponding to the user-edited content is generated based on the user-edited content; if the version of the user-edited content is the user-edited version, a fourth prompt field corresponding to the user-edited content is generated based on the user-edited content and the pre-selected editing content corresponding to the user-edited content.

[0116] In an embodiment of the present invention, the user editing area in the user-edited text is a pre-selected editing area or a newly added editing area confirmed by the user in the pre-edited text, and each user editing area corresponds to at least one user-edited content. The user-edited content is the pre-selected editing content confirmed or edited by the user in the pre-edited text or the editing content added based on the newly added editing area. For pre-selected editing content directly confirmed by the user, the version of the pre-selected editing content can be determined as the user-confirmed version. For pre-selected editing content edited by the user and editing content added by the user, their versions are determined as the user-edited version.

[0117] For the user-edited content of the user-confirmed version, the user-edited content may be directly determined as the fourth prompt field, or the user-edited content may be filled into the fourth prompt field template to generate the fourth prompt field.

[0118] For the user-edited content of the user-edited version, if the user-edited content is re-edited by the user based on the corresponding pre-selected edited content, the corresponding pre-selected edited content is obtained, and the corresponding fourth prompt field is generated based on the pre-selected edited content and the user-edited content. Specifically, the relevance between the pre-selected edited content and the user-edited content can be calculated. If the relevance is less than the preset relevance, the corresponding fourth prompt field is generated based on the user-edited content. If the relevance is greater than or equal to the preset relevance, the editing method is extracted based on the user-edited content, and the pre-selected edited content is regenerated using the editing method. In this way, the user only needs to edit one part of the pre-selected edited content, and the editing method can be extracted and applied to the pre-selected edited content, thereby obtaining the complete edited content. The user does not need to re-edit all the content in the pre-selected edited content, further improving the efficiency of text editing. The complete edited content can be directly determined as the fourth prompt field, or the complete edited content can be filled in the fourth prompt field template to generate the fourth prompt field.

[0119] If the user edited content is newly edited content by the user, the newly edited content by the user can be directly determined as the fourth prompt field, or the newly edited content by the user can be filled in the fourth prompt field template to generate the fourth prompt field.

[0120] Optionally, in the step of performing second text processing on the target text based on the second prompt text and the large language model, at least one target editing region can be determined in the target text by the large language model based on a third prompt field, each target editing region corresponding to a user editing region; for a target editing region, at least one user editing content corresponding to the target editing region is determined in a fourth prompt field; second text content corresponding to the target editing region is determined in the target text by the large language model; if the number of user editing content corresponding to the target editing region is one, the second text content is replaced by the user editing content by the large language model; if the number of user editing content data corresponding to the target editing region is one, the large language model is used to perform fusion processing on multiple second text contents to obtain fusion editing content, and the second text content is replaced by the fusion editing content.

[0121] In the embodiment of the application, the text content of each user editing region can be extracted from the target by the large language model, and then the second text content is obtained, that is, each third prompt field corresponds to one second text content.

[0122] After obtaining the second text content, for one second text content, if the fourth field of the third prompt field belongs to it is one, the user editing content also corresponds to one, and since the number of second text contents is also one, the user editing content and the corresponding second text content in the target text can be replaced at this time. If the fourth field of the third prompt field belongs to it is multiple, the number of second text contents is one, and the user editing content corresponds to multiple, and since the number of second text contents is only one, multiple user editing contents need to be processed to obtain the final editing content to replace the corresponding second text content in the target text. Specifically, the large language model can be used to perform fusion processing on multiple second text contents to obtain fusion editing content, and the above fusion processing can be understood as fusing multiple user editing contents corresponding to editing methods into one editing content. For example, the word editing content of adding words and the word editing content of deleting wrong characters are fused into one editing content.

[0123] As shown in Figure 2 The application also provides a text processing device, which comprises:

[0124] The acquisition module 201 is configured to acquire a target text to be edited and a first prompt text corresponding to the target text, wherein the first prompt text comprises a first prompt field corresponding to an editing region, a second prompt field corresponding to an editing method, and a first result generation prompt field.

[0125] A first processing module 202 is configured to perform a first text processing on the target text based on the first prompt text and the large language model to obtain a pre-edited text, wherein the pre-edited text includes at least one pre-selected editing area, each pre-selected editing area corresponding to at least one pre-selected editing content;

[0126] A return module 203 is configured to return the pre-edited text to the user so that the user can perform a confirmation operation or an editing operation on the pre-edited text;

[0127] A receiving module 204 is configured to receive a user-edited text returned by the user, wherein the user-edited text is the text after the user performs a confirmation operation or an editing operation on the pre-edited text, and the user-edited text includes at least one user-editing area, each of which corresponds to at least one user-edited content;

[0128] A second processing module 205 is configured to determine a second prompt text based on the user edited text, where the second prompt text includes a third prompt field corresponding to the user editing area, a fourth prompt field corresponding to the user edited content, and a second result generation prompt field;

[0129] The third processing module 206 is configured to perform a second text processing on the target text based on the second prompt text and the large language model to obtain a target edited text.

[0130] Optionally, the acquisition module 201 is also used to obtain the target text input by the user; perform semantic analysis on the target text to obtain the text semantic label and text editing mode label of the target text; generate a first prompt field corresponding to the area to be edited based on the text semantic label selected by the user, and generate a second prompt field corresponding to the editing mode based on the text editing mode label selected by the user; or, obtain the user's historical editing data, the historical editing data including historical editing content and historical editing areas corresponding to the historical editing content; determine the user's user semantic label and user editing mode label based on the historical editing data; generate a first prompt field corresponding to the area to be edited based on the user semantic label, and generate a second prompt field corresponding to the editing mode based on the user editing mode label; fill in the first prompt field and the second prompt field into the first prompt template to obtain the first prompt text corresponding to the target text, and the first prompt template is set with a first result generation prompt field by default.

[0131] Optionally, the first processing module 202 is also used to determine at least one area to be edited in the target text based on the first prompt field through a large language model; for one area to be edited, extract the first text content corresponding to the area to be edited from the target text through the large language model; based on the second prompt field, edit the first text content through the large language model to obtain at least one pre-selected editing content corresponding to the area to be edited; mark the target text based on at least one area to be edited to obtain at least one pre-selected editing area, each pre-selected editing area corresponding to one area to be edited; and add the corresponding at least one pre-selected editing content to the pre-selected editing area to obtain a pre-edited text.

[0132] Optionally, the first processing module 202 is also used to, for one of the preselected editing areas, if there is only one corresponding preselected editing content, append the corresponding preselected editing content to the preselected editing area; if there are multiple preselected editing contents, append the multiple preselected editing contents to the preselected editing area in descending order of the confidence of the preselected editing content, and the confidence is obtained by the output of the large language model; after appending at least one corresponding preselected editing content to all the preselected editing areas, the pre-edited text is obtained.

[0133] Optionally, the second processing module 205 is also used to extract at least one user editing area and at least one user editing content corresponding to the user editing area from the user editing text; generate at least one third prompt field based on at least one user editing area, and each user editing area corresponds to one third prompt field; for one user editing area, generate at least one fourth prompt field based on at least one user editing content corresponding to one user editing area, and each user editing content corresponds to one fourth prompt field; fill in the third prompt field and the fourth prompt field into the second prompt template to obtain a second prompt text, and the second prompt template is set with a second result generation prompt field by default.

[0134] Optionally, the second processing module 205 is also used to determine, for one of the user-edited contents, whether the version of the user-edited content is a user-confirmed version or a user-edited version, the user-edited content of the user-confirmed version is configured as the pre-selected editing content for the user to perform a confirmation operation, and the user-edited content of the user-edited version is configured as the pre-selected editing content for the user to perform an editing operation; if the version of the user-edited content is the user-confirmed version, then based on the user-edited content, a fourth prompt field corresponding to the user-edited content is generated; if the version of the user-edited content is the user-edited version, then based on the user-edited content and the pre-edited content corresponding to the user-edited content, a fourth prompt field corresponding to the user-edited content is generated.

[0135] Optionally, the third processing module 206 is also used to determine at least one target editing area in the target text based on the third prompt field through a large language model, each target editing area corresponding to a user editing area; for one target editing area, determine at least one user editing content corresponding to the target editing area in the fourth prompt field; determine a second text content corresponding to the target editing area in the target text through the large language model; if the number of user editing contents corresponding to the target editing area is one, replace the second text content with the user editing content through the large language model; if the number of user editing content data corresponding to the target editing area is one, fuse multiple second text contents through the large language model to obtain fused editing content, and replace the second text content with the fused editing content.

[0136] It should be noted that the text editing device provided by the embodiment of the present invention can be applied to devices such as smart phones, computers, servers, etc. that can perform text editing methods.

[0137] The text editing device provided in the embodiment of the present invention can implement each process implemented by the region retention method in the above method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described here.

[0138] like Figure 3 As shown, an embodiment of the present invention further provides an electronic device, characterized in that it includes a processor, and the processor can execute any of the above text processing methods.

[0139] Specifically, the method includes a processor 301, a memory 302, and a computer program for executing a text editing method stored in the memory 302 and capable of running on the processor 301, wherein:

[0140] The processor 301 runs the computer program of the text editing method stored in the memory 302, and performs the following steps:

[0141] Obtain a target text to be edited and a first prompt text corresponding to the target text, the first prompt text including a first prompt field corresponding to a to-be-edited region, a second prompt field corresponding to an editing mode, and a first result generation prompt field;

[0142] Perform first text processing on the target text based on the first prompt text and a large language model to obtain a pre-edited text, the pre-edited text including at least one pre-selected editing region, each pre-selected editing region corresponding to at least one pre-selected editing content;

[0143] Return the pre-edited text to the user to enable the user to perform a confirmation operation or an editing operation on the pre-edited text;

[0144] Receive a user edited text returned by the user, the user edited text being a text after the user performs a confirmation operation or an editing operation on the pre-edited text, the user edited text including at least one user edited region, each user edited region corresponding to at least one user edited content;

[0145] Determine a second prompt text based on the user edited text, the second prompt text including a third prompt field corresponding to the user edited region, a fourth prompt field corresponding to the user edited content, and a second result generation prompt field;

[0146] Perform second text processing on the target text based on the second prompt text and the large language model to obtain a target edited text.

[0147] Optionally, the processor 301 performs the obtaining of the target text to be edited and the first prompt text corresponding to the target text, including:

[0148] Obtain a target text input by the user;

[0149] Perform semantic analysis processing on the target text to obtain a text semantic label and a text editing mode label of the target text;

[0150] Generate a first prompt field corresponding to a to-be-edited region based on the text semantic label selected by the user, and generate a second prompt field corresponding to an editing mode based on the text editing mode label selected by the user;

[0151] Alternatively, obtain historical editing data of the user, the historical editing data including historical editing content and a historical editing region corresponding to the historical editing content;

[0152] Determining a user semantic tag and a user editing mode tag of the user based on the historical editing data;

[0153] Based on the user semantic tag, a first prompt field corresponding to the area to be edited is generated, and based on the user editing mode tag, a second prompt field corresponding to the editing mode is generated;

[0154] The first prompt field and the second prompt field are filled in a first prompt template to obtain a first prompt text corresponding to the target text. The first prompt template is provided with a first result generation prompt field by default.

[0155] Optionally, the processor 301 performs first text processing on the target text based on the first prompt text and the large language model to obtain the pre-edited text, including:

[0156] Based on the first prompt field, determining at least one region to be edited in the target text using a large language model;

[0157] For one of the regions to be edited, extracting a first text content corresponding to the region to be edited from the target text using the large language model;

[0158] Based on the second prompt field, editing the first text content using the large language model to obtain at least one pre-selected editing content corresponding to the area to be edited;

[0159] Marking the target text based on at least one of the to-be-edited regions to obtain at least one pre-selected editing region, each pre-selected editing region corresponding to one of the to-be-edited regions;

[0160] At least one corresponding pre-selected editing content is added to the pre-selected editing area to obtain a pre-edited text.

[0161] Optionally, the processor 301 performs the step of appending the corresponding at least one preselected editing content in the preselected editing area to obtain the pre-edited text, including:

[0162] For one of the pre-selected editing areas, if there is only one corresponding pre-selected editing content, then the corresponding pre-selected editing content is added to the pre-selected editing area;

[0163] If there are multiple corresponding pre-selected edit contents, then adding the multiple pre-selected edit contents to the pre-selected edit area in descending order of confidence of the pre-selected edit contents, where the confidence is obtained from the output of the large language model;

[0164] After at least one corresponding pre-selected editing content is added to all the pre-selected editing areas, a pre-edited text is obtained.

[0165] Optionally, the determining of the second prompt text based on the user edited text performed by the processor 301 includes:

[0166] Extracting at least one user-edited area and at least one user-edited content corresponding to the user-edited area from the user-edited text;

[0167] generating at least one third prompt field based on at least one user editing area, wherein each user editing area corresponds to one third prompt field;

[0168] For one of the user editing areas, generating at least one fourth prompt field based on at least one of the user edited contents corresponding to the user editing area, wherein each of the user edited contents corresponds to one fourth prompt field;

[0169] The third prompt field and the fourth prompt field are filled in the second prompt template to obtain a second prompt text, and the second prompt template is provided with a second result generation prompt field by default.

[0170] Optionally, the processor 301 generates at least one fourth prompt field based on at least one user-edited content, where each user-edited content corresponds to one fourth prompt field, including:

[0171] For one of the user-edited contents, determining whether the version of the user-edited content is a user-confirmed version or a user-edited version, wherein the user-edited content of the user-confirmed version is configured as the pre-selected edited content for the user to perform a confirmation operation, and the user-edited content of the user-edited version is configured as the pre-selected edited content for the user to perform an editing operation;

[0172] If the version of the user-edited content is the user-confirmed version, generating a fourth prompt field corresponding to the user-edited content based on the user-edited content;

[0173] If the version of the user-edited content is the user-edited version, a fourth prompt field corresponding to the user-edited content is generated based on the user-edited content and pre-edited content corresponding to the user-edited content.

[0174] Optionally, the processor 301 performs the second text processing on the target text based on the second prompt text and the large language model, including:

[0175] Based on the third prompt field, determining at least one target editing region in the target text by using a large language model, each target editing region corresponding to a user editing region;

[0176] For one target editing area, determining in the fourth prompt field at least one user-edited content corresponding to the target editing area;

[0177] Determining, in the target text, second text content corresponding to the target editing area using the large language model;

[0178] If the number of the user-edited content corresponding to the target editing area is one, replacing the second text content with the user-edited content using the large language model;

[0179] If the user edited content data corresponding to the target editing area is one, multiple second text contents are fused through the large language model to obtain fused edited content, and the second text content is replaced with the fused edited content.

[0180] It should be noted that the electronic device provided by the embodiment of the present invention can be applied to devices such as smart phones, computers, servers, etc. that can perform text editing methods.

[0181] The electronic device provided in the embodiment of the present invention can implement each process implemented by the regional retention method in the above method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described here.

[0182] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the text editing method provided by the embodiment of the present invention are implemented, and the same technical effects can be achieved. To avoid repetition, they will not be described here.

[0183] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The computer-readable storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0184] The above disclosure is merely a preferred embodiment of the present invention and certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A text processing method, characterized in that: The method comprises the following steps: Obtaining a target text to be edited and a first prompt text corresponding to the target text, wherein the first prompt text includes a first prompt field corresponding to the area to be edited, a second prompt field corresponding to the editing mode, and a first result generation prompt field; Performing a first text processing on the target text based on the first prompt text and the large language model to obtain a pre-edited text, wherein the pre-edited text includes at least one pre-selected editing area, and each pre-selected editing area corresponds to at least one pre-selected editing content; Returning the pre-edited text to the user, so that the user can perform a confirmation operation or an editing operation on the pre-edited text; receiving a user-edited text returned by the user, wherein the user-edited text is the text after the user performs a confirmation operation or an editing operation on the pre-edited text, and the user-edited text includes at least one user-editing area, and each user-editing area corresponds to at least one user-edited content; Determine a second prompt text based on the user edited text, the second prompt text including a third prompt field corresponding to the user edited area, a fourth prompt field corresponding to the user edited content, and a second result generation prompt field; A second text processing is performed on the target text based on the second prompt text and the large language model to obtain a target edited text.

2. The text processing method according to claim 1, wherein: The step of obtaining a target text to be edited and a first prompt text corresponding to the target text includes: Get the target text entered by the user; Performing semantic analysis on the target text to obtain a text semantic label and a text editing mode label of the target text; Based on the text semantic tag selected by the user, a first prompt field corresponding to the area to be edited is generated, and based on the text editing mode tag selected by the user, a second prompt field corresponding to the editing mode is generated; Alternatively, obtaining the user's historical editing data, wherein the historical editing data includes historical editing content and a historical editing area corresponding to the historical editing content; Determining a user semantic tag and a user editing mode tag of the user based on the historical editing data; Based on the user semantic tag, a first prompt field corresponding to the area to be edited is generated, and based on the user editing mode tag, a second prompt field corresponding to the editing mode is generated; The first prompt field and the second prompt field are filled in a first prompt template to obtain a first prompt text corresponding to the target text. The first prompt template is provided with a first result generation prompt field by default.

3. The text processing method according to claim 1, wherein: The performing first text processing on the target text based on the first prompt text and the large language model to obtain a pre-edited text includes: Based on the first prompt field, determining at least one region to be edited in the target text using a large language model; For one of the regions to be edited, extracting a first text content corresponding to the region to be edited from the target text using the large language model; Based on the second prompt field, editing the first text content using the large language model to obtain at least one pre-selected editing content corresponding to the area to be edited; Marking the target text based on at least one of the to-be-edited regions to obtain at least one pre-selected editing region, each pre-selected editing region corresponding to one of the to-be-edited regions; At least one corresponding pre-selected editing content is added to the pre-selected editing area to obtain a pre-edited text.

4. The text processing method according to claim 3, wherein: Adding the corresponding at least one pre-selected editing content to the pre-selected editing area to obtain the pre-edited text includes: For one of the pre-selected editing areas, if there is only one corresponding pre-selected editing content, then the corresponding pre-selected editing content is added to the pre-selected editing area; If there are multiple corresponding pre-selected edit contents, then adding the multiple pre-selected edit contents to the pre-selected edit area in descending order of confidence of the pre-selected edit contents, where the confidence is obtained from the output of the large language model; After at least one corresponding pre-selected editing content is added to all the pre-selected editing areas, a pre-edited text is obtained.

5. The text processing method according to claim 1, wherein: The determining of the second prompt text based on the user edited text includes: Extracting at least one user-edited area and at least one user-edited content corresponding to the user-edited area from the user-edited text; generating at least one third prompt field based on at least one user editing area, wherein each user editing area corresponds to one third prompt field; For one of the user editing areas, generating at least one fourth prompt field based on at least one of the user edited contents corresponding to the user editing area, wherein each of the user edited contents corresponds to one fourth prompt field; The third prompt field and the fourth prompt field are filled in the second prompt template to obtain a second prompt text, and the second prompt template is provided with a second result generation prompt field by default.

6. The text processing method according to claim 5, wherein: The generating of at least one fourth prompt field based on at least one user-edited content, wherein each user-edited content corresponds to one fourth prompt field, includes: For one of the user-edited contents, determining whether the version of the user-edited content is a user-confirmed version or a user-edited version, wherein the user-edited content of the user-confirmed version is configured as the pre-selected edited content for the user to perform a confirmation operation, and the user-edited content of the user-edited version is configured as the pre-selected edited content for the user to perform an editing operation; If the version of the user-edited content is the user-confirmed version, generating a fourth prompt field corresponding to the user-edited content based on the user-edited content; If the version of the user-edited content is the user-edited version, a fourth prompt field corresponding to the user-edited content is generated based on the user-edited content and pre-edited content corresponding to the user-edited content.

7. The text processing method according to any one of claims 1 to 6, characterized in that: The performing second text processing on the target text based on the second prompt text and the large language model includes: Based on the third prompt field, determining at least one target editing region in the target text by using a large language model, each target editing region corresponding to a user editing region; For one target editing area, determining in the fourth prompt field at least one user-edited content corresponding to the target editing area; Determining, in the target text, second text content corresponding to the target editing area using the large language model; If the number of the user-edited content corresponding to the target editing area is one, replacing the second text content with the user-edited content using the large language model; If the user edited content data corresponding to the target editing area is one, multiple second text contents are fused through the large language model to obtain fused edited content, and the second text content is replaced with the fused edited content.

8. A text processing device, characterized in that: The text processing device comprises: An acquisition module, configured to acquire a target text to be edited and a first prompt text corresponding to the target text, wherein the first prompt text includes a first prompt field corresponding to the area to be edited, a second prompt field corresponding to the editing mode, and a first result generation prompt field; a first processing module, configured to perform a first text processing on the target text based on the first prompt text and a large language model to obtain a pre-edited text, wherein the pre-edited text includes at least one pre-selected editing area, each pre-selected editing area corresponding to at least one pre-selected editing content; A return module, configured to return the pre-edited text to the user, so that the user can perform a confirmation operation or an editing operation on the pre-edited text; a receiving module, configured to receive a user-edited text returned by the user, wherein the user-edited text is the text after the user performs a confirmation operation or an editing operation on the pre-edited text, and the user-edited text includes at least one user-editing area, each of which corresponds to at least one user-edited content; A second processing module is configured to determine a second prompt text based on the user edited text, where the second prompt text includes a third prompt field corresponding to the user editing area, a fourth prompt field corresponding to the user edited content, and a second result generation prompt field; The third processing module is configured to perform a second text processing on the target text based on the second prompt text and the large language model to obtain a target edited text.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the text processing method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the text processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data processing method and device

    CN116306672A

  • Text modification method and device, computer equipment and computer readable storage medium

    CN117313675A