Document editing method and device, equipment, medium and product
By introducing AI editing components and large language models into document editing, the problem of low intelligence in the existing technology is solved, efficient and convenient document editing is achieved, and editing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411676561.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-04-04
AI Technical Summary
The existing technology is not very intelligent in document editing, and the editing quality and efficiency need to be improved, making it difficult to efficiently and conveniently edit document.
By displaying candidate components, including AI editing components, calling large language model (LLM) for content editing, generating prompt information in response to trigger instructions, and editing document content based on prompt information.
It realizes efficient and convenient document editing, improves the intelligence of editing, and improves editing efficiency and accuracy.
Smart Images

Figure CN119761315A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to technical fields such as document generation, document editing, large models, deep learning, and more particularly to a document editing method, device, equipment, medium and product. Background Art
[0002] In some scenarios, users need to edit documents, such as editing papers.
[0003] How to edit documents efficiently and conveniently is a problem that needs to be solved. Summary of the invention
[0004] The present disclosure provides a document editing method, apparatus, device, medium and product.
[0005] According to one aspect of the present disclosure, a document editing method is provided, comprising: displaying candidate components, the candidate components being used to edit original document content, and the candidate components comprising an AI editing component, the AI editing component being used to call LLM for content editing; in response to a trigger instruction for the AI editing component, generating prompt information based on the trigger instruction; and using the LLM to perform content editing on the original document content based on the prompt information to obtain target document content.
[0006] According to another aspect of the present disclosure, a document editing device is provided, comprising: a display module for displaying candidate components, wherein the candidate components are used to edit original document content, and the candidate components include an AI editing component, wherein the AI editing component is used to call LLM for content editing; a generation module for responding to a trigger instruction for the AI editing component and generating prompt information based on the trigger instruction; and an editing module for using the LLM to edit the original document content based on the prompt information to obtain target document content.
[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method as described in any of the above aspects.
[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to any one of the above aspects.
[0009] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the methods described in any one of the above aspects.
[0010] According to the embodiments of the present disclosure, document editing can be performed efficiently and conveniently.
[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0013] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0014] Figure 2 is a schematic diagram of an application scenario for implementing an embodiment of the present disclosure;
[0015] Figure 3 is a schematic diagram of a document uploading process provided according to an embodiment of the present disclosure;
[0016] Figure 4 is a schematic diagram according to a second embodiment of the present disclosure;
[0017] Figure 5 is a schematic diagram according to a third embodiment of the present disclosure;
[0018] Figure 6 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0019] Figure 7 is a schematic diagram according to a fifth embodiment of the present disclosure;
[0020] Figure 8 It is a schematic diagram of an electronic device used to implement the document editing method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0022] In the related technologies, usually only basic editing such as font, font size, color, etc. can be performed on documents. The degree of intelligence is not high, and the editing quality and efficiency need to be improved.
[0023] In order to edit documents efficiently and conveniently, the present disclosure provides the following embodiments.
[0024] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure. This embodiment provides a document editing method, such as Figure 1 As shown, the method includes:
[0025] 101. Display candidate components, where the candidate components are used to edit the original document content, and the candidate components include an AI editing component, where the AI editing component is used to call LLM to edit the content.
[0026] 102. In response to a trigger instruction for the AI editing component, generate prompt information based on the trigger instruction.
[0027] 103. Edit the original document content using the LLM based on the prompt information to obtain target document content.
[0028] This embodiment is executed by an editing platform, and the editing platform is accessed through a browser to achieve online editing.
[0029] The original document content refers to the document content to be edited.
[0030] The editing platform can provide an editing page, which can include an editable area. Initially, the content of the editable area is empty. Afterwards, the target object, such as the user, can enter the original document content in the editable area. Alternatively, the user can also upload a document, and the editing platform can parse the document to obtain the original document content.
[0031] Candidate components can also be set in the editing page, and the original document content can be edited through the candidate components.
[0032] The original document content may be empty or not empty. For example, the initial blank content may be used as the original document content, or after the user inputs a paragraph of text, the paragraph of text may be used as the original document content.
[0033] Editing may include content editing and / or format editing.
[0034] Among them, content editing is to modify the content. After the original document content is edited, the target document content is obtained, and the target document content is different from the original document content. For example, the original document content can be empty, and the editing can be specifically generated, so that the document can be generated from scratch. Alternatively, the editor can rewrite the existing original document content, such as abbreviating or expanding it, to obtain the rewritten target document content.
[0035] Format editing is to modify the format, changing the original document content from a first format to a second format, such as changing the font size, etc. The content before and after the modification is consistent.
[0036] In order to realize intelligent editing, editing can be performed based on artificial intelligence (AI) technology, and the corresponding component can be called an AI editing component.
[0037] The AI editing component is used to call the Large Language Model (LLM) for content editing.
[0038] LLM is a hot technology in the field of artificial intelligence in recent years. LLM is a pre-trained language model. By pre-training on massive text data, it learns rich language knowledge and world knowledge, so that it can achieve amazing results in various natural language processing (Natural Language Processing, NLP), image generation and other tasks.
[0039] Editing using LLM can include: generation, such as outline generation, article generation, etc.; rewriting, such as expansion, abbreviation, etc.; summarization and other operations.
[0040] Specifically, an "AI Editing" button can be set on the editing page, which may include buttons such as "Outline Generation", "Article Generation", "Rewrite", and "Summary". After the user clicks these buttons, corresponding trigger instructions are generated. For example, after the user clicks the "Outline Generation" button, an editing instruction for executing outline generation is generated.
[0041] LLM performs specific editing operations based on prompt information. For example, after the user clicks the "Generate Outline" button, the outline generation operation is performed, and after the user clicks the "Rewrite" button, the rewrite operation is performed.
[0042] To this end, after receiving a trigger instruction from the target object for the AI editing component, such as a click instruction, prompt information can be generated based on the trigger instruction, and the prompt information can be input into the LLM. The LLM edits the content based on the prompt information, and the output is the target document content.
[0043] After the LLM obtains the target document content, it can return the target document content to the editing platform, and the editing platform displays the target document content, such as displaying the rewritten document content.
[0044] In this embodiment, by displaying candidate components and editing based on the candidate components, component visualization can be achieved, so that users can edit documents through visualized components to improve usability. In addition, editing through LLM can improve the level of intelligence, improve editing efficiency and accuracy, thereby achieving efficient and convenient document editing.
[0045] In order to better understand the present disclosure, the application scenarios involved in the present disclosure are described as follows:
[0046] Figure 2 It is a schematic diagram of an application scenario for implementing the embodiment of the present disclosure.
[0047] like Figure 2 As shown, this embodiment provides an editing platform, and users can access the editing platform through a browser to implement online document editing.
[0048] The editing platform can have a built-in editor, which is encapsulated into a user interface component based on the built-in editor to provide a more efficient and easier to integrate editor function. Among them, the built-in editor can be a rich text editor, which allows users to create and edit text content containing multiple formats on the web page, such as bold, italic, underline, list, quote and other formats. In addition to the basic editing functions provided by the built-in editor, the editing platform of this embodiment can also provide AI editing, formatting, uploading documents and other functions. AI editing can include: generating outlines, generating articles, rewriting, summarizing, etc. The uploaded document format can be Word, Txt and other formats.
[0049] The editing platform provides an editing page, which includes an editable area, in which the user can enter the original document content to be edited. Alternatively, the user can also upload a document through the "Upload Document" component, and the editing platform will parse the content of the document uploaded by the user to obtain the original document content.
[0050] Regarding document uploading: the target document can be segmented to obtain segmented files; an upload queue is generated based on the segmented files, and the segmented files are stored in sequence in the upload queue; the segmented files are uploaded to a preset storage server in sequence based on the upload queue; and the segmented files are obtained from the preset storage server to form the target document.
[0051] The preset storage server is, for example, a cloud storage service, which has a resumable upload function, thereby achieving a stable and reliable document upload process.
[0052] Figure 3 It is a schematic diagram of a document uploading process provided according to an embodiment of the present disclosure.
[0053] like Figure 3 As shown, the document upload process may include:
[0054] 301. In response to a document upload instruction, establish an upload link with a cloud storage server for continued uploading.
[0055] Among them, the editing platform can provide an "upload document" component, and after the user clicks on the component, a document upload instruction can be generated.
[0056] A cloud storage client can be deployed on the editing platform, and the client can obtain the file information of the document to be uploaded, including the file name, file size, file type, etc., through the application programming interface (API) of the file system.
[0057] After obtaining the file information, the client can use the cloud storage API to initialize a resumable upload session request and establish a resumable upload link with the cloud storage server, which will be used for subsequent file segment uploads.
[0058] 302. Segment the target document uploaded by the target object to obtain segment files.
[0059] The target object may be a user, and the user may upload a local target document to the editing platform.
[0060] In order to ensure the stability and reliability of the upload process, the editing platform slices the target document's file content according to a preset size (e.g., 5MB) to obtain slice files, where the size of the slice can be adjusted according to actual conditions to balance the upload speed and server load. These slice files can form a slice file array.
[0061] 303. Generate an upload queue based on the segment files and the upload link, and upload the segment files to the cloud storage server in sequence through the upload queue.
[0062] After obtaining the segmented files, these segmented files and the upload link established above can be combined into an upload queue for continued uploading. The queue is uploaded in sequence according to the sequence of the segmented files to ensure the order and integrity of the file upload.
[0063] Due to the resumable upload feature of the cloud storage service, if a network interruption or other abnormal situation occurs during the upload process, the client can re-acquire the upload link and continue uploading from the last interrupted position until all segment files are uploaded.
[0064] 304. After all the segment files are uploaded successfully, the segment files are obtained from the cloud storage server.
[0065] When all segment files are successfully uploaded to the cloud storage server, the client can send an upload success message to the editing platform. The editing platform obtains these segment files from the cloud storage server based on the upload success message, parses these segment files, and obtains the original document content.
[0066] In this embodiment, by segmenting the target document and uploading it based on the segmented files, the transmission burden can be reduced, and the transmission can be resumed at the breakpoint, thereby improving the reliability of document uploading and the success rate of document uploading.
[0067] After obtaining the original document content, the original document content can be edited, such as AI editing, formatting, etc. Among them, the AI editing component can be used to edit the content using LLM; the original document content can be formatted using a preset template.
[0068] In addition, users can also perform basic editing operations such as font and font size on the original document content or the target document content after AI editing. For example, controls such as font adjustment are also provided on the editing page. After the user clicks these controls, the editing platform can use the built-in editor to perform these basic editing operations.
[0069] The editing platform can also provide a download component. After the user clicks the download component, the edited document can be downloaded. The user can save the edited document locally for subsequent use. The editing platform can provide a variety of download formats for users to choose from. Users can choose the appropriate format according to their needs, such as Word or PDF format for downloading.
[0070] In combination with the above application scenarios, the present disclosure also provides the following embodiments.
[0071] Figure 4 is a schematic diagram according to the second embodiment of the present disclosure. This embodiment provides a document editing method, such as Figure 4 As shown, the method includes:
[0072] 401. Display candidate components, where the candidate components are used to edit the original document content.
[0073] Among them, the candidate components can be displayed on the editing page provided by the editing platform, so that the document can be edited through the candidate components.
[0074] Candidate components may include: AI editing component, formatting component, etc.
[0075] AI editing component, used to call LLM for content editing.
[0076] The formatting component is used to format documents.
[0077] The AI editing components further include: generation components, such as outline generation, article generation, etc.; rewriting components, such as abbreviation, expansion, etc.; summary components, such as content summary of the original document content.
[0078] 402. Get the original document content.
[0079] The original document content input by the target object may be received; or a target document uploaded by the target object may be received, and the target document may be parsed to obtain the original document content.
[0080] For example, the editing page provided by the editing platform includes an editable area. Taking the target object as a user, the user can enter text in the editable area as the original document content. Or,
[0081] refer to Figure 2 , an "Upload Document" component can be set in the editing page. After the user clicks on the component, he can upload the document to the editing platform. After the editing platform parses the document, it obtains the original document content.
[0082] In this embodiment, the original document content may be obtained by receiving the original document content input by the target object or parsing the document uploaded by the target object. The original document content may be obtained in a variety of ways, thereby increasing flexibility and improving user experience.
[0083] 403. In response to a trigger instruction for the AI editing component in the candidate component, generate prompt information based on the trigger instruction; and use LLM to edit the original document content based on the prompt information to obtain the target document content.
[0084] For content editing, you can use AI technology and call LLM to implement it.
[0085] Specifically, the original document content and the trigger instructions for the AI editing component can be carried in the prompt information and input into the LLM. Based on the instructions in the prompt information, such as generate or rewrite, the LLM performs corresponding operations such as generate or rewrite on the original document content in the prompt information.
[0086] During generation, the original document content may be empty, that is, LLM may be used to generate content from scratch, such as generating an outline or generating an article.
[0087] At this time, the AI editing component includes: a generation component; accordingly, in response to a trigger instruction for the generation component, a query statement input by the target object is obtained, and the query statement is used to describe the content of the target document; based on the target scene corresponding to the editing component, the query statement is processed to generate the prompt information.
[0088] refer to Figure 2 The generation component can be used to generate an outline or an article. Taking the generation of an outline as an example, after the user clicks the "Generate Outline" component (button), the editing platform can provide the user with a search box, in which the user can enter a query statement (query). The query statement is used to describe the content of the target document to be generated, and can specifically be the topic of the target document content. The topic can then be carried in the prompt information and sent to LLM, so that LLM can generate an outline on the topic.
[0089] In specific scenarios, such as paper writing scenarios, the query statements entered by users may not be standardized and accurate enough. In order to improve the effectiveness of the prompt information, the query statements can be processed based on the target scenario, such as the paper writing scenario, to obtain prompt information suitable for the corresponding scenario.
[0090] In this embodiment, the query statement is processed based on the target scenario to obtain prompt information. Compared with the method of using the query statement as prompt information, prompt information adapted to the target scenario can be obtained, thereby improving the effectiveness and accuracy of the prompt information and further improving the document editing effect.
[0091] The query statement is processed based on the target scenario, and the processing may be performed based on a rule corresponding to the preset target scenario, or the query statement may be processed based on a deep learning model corresponding to the target scenario.
[0092] That is, a pre-trained generation model may be used to process the input query statement to output the prompt information; the generation model is trained based on samples of the target scene.
[0093] For example, in a paper writing scenario, you can use paper-related samples to train a generative model. After obtaining the query statement entered by the user, the query statement is input into the generative model, and the output is prompt information.
[0094] Among them, the generative model can be pre-trained using adversarial generative training, that is, the training process includes a generative model and a discriminative model, the generative model is used to generate and process the input random noise, output the predicted content of the paper scene, and then the predicted content and the real sample of the paper scene are input into the discriminative model, the output is the true and false discrimination result, and the true and false discrimination result is used to adjust the parameters of the generative model and the discriminative model until the preset end condition is reached, and the final generative model is obtained. The generative model is used to obtain prompt information based on the query statement in the reasoning stage.
[0095] In addition, when the generative model obtains prompt information based on a query statement, it can retrieve documents of corresponding scenarios, such as paper scenarios, and generate prompt information based on the retrieval results.
[0096] In this embodiment, the query statement is processed based on the generation model to obtain prompt information, and the excellent performance of the deep learning model can be used to improve the accuracy of the prompt information, thereby improving the document editing effect.
[0097] The above describes the generation process. For other AI editing, such as rewriting or summarizing, the corresponding components can be called other components. At this time, the prompt information can be generated based on the trigger instruction and the original document content in response to the trigger instruction for the other component.
[0098] For rewriting or summarizing, there is usually an existing original document content, that is, the original document content is not empty, and the existing original document content is rewritten or summarized. Taking rewriting as an example, the original document content and the rewriting instruction can be carried in the prompt information, and the prompt information is input into the LLM. Based on the prompt information, the LLM rewrites the original document content to obtain the target document content.
[0099] In this embodiment, for other components, prompt information is generated based on the trigger instruction and the original document content, so that the prompt information can be obtained simply and efficiently, thereby improving processing efficiency.
[0100] The above describes the AI editing process. Other editing processes can also be performed, such as formatting. Based on this, it can also include:
[0101] 404. In response to a trigger instruction for a format arrangement component in the candidate components, display multiple preset candidate formats; in response to a selection instruction for the multiple candidate formats by a target object, determine a target format from the multiple candidate formats; based on the target format, format the original document content to obtain the original document content having the target format.
[0102] For example, after the user clicks on the "Format Arrangement" component, the editing platform can provide a variety of candidate formats. These candidate formats are preset by the editing platform, and the user can choose from these candidate formats. If the user clicks on a candidate format as the target format, the editing platform will then organize the document into the target format.
[0103] In this embodiment, by providing multiple candidate formats, the target object determines the target format by selection, and uses the target format for formatting, which can realize automation of formatting without the need for manual formatting by the user, thereby improving the user experience.
[0104] The above-mentioned candidate formats may be provided in the form of templates. For example, for a certain candidate format, the paragraph division method of the article, the font, size, color and other information of each paragraph may be configured in the template. After the user selects the target format, the original document content will have the paragraph division method, font, size, color and other information corresponding to the target format.
[0105] In this way, through reasonable paragraph division, the article can be made clearer and easier to read, making it easier for readers to understand the author's ideas.
[0106] The above-mentioned font, font size, color and other information can be specifically a small gray font. For example, the title of each paragraph in the template is set to be in a large black font, and the specific content under the title is in a small gray font. In this way, after the user selects the template, the title will be in a large black font and the specific content will be in a small gray font. This can avoid interference with the main content. At the same time, the small gray font can also make it easier for readers to browse the article without feeling tired due to too much information.
[0107] In this way, by setting the paragraph format and processing the content in gray and small fonts, the user experience can be improved and readers can read the article more happily.
[0108] Figure 5 is a schematic diagram according to the third embodiment of the present disclosure. This embodiment provides a document editing method, such as Figure 5 As shown, the method includes:
[0109] 501. Display candidate components, where the candidate components are used to edit the original document content, and the candidate components include an AI editing component, where the AI editing component is used to call LLM to edit the content.
[0110] 502. Obtain original document content.
[0111] 503. In response to a trigger instruction for the AI editing component, generate prompt information based on the trigger instruction and the target language of the original document content, and use LLM to edit the original document content based on the prompt information to obtain target document content in the target language.
[0112] After obtaining the original document content, the original document content can be language identified to identify the language used in the original document content. The language used in the original document content is called the target language, such as Chinese or English. Specifically, the editing platform can perform language identification based on a preset classification model or preset language feature recognition rules. When the proportion of a certain language in the original document content is greater than a preset proportion (such as 80%), the language can be used as the target language.
[0113] After determining the language of the original document content, you can instruct LLM to generate the target document content in the corresponding language. For example, if the original document content is in English, then the target document content is also in English.
[0114] In this embodiment, the target language based on the original document content is processed to obtain the target document content in the target language, which can ensure that the input language and the output language are consistent, improve the accuracy of the target document content and its consistency with the original document content, and improve editing efficiency and accuracy.
[0115] In some embodiments, the word segmentation result of the target document content can also be obtained; based on the word segmentation result, the target document content is displayed.
[0116] For example, when using LLM for content editing, you can also instruct LLM to perform word segmentation in the prompt information. In this way, LLM can output the target document content after word segmentation. After the editing platform obtains the target document content after word segmentation, it can display the content based on the word segmentation results.
[0117] In this embodiment, content display based on word segmentation results can ensure that a word segmentation is displayed in the same line, improving readability. In addition, by instructing LLM to perform word segmentation, LLM can perform different word segmentation processing based on different languages to obtain word segmentation results corresponding to each language, which can be applied to the processing process of different languages, so that documents in multiple languages can be edited and accurate word segmentation results can be obtained, making the editing platform more accurate and efficient when processing multiple languages.
[0118] Figure 6 is a schematic diagram according to the fourth embodiment of the present disclosure. This embodiment provides a document editing method, such as Figure 6 As shown, the method includes:
[0119] 601. Display candidate components, where the candidate components are used to edit original document content.
[0120] 602. Obtain original document content.
[0121] 603. Convert the data format of the original document content into a preset data format.
[0122] The initial data format of the original document content is usually a common format, such as Word or Txt format. In order to improve the privacy and security of the data, the initial data format can be converted into a preset data format, and then the document content in the preset data format can be edited. The preset data format is a custom data format, which can be called bdjson format, which is different from the common format.
[0123] In this embodiment, by converting the original document content into a preset data format and editing the content in the preset data format, the privacy and security of the data can be improved.
[0124] In some embodiments, the method may further include:
[0125] 604. Convert the original document content in the preset data format into original document content in a target data format, where the target data format is a data format supported by the built-in editor.
[0126] 605. Render the original document content in the target data format through the built-in editor to display the original document content.
[0127] For example, the built-in editor is a rich text editor. Assuming that the data format supported by the rich text editor is the Delta format, when displaying the content, the document content in the bdjson format can be first converted to the Delta format, and the rich text editor is used to render the Delta format document content to display the corresponding document content.
[0128] After the original document content is displayed, it can be edited.
[0129] In this embodiment, by converting the original document content in a preset data format into a target data format, a data format supported by the built-in editor can be obtained, so that when the original document content is rendered by the built-in editor, feasibility can be guaranteed and normal display of the original document content can be guaranteed.
[0130] 606. In response to the trigger instruction for the candidate component, edit the original document content in the preset data format.
[0131] For example, edit the original document content in bdjson format.
[0132] Taking the use of LLM for content editing as an example, the data format conversion process may include: converting the original document content in the initial data format (such as Word format) into the original document content in the bdjson format; converting the original document content in the bdjson format into the original document content in the Delta format, using a rich text editor to render the original document content in the Delta format, and displaying the original document content; after receiving the AI editing instruction, converting the original document content in the bdjson format into the original document content in the LLM supported format (such as text format); using LLM to edit the original document content in the text format to obtain the target document content in the text format; then converting the target document content in the text format into the target document content in the bdjson format; then converting the target document content in the bdjson format into the target document content in the Delta format, using a rich text editor to render the target document content in the Delta format, and displaying the target document content; when downloading is required, converting the target document content in the bdjson format into a document in a download format (such as Word format) for user downloading.
[0133] In this way, through the above-mentioned data format conversion process, the required display, editing, downloading and other operations can be completed, thereby improving the success rate of processing.
[0134] Figure 7 It is a schematic diagram according to the fifth embodiment of the present disclosure. This embodiment provides a document editing device. The device 700 includes: a display module 701, a generation module 702 and an editing module 703.
[0135] The display module 701 is used to display candidate components, which are used to edit the original document content, and the candidate components include an AI editing component, which is used to call LLM for content editing; the generation module 702 is used to respond to a trigger instruction for the AI editing component and generate prompt information based on the trigger instruction; the editing module 703 is used to use the LLM to edit the original document content based on the prompt information to obtain the target document content.
[0136] In this embodiment, by displaying candidate components and editing based on the candidate components, component visualization can be achieved, so that users can edit documents through visualized components to improve usability. In addition, editing through LLM can improve the level of intelligence, improve editing efficiency and accuracy, thereby achieving efficient and convenient document editing.
[0137] In some embodiments, the AI editing component includes: a generation component;
[0138] The generating module 702 is further used for:
[0139] In response to a trigger instruction for the generating component, obtaining a query statement input by a target object, wherein the query statement is used to describe the content of the target document;
[0140] Based on the target scenario corresponding to the editing component, the query statement is processed to generate the prompt information.
[0141] In this embodiment, the query statement is processed based on the target scenario to obtain prompt information. Compared with the method of using the query statement as prompt information, prompt information adapted to the target scenario can be obtained, thereby improving the effectiveness and accuracy of the prompt information and further improving the document editing effect.
[0142] In some embodiments, the generating module 702 is further used to:
[0143] The input query statement is processed using a pre-trained generation model to output the prompt information; wherein the generation model is trained based on samples of the target scene.
[0144] In this embodiment, the query statement is processed based on the generation model to obtain prompt information, and the excellent performance of the deep learning model can be used to improve the accuracy of the prompt information, thereby improving the document editing effect.
[0145] In some embodiments, the AI editing component includes: other components besides the generation component;
[0146] The generating module 702 is further used for:
[0147] In response to a trigger instruction for the other component, the prompt information is generated based on the trigger instruction and the original document content.
[0148] In this embodiment, for other components, prompt information is generated based on the trigger instruction and the original document content, so that the prompt information can be obtained simply and efficiently, thereby improving processing efficiency.
[0149] In some embodiments, the candidate components further include: a formatting component;
[0150] The device 700 further includes:
[0151] A candidate module, for displaying a plurality of preset candidate formats in response to a trigger instruction for the format arrangement component;
[0152] a determination module, configured to determine a target format from among the plurality of candidate formats in response to a selection instruction of a target object for the plurality of candidate formats;
[0153] The arranging module is used to format the original document content based on the target format to obtain the original document content with the target format.
[0154] In this embodiment, by providing multiple candidate formats, the target object determines the target format by selection, and uses the target format for formatting, which can realize automation of formatting without the need for manual formatting by the user, thereby improving the user experience.
[0155] In some embodiments, the apparatus 700 further includes:
[0156] The acquisition module is used to receive the original document content input by the target object; or receive the target document uploaded by the target object, and parse the target document to obtain the original document content.
[0157] In this embodiment, the original document content may be obtained by receiving the original document content input by the target object or parsing the document uploaded by the target object. The original document content may be obtained in a variety of ways, thereby increasing flexibility and improving user experience.
[0158] In some embodiments, the acquisition module is further used to:
[0159] Slicing the target document to obtain slice files;
[0160] Generate an upload queue based on the segmented files and a pre-established upload link, and upload the segmented files to a preset storage server in sequence through the upload queue;
[0161] After all the segment files are uploaded successfully, the segment files are obtained from the preset storage server.
[0162] In this embodiment, by segmenting the target document and uploading it based on the segmented files, the transmission burden can be reduced, and the transmission can be resumed at the breakpoint, thereby improving the reliability of document uploading and the success rate of document uploading.
[0163] In some embodiments, the editing module 703 is further used to:
[0164] The LLM is used to edit the original document content based on the prompt information and the target language of the original document content to obtain the target document content in the target language.
[0165] In this embodiment, the target language based on the original document content is processed to obtain the target document content in the target language, which can ensure that the input language and the output language are consistent, improve the accuracy of the target document content and its consistency with the original document content, and improve editing efficiency and accuracy.
[0166] In some embodiments, the apparatus 700 further includes:
[0167] The word segmentation module is used to obtain the word segmentation result of the target document content; and based on the word segmentation result, display the target document content.
[0168] In this embodiment, content display based on word segmentation results can ensure that a word segmentation is displayed in the same line, improving readability. In addition, by instructing LLM to perform word segmentation, LLM can perform different word segmentation processing based on different languages to obtain word segmentation results corresponding to each language, which can be applied to the processing process of different languages, so that documents in multiple languages can be edited and accurate word segmentation results can be obtained, making the editing platform more accurate and efficient when processing multiple languages.
[0169] In some embodiments, the apparatus 700 further includes:
[0170] The conversion module is used to convert the data format of the original document content into a preset data format so as to edit the original document content in the preset data format.
[0171] In this embodiment, by converting the original document content into a preset data format and editing the content in the preset data format, the privacy and security of the data can be improved.
[0172] In some embodiments, the apparatus 700 further includes:
[0173] A rendering module is used to convert the original document content in the preset data format into the original document content in the target data format, where the target data format is a data format supported by the built-in editor; and, through the built-in editor, render the original document content in the target data format to display the original document content.
[0174] In this embodiment, by converting the original document content in a preset data format into a target data format, a data format supported by the built-in editor can be obtained, so that when the original document content is rendered by the built-in editor, feasibility can be guaranteed and normal display of the original document content can be guaranteed.
[0175] It can be understood that in the embodiments of the present disclosure, the same or similar contents in different embodiments can be referenced to each other.
[0176] It can be understood that the “first”, “second”, etc. in the embodiments of the present disclosure are only used for distinction and do not indicate the degree of importance, time sequence, etc.
[0177] It is understandable that unless there is any special limitation on the sequence of steps in the process, it means that the timing relationship between these steps is not limited.
[0178] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0179] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0180] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 800 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0181] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0182] Multiple components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0183] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a document editing method. For example, in some embodiments, the document editing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the document editing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the document editing method in any other appropriate manner (e.g., by means of firmware).
[0184] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0185] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable task processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0186] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0187] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0188] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0189] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0190] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0191] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A document editing method, comprising: Display candidate components, where the candidate components are used to edit the original document content, and the candidate components include an artificial intelligence AI editing component, where the AI editing component is used to call a large language model LLM to edit the content; In response to a trigger instruction for the AI editing component, generating prompt information based on the trigger instruction; The LLM is used to edit the original document content based on the prompt information to obtain the target document content.
2. The method according to claim 1, wherein: The AI editing component includes: a generation component; The step of generating prompt information based on the trigger instruction in response to the trigger instruction for the AI editing component includes: In response to a trigger instruction for the generating component, obtaining a query statement input by a target object, wherein the query statement is used to describe the content of the target document; Based on the target scenario corresponding to the editing component, the query statement is processed to generate the prompt information.
3. The method according to claim 2, wherein: The processing of the query statement based on the target scenario corresponding to the editing component to generate the prompt information includes: The input query statement is processed using a pre-trained generation model to output the prompt information; wherein the generation model is trained based on samples of the target scene.
4. The method according to claim 1, wherein: The AI editing component includes: other components besides the generation component; The step of generating prompt information based on the trigger instruction in response to the trigger instruction for the AI editing component includes: In response to a trigger instruction for the other component, the prompt information is generated based on the trigger instruction and the original document content.
5. The method according to claim 1, wherein: The candidate components also include: a format arrangement component; The method further comprises: In response to a trigger instruction for the format arrangement component, displaying a plurality of preset candidate formats; In response to a selection instruction of the target object for the plurality of candidate formats, determining a target format from the plurality of candidate formats; Based on the target format, the original document content is formatted to obtain the original document content having the target format.
6. The method according to claim 1, further comprising: Receiving the original document content input by the target object; or, A target document uploaded by a target object is received, and the target document is parsed to obtain the original document content.
7. The method according to claim 6, wherein: The receiving of the target document uploaded by the target object includes: Slice the target document to obtain slice files; Generate an upload queue based on the segmented files and a pre-established upload link, and upload the segmented files to a preset storage server in sequence through the upload queue; After all the segment files are uploaded successfully, the segment files are obtained from the preset storage server.
8. The method according to claim 1, wherein: The using the LLM to edit the original document content based on the prompt information to obtain the target document content includes: The LLM is used to edit the original document content based on the prompt information and the target language of the original document content to obtain the target document content in the target language.
9. The method according to claim 1, further comprising: Obtaining the word segmentation result of the target document content; Based on the word segmentation result, the target document content is displayed.
10. The method according to claim 1, further comprising: The data format of the original document content is converted into a preset data format to edit the original document content in the preset data format.
11. The method according to claim 10, further comprising: Converting the original document content in the preset data format into the original document content in the target data format, wherein the target data format is a data format supported by the built-in editor; The original document content in the target data format is rendered by the built-in editor to display the original document content.
12. A document editing device, comprising: A display module, used for displaying candidate components, wherein the candidate components are used to edit the original document content, and the candidate components include an artificial intelligence AI editing component, wherein the AI editing component is used to call a large language model LLM to edit the content; A generating module, configured to respond to a trigger instruction for the AI editing component and generate prompt information based on the trigger instruction; The editing module is used to edit the original document content based on the prompt information using the LLM to obtain the target document content.
13. The device according to claim 12, wherein: The AI editing component includes: a generation component; The generating module is further used for: In response to a trigger instruction for the generating component, obtaining a query statement input by a target object, wherein the query statement is used to describe the content of the target document; Based on the target scenario corresponding to the editing component, the query statement is processed to generate the prompt information.
14. The device according to claim 13, wherein: The generating module is further used for: The input query statement is processed using a pre-trained generation model to output the prompt information; wherein the generation model is trained based on samples of the target scene.
15. The device according to claim 12, wherein: The AI editing component includes: other components besides the generation component; The generating module is further used for: In response to a trigger instruction for the other component, the prompt information is generated based on the trigger instruction and the original document content.
16. The device according to claim 12, wherein: The candidate components also include: a format arrangement component; The device also includes: A candidate module, for displaying a plurality of preset candidate formats in response to a trigger instruction for the format arrangement component; a determination module, configured to determine a target format from among the plurality of candidate formats in response to a selection instruction of a target object for the plurality of candidate formats; The arranging module is used to format the original document content based on the target format to obtain the original document content with the target format.
17. The apparatus according to claim 12, further comprising: An acquisition module, used for receiving the original document content input by the target object; Alternatively, a target document uploaded by a target object is received, and the target document is parsed to obtain the original document content.
18. The device according to claim 17, wherein: The acquisition module is further used for: Slice the target document to obtain slice files; Generate an upload queue based on the segmented files and a pre-established upload link, and upload the segmented files to a preset storage server in sequence through the upload queue; After all the segment files are uploaded successfully, the segment files are obtained from the preset storage server.
19. The device according to claim 12, wherein: The editing module is further used for: The LLM is used to edit the original document content based on the prompt information and the target language of the original document content to obtain the target document content in the target language.
20. The apparatus according to claim 12, further comprising: A word segmentation module, used to obtain the word segmentation result of the target document content; And, based on the word segmentation result, the target document content is displayed.
21. The apparatus according to claim 12, further comprising: The conversion module is used to convert the data format of the original document content into a preset data format so as to edit the original document content in the preset data format.
22. The apparatus according to claim 21, further comprising: A rendering module is used to convert the original document content in the preset data format into the original document content in the target data format, where the target data format is a data format supported by the built-in editor; and, through the built-in editor, render the original document content in the target data format to display the original document content.
23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.
24. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-11.
25. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 11.
Citation Information
Cited By
Document editing method and apparatus, device, medium and product
WO2026108365A1