Document processing method and device based on large model, equipment and storage medium

By introducing the target interface and format setting interface into the documents generated by the large model, the document format is automatically adjusted, which solves the problem of time-consuming and laboriousness of traditional document editing software that is difficult to adapt to browser display and users to set long document formats, and achieves efficient and accurate document format settings.

CN119647418AActive Publication Date: 2025-03-18BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202411554634.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-03-18
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process document formats generated by large models, traditional document editing software is difficult to adapt to documents displayed by browsers, and users are time-consuming and labor-intensive and prone to errors when setting long document formats.

Method used

Provide a document processing method based on a large model, determines document format requirements through the target interface, sets the format setting interface of the document editor, and automatically adjusts the document format according to the format requirements, simplifies format setting operations, and reduces human errors.

Benefits of technology

It realizes automatic adjustment of document format, simplifies format setting operations, improves the quality and speed of document processing, and reduces human errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647418A_ABST
    Figure CN119647418A_ABST
Patent Text Reader

Abstract

The invention provides a document processing method, device and equipment based on a large model and a storage medium, relates to the technical field of artificial intelligence, in particular to the technical fields of large models, computer vision, voice technologies, intelligent search and the like, and can be used for application scenes such as generative search, document intelligent editing and intelligent assistants. According to the specific implementation scheme, in response to an interface operation of a target object on a target interface, a format requirement of a target document is determined; wherein the target document is obtained based on large model processing; based on the format requirement of the target document, setting a format setting interface in a target document editor; and based on the format setting interface, performing format setting processing on the target document according to the format requirement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to technical fields such as large models, computer vision, voice technology, and intelligent search. Background Art

[0002] With the development of artificial intelligence technology, simple human-computer dialogue and voice control technology have become relatively mature. The development of large models can not only complete complex tasks, but also further improve the intelligence level of document analysis and processing. Document processing is moving towards a more intelligent, personalized and efficient direction. Summary of the invention

[0003] The present disclosure provides a document processing method, apparatus, device and storage medium based on a large model.

[0004] According to one aspect of the present disclosure, a document processing method based on a large model is provided, comprising:

[0005] In response to the interface operation of the target object on the target interface, the format requirement of the target document is determined; wherein the target document is obtained based on the large model processing;

[0006] Based on the format requirements of the target document, a format setting interface in the target document editor is set;

[0007] Based on the format setting interface, the document format of the target document is set according to the format requirement.

[0008] According to another aspect of the present disclosure, a document processing device based on a large model is provided, comprising:

[0009] A determination module, used to determine the format requirements of a target document in response to an interface operation of a target object on a target interface; wherein the target document is obtained based on the large model processing;

[0010] A setting module, used for setting a format setting interface in a target document editor based on the format requirements of the target document;

[0011] The processing module is used to set the document format of the target document according to the format requirement based on the format setting interface.

[0012] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] 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 execute any method in the embodiments of the present disclosure.

[0016] 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 method according to the embodiments of the present disclosure.

[0017] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.

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

[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0020] Figure 1 It is a flowchart of a document processing method based on a large model provided according to an embodiment of the present disclosure;

[0021] Figure 2 is a schematic diagram of a process for determining the format requirements of a target document according to an embodiment of the present disclosure;

[0022] Figure 3 is a schematic diagram of a process for formatting a target document according to an embodiment of the present disclosure;

[0023] Figure 4 is a schematic diagram of a structure for sequentially processing slices according to an embodiment of the present disclosure;

[0024] Figure 5 It is a back-end schematic diagram of a document processing method based on a large model provided according to an embodiment of the present disclosure;

[0025] Figure 6 is a structural schematic diagram of a document processing device based on a large model provided according to an embodiment of the present disclosure;

[0026] Figure 7 It is a block diagram of an electronic device used to implement the document processing method based on a large model according to an embodiment of the present disclosure. DETAILED DESCRIPTION

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

[0028] The terms "first", "second", etc. in this disclosure are used to distinguish similar objects, and are not necessarily used to describe a specific order or precedence. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, including a series of steps or units. The method, system, product or device is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] With the rapid development of Internet technology and social media, big models can help generate and rewrite documents. Big models can generate documents in a variety of formats, such as plain text documents, PDF (Portable Document Format) format documents, etc. Among them, some documents generated by big models only have text information and do not have corresponding formats, such as plain text documents. Other documents generated by big models have corresponding text formats and can be illustrated with text and pictures, but if you want to modify the format, the operation is complicated, such as documents in HTML (HyperText Markup Language) format.

[0030] At present, some documents generated by large models face the problem that traditional document editing methods are not very applicable or inefficient. For example, with the development of artificial intelligence technology, many large models support interaction with users through browsers, and documents also need to be displayed through browser pages such as HTML. Users often need to edit documents displayed on browser pages, and traditional document editing software is difficult to adapt to browsers. In addition, long documents in plain text without formatting will also be generated in large model applications. In this case, traditional text editing software cannot meet the formatting requirements of documents generated by large models. For some long documents with more content, it will be very time-consuming and labor-intensive for users to set the format one by one, and it is easy to make mistakes.

[0031] In view of this, the embodiment of the present disclosure provides a document processing method based on a large model, which can automatically adjust the format of a document, simplify the operation process of setting the document format, and reduce human errors, thereby improving the quality and speed of document processing. Figure 1 As shown, it mainly includes the following contents:

[0032] S101, in response to the interface operation of the target object on the target interface, determining the format requirement of the target document; wherein the target document is obtained based on the large model processing.

[0033] In the disclosed embodiment, the target document obtained by the large model processing can be understood as a document obtained by the large model performing a text generation task, or a document obtained by the large model performing a rewriting task on the original document. In short, any document obtained by relying on the powerful generation and reasoning capabilities of the large model can be used as a target document. When it is desired to set the format of the target document, the target object can perform corresponding operations in the target interface to set its desired document format requirements, such as setting the font style, paragraph spacing, alignment, etc. of the target document.

[0034] In the disclosed embodiments, the target interface refers to an operating interface independent of the target document editor, which is intended to provide a functional interface for document formatting. During implementation, the target interface can be presented in an independent application software, such as an APP (Application) that relies on a large model to provide services, or it can be provided to the target object as a web page to choose from, to accommodate different usage scenarios and personal preferences. For example, if a large model service is provided through a browser, the target interface can be set in the browser. When the large model service is provided in the form of an APP, the target interface is provided by the APP.

[0035] S102: Setting a format setting interface in a target document editor based on the format requirement of the target document.

[0036] After the format requirement of the target document is determined, a corresponding format setting interface may be set in the target document editor to set the format of the target document by modifying the target document editor.

[0037] The formatting interface in the disclosed embodiment is responsible for processing the target document to apply the formatting requirements set by the target object to the target document. For example, if the formatting requirements include using a specific font style, the formatting requirements will be implemented by modifying the formatting interface of the editor.

[0038] S103: Based on the format setting interface, the document format of the target document is set according to the format requirement.

[0039] Based on the interface settings provided in step S102, the target document is formatted. For example, the format of the target document can be adjusted by setting the paragraph spacing, font requirements, etc. through the formatting interface.

[0040] In the disclosed embodiment, the format requirements of the target document are determined according to the operation of the target object in the target interface, and the target document editor can be flexibly set according to the format requirements expected by the target object. By modifying the target document editor to obtain a format setting interface, document settings with different format requirements can be met. The format setting interface can uniformly set the format of the content in the target document that needs to be modified in format, which can reduce the time and workload of manual format adjustment and improve the efficiency of setting the document format.

[0041] In the disclosed embodiment, a target document editor implements a format setting interface based on SDK (Software Development Kit) to complete the format setting of the target document.

[0042] In the embodiment of the present disclosure, the same format setting interface in the target document editor can support the format requirements of different documents. During implementation, the format setting interface for processing the target document records the format requirements corresponding to the multiple document identifiers.

[0043] For example, the format requirement for setting document identifier C is that the first-level title uses font 1, the format requirement for setting document identifier D is that the first-level title uses font 2, and the format requirement for setting document identifier R is that the first-level title uses font 3 and font size 3, etc.

[0044] In the disclosed embodiment, by recording the format requirements corresponding to multiple document identifiers in the format setting interface, it can be ensured that all target documents with the same identifier can be formatted according to the predetermined format requirements. In addition, the same format setting interface can support the processing of different documents and can also support the processing of large quantities of documents at the same time. Especially in the case of frequent updates or generation of multiple documents, the work efficiency of setting document formats can be greatly improved to support a large number of users to set document formats according to their own requirements in the large model service.

[0045] In the disclosed embodiment, the same formatting interface can support formatting requirements of different documents. When formatting a target document, the document format of the target document can be set based on the formatting requirements corresponding to the document identifier of the target document in the formatting interface. That is, the formatting interface identifies the formatting requirements of the target document by identifying the document identifier of the target document, and applies these formats to the target document according to the identified formatting requirements, automatically formats the target document, and ensures that the format presentation of the target document meets the expected effect of the target object.

[0046] In the embodiment of the present disclosure, the document identifier is an identifier used to distinguish different documents.

[0047] In the disclosed embodiment, the target document is formatted based on the format requirements corresponding to the document identifier of the target document in the formatting interface. It can ensure that the target document is uniformly processed based on the implementation of the document identifier, so that the target document has a desired format or a format that complies with the specification. The automated processing method also reduces format errors caused by human factors, thereby improving the professionalism and credibility of the target document formatting processing.

[0048] In some embodiments, due to the diversity of documents generated by large models, in order to reuse the same format setting interface when facing different documents, the format setting interface in the target document editor can be implemented as follows: based on the format requirements of the target document, the format parameters of the target document are set in the format setting interface in the target document editor.

[0049] For example, different user groups have different requirements for document formats as their needs vary. Therefore, during implementation, the format parameters of the corresponding target document can be set in the format setting interface of the target document editor. For example, the required font style, font size, line spacing, etc. can be set for different topics or titles in the document.

[0050] In the disclosed embodiment, based on the format requirements of the target document, the format parameters of the target document are set in the format setting interface in the target document editor, so that the format requirements of different documents can be supported through a limited format setting interface, and the format setting interface can be used to dynamically and flexibly set the format parameters according to needs, which can meet diverse format requirements and make the format setting of the target document more flexible and changeable.

[0051] In some other embodiments, based on the format requirements of the target document, setting the format setting interface in the target document editor may also be implemented as: based on the format requirements of the target document, creating a format setting interface corresponding to the target document for the target document editor.

[0052] That is, the target document editor supports dynamically extending the formatting interface to meet different needs.

[0053] In one possible implementation, the code development capability of the big model can be used to take the existing interface in the target document editor as a reference interface, so that the big model analyzes the performance of the reference interface and develops a new interface as the format setting interface of the target document according to the format requirements of the target document. In this way, the format setting interface in the target document editor can be dynamically expanded according to the number and requirements of the target documents. For example, different target objects can set different format requirements for different target documents, and each format requirement corresponds to a format setting interface, thereby achieving different formats for different target documents.

[0054] In the disclosed embodiment, not only does it support setting the document format outside the target document editor, but it also supports dynamically extending the format setting interface to meet the format requirements of different documents. When the big model service provides services to a large number of users at the same time, the document format setting is integrated into the big model service, so that multiple users can flexibly set the required format according to their own needs.

[0055] It is understandable that different formatting interfaces can be generated for different documents to provide text formatting services for different objects at the same time. For example, a large model service provides services for n target objects at the same time, and the n target objects can set their own format requirements respectively. Through the method provided by the embodiment of the present disclosure, the format requirements of the target documents of different target objects can be set in the same formatting interface, so as to support the formatting of multiple target documents at the same time through the same formatting interface. Multiple formatting interfaces can also be dynamically expanded to support the formatting of multiple target documents at the same time.

[0056] In the embodiment of the present disclosure, in response to the interface operation of the target object on the target interface, the format requirement of the target document is determined, which can be implemented as follows: Figure 2 As shown, including:

[0057] S201, in response to an editing operation of a target object on a target template in a target interface, determining an initial format of a first target content in a target document; the target template is any one of a plurality of provided templates.

[0058] That is, when the target object needs to edit the document format in a certain target interface, multiple templates can be provided in the target interface or a sub-interface of the target interface for the target object to choose from. These templates may include templates for different tasks. Each task can also provide multiple templates with different formats.

[0059] Once a target template is selected from the multiple templates, the target template can be used to directly set the format of the target document. In addition, when the user expects to change the format, the target object can obtain the target object's expected format as the initial format based on the format provided by the target template in response to the target object's editing operation on the target template in the target interface.

[0060] In the disclosed embodiment, the first target content is the content that needs to be formatted. For example, the first target content may include headers, titles of different levels, footers, etc. in the target document. In the initial format, format requirements for different parts of the first target content may be set. Each format requirement may be implemented separately through its own formatting interface. For example, the formatting interface responsible for font size may support the setting of font sizes of titles of different levels; the formatting interface for line spacing may support the setting of line spacing of titles of different levels. Thus, when the formatting interface is used to format the target document, the formatting requirements corresponding to the function of the formatting interface corresponding to the target document may be read from the formatting interface to complete the formatting of the corresponding part of the content in the target document. For example, the formatting interface includes a font setting interface, which is used to set the font of the corresponding text in the target document according to the font requirements in the formatting requirements. The formatting interface includes a font size setting interface, which is used to set the font size of the corresponding text in the target document according to the font size requirements in the formatting requirements. The formatting interface may also include a spacing setting interface, which is used to set the word spacing and / or line spacing of the corresponding text in the target document according to the spacing requirements in the formatting requirements. The corresponding text can be defined according to the format requirements. For example, the format requirements include sub-format requirements for different content parts, such as the first sub-format requirement for the first-level title and the second sub-format requirement for the second-level title. During execution, the content part corresponding to the sub-format requirement included in the format requirements is the corresponding text, and the sub-format requirements include a content part identifier to distinguish the sub-format requirements of different content parts.

[0061] In order to facilitate setting the document format, in S202, the embodiment of the present disclosure performs a preview operation on the initial format to compare the first target content before and after the format setting.

[0062] After the target object completes the editing operation and determines the initial format of the first target content, a preview function may be provided to the target object on the editing page, so that the target object can view the content comparison before and after the formatting is set.

[0063] The preview operation can help the target object intuitively understand the effects before and after formatting, including whether the text layout, font style, title format, etc. of the target document meet the requirements. Through the preview, the target object can promptly discover and correct possible problems or non-compliance with requirements.

[0064] S203: In response to the confirmation operation, the format requirement of the target document is obtained.

[0065] When the target object is satisfied with the preview effect and confirms that it is correct, the initial format of the target document can be saved as the final format requirement based on the target object's confirmation operation.

[0066] During implementation, the format template set for the target object can be saved so that in subsequent use, the format template can be used to format the document generated by the large model with one click.

[0067] In the disclosed embodiment, by providing a variety of templates for the target object to choose from, it is convenient for the target object to set the format of the document. When the template does not meet the requirements, the target object is supported to edit the template, so as to meet the format requirements by modifying the interface of the target document editor, so as to support flexible and fast setting of the document format. In addition, the preview can facilitate the target object to confirm the set format, and can intuitively discover and correct potential format errors, which reduces the time for repeated modifications and improves the efficiency of setting the format of the target document.

[0068] In the embodiment of the present disclosure, the format requirement may include at least one of the following:

[0069] (1) format requirements for the second target content; the second target content is determined based on the word truncation operation in the target document;

[0070] That is, the target document may contain a variety of elements, such as small font text or embedded images. Therefore, when rendering these contents, it is necessary to identify the specific format and image type in the text and apply the corresponding rendering rules to ensure that all elements can be displayed correctly. For example, change the small font text to the format standard corresponding to the target document.

[0071] (2) Format requirements set for different content parts in the full text of the target document.

[0072] For example, different content parts can be multiple types of headers, various levels of titles, and footers, etc. During implementation, it supports selecting the first font size for the first-level title in the target document, the second font size for the second-level title, the first style font for the text content in the target document, and the second style font for all titles, etc.

[0073] In the disclosed embodiment, the format requirements of the second target content selected by the word truncation operation can allow the target object to make targeted format adjustments according to the characteristics of different parts of the target document. Setting format requirements for different content parts in the document can enhance the logical structure of the document, make the differences between the content parts more obvious, and improve the efficiency of document formatting.

[0074] In the disclosed embodiment, as described above, the target document obtained by processing the big model can be a target document obtained by the big model generating content according to requirements, or a target document obtained by the big model executing a rewriting task.

[0075] During implementation, the target document can be formatted while the target document is being processed by the large model. For example, if the target document includes m pages, the formatting of the target document can be started when the second page is obtained by processing the large model.

[0076] When processing a target document, in order to improve processing efficiency and flexibility, it is usually split into multiple fragments. These fragments can be formatted independently and then merged into a complete document. In view of this, in the embodiment of the present disclosure, the target document is formatted, such as Figure 3 As shown, it may include the following:

[0077] S301, sequentially obtain the fragments to be processed from the target document.

[0078] That is, according to the structure and content of the target document, identify and extract the fragments that need to be processed.

[0079] During implementation, the target document can be traversed in order according to preset rules or algorithms, and the to-be-processed fragments can be identified and extracted one by one. The to-be-processed fragments can be paragraphs, lists, tables, pictures, etc. in the target document.

[0080] In the disclosed embodiment, the content to be modified in the target document can be converted into a Parchment tree (document model) tree structure for storage. Therefore, the target document can be segmented according to the tree structure. During implementation, the tree structure can be converted into a corresponding HTML display so that after the target document is formatted, it can be output and displayed in HTML format.

[0081] S302: Input the acquired to-be-processed segments into a format setting interface, so as to sequentially set the formats of the to-be-processed segments in the target document according to the format requirements.

[0082] That is, the to-be-processed segments are extracted from the target document in a certain order, and then input into the format setting interface, and the format setting is performed on each to-be-processed segment in the order in which they are extracted.

[0083] In the disclosed embodiment, the target document is divided into multiple fragments for processing, which can make full use of computing resources. In particular, when processing a large target document, different fragments can be processed in parallel to speed up the overall processing speed. The target document is processed in the order of the fragments to be processed, which can ensure the continuity and integrity of the target document content, avoid data loss or disorder in the processing process, and improve the efficiency of the target document format setting.

[0084] Taking the processing of a target document as an example, during implementation, the Parchment tree structure is used to format each fragment of the target document in sequence. The Parchment tree is composed of Blots, which correspond to DOM (Document Object Model) nodes. Blot is an abstraction of nodes in the DOM tree. Blot can provide structure, format and / or content. Attributors belong to Blots. Attributors can also provide lightweight format information, which is like the relationship between DOM attributes and nodes. The Parchment tree structure can accurately describe the position of each character and is safer than HTML, so the Parchment tree structure is used to sort out the content structure of the target document and perform formatting.

[0085] like Figure 4 As shown, the node PB represents the Blot in the Parchment tree structure. The structure, format or content that PB can provide; the child node LB can represent multiple child nodes under the node PB. Represents the content in the selected slice. When setting the format, such as Figure 4 As shown by the arrows in the middle, different nodes can be looped to represent the processing flow between different paragraphs. Among them, prev represents the previous part, next represents the next part, tail represents the tail of a node, and head represents the beginning of a node. In this way, the formatting of a target document is completed, and parent represents the parent-child node relationship.

[0086] After all the to-be-processed segments are formatted, the processed segments are merged into a complete document and converted into the required output format for easy storage.

[0087] In the embodiment of the present disclosure, the target document can be a document in any form, such as PDF format, TXT (TextFile, text file) format, etc. When the document editor provided by the embodiment of the present disclosure is used to process the target document, the document editor will convert the target document into a data in JSON (JavaScript Object Notation, a data format) format based on Delta (editor data format) storage. Among them, Delta is a format for describing the content and changes of the rich text document structure, and its data structure is based on the JSON format, which is convenient for mutual analysis between services. After storage, the document editor will map the data stored in Delta to the Parchment tree to update the nodes and attributes in the Parchment tree to complete the formatting of the target document, and the changes in the Parchment tree will be synchronized to the DOM tree to be displayed in the form of an HTML page to ensure the instant update of the user interface so that the user can see the content after the refresh format. Among them, the Parchment tree, as one of the core components of the target document editor, plays the role of a bridge, connecting the content storage of the target document editor and the DOM structure finally presented on the front-end page. In this way, the document editor can provide a consistent content editing experience while maintaining a high degree of customizability and flexibility.

[0088] It should be noted that DOM, as a programming interface, can be used to represent and modify the content and structure of HTML documents. For example, DOM can view a document as a tree, in which each node is a component of the document, such as an element, attribute, text, etc.

[0089] In addition, during implementation, the processing progress of the target document by the large model can be recorded; and / or the formatting progress of the target document can be recorded. This allows the target object to view the progress of the target document formatting in real time during the subsequent target document formatting process. At the same time, it also allows the target object to promptly understand which part of the target document fails or has an abnormality during the formatting process, so as to make a timely response strategy.

[0090] During implementation, the target document formatting progress can be queried through scheduled task triggers, and the target document can also be queried whether it has been processed by the large model. In addition, user events are also supported to trigger the query of the target document formatting progress, and whether the target document has been processed by the large model. The user event is, for example, focus (Focus) and blur (Blur).

[0091] During implementation, different documents maintain queues for progress queries.

[0092] In some embodiments, it may take several seconds or even minutes, or even longer, for a large model to process a document. During this period, a failure may cause the task processing to fail. Therefore, in the process of formatting the slices, in order to ensure the normal progress of the task, in the embodiment of the present disclosure, for the slices that have not been successfully formatted, the slice identifier of the slice to be processed can be recorded; in the case that the slice to be processed has not been successfully formatted due to a failure, the slice to be processed is obtained based on the slice identifier, so as to set the document format for each slice in the target document in sequence according to the format requirements.

[0093] For example, if the target document editor loses focus abnormally (e.g. the user closes the page; the network is suddenly disconnected during editing), triggering ACK (Acknowledgement, confirmation mechanism) and causing the interface to be locked, the uploadId (slice identifier) ​​of the slice can be stored locally each time the slice is pushed to the target document editor for formatting. When the local slice identifier is read for the second push, if there is an uploadId that is not unlocked by ACK, it will be reused so that formatting can be started from that slice.

[0094] In the disclosed embodiment, by recording the segment identifiers of the segments to be processed, it can be ensured that even if a failure occurs during the processing, the formatting of the entire target document can be completed by re-acquiring the segments that have not been successfully processed, thereby ensuring the integrity of the entire target document.

[0095] To sum up, the document processing method based on the big model provided by the embodiment of the present disclosure is that after the target object inputs the format requirements for the target document in the front-end target interface, it interacts with the Delta of the back-end of the document editor, and the back-end calls the corresponding method to implement the format setting of the target document.

[0096] Specific as Figure 5As shown, the content of the target document stored in Delta can be obtained by calling the Parchment (document model) method, and the format of the corresponding content in the target document can be set according to the format requirements of the target document; the Theme (theme mode) method supports the target object to select the appearance style of the document editor, and the interface of the target document editor can be further customized through CSS (Cascading Style Sheets) and modular mechanisms, and then fed back to the front end of the target object for display; the changes of the DOM tree are monitored through MutationObserver (global event center), and these changes are synchronized to the data model of the target document editor, so that the target document editor can observe the DOM changes in the area, such as the addition, deletion, and modification of attributes of nodes, so as to ensure that the content state of the editor is consistent with the actual DOM, so as to complete the formatting of the target document. During implementation, an instance of the MutationObserver method can be created, and the change types that need to be monitored can be defined, such as the total progress of the formatting of the target document, the progress of the formatting of each fragment in the target document, etc. Afterwards, the received change information can be processed according to a specific callback function, and corresponding measures can be taken according to the type of change to synchronize to the data model of the document editor. For example, when the DOM changes, the changes in the DOM can be updated through a specific update method to confirm the formatting progress of each fragment or the formatting progress of the entire target document.

[0097] Through the solution provided by the embodiments of the present disclosure, the format of the pure document generated by the AI ​​(Artificial Intelligence) large model can be globally modified. The complexity of human operation and the errors caused by human operation can be reduced, ensuring that the documents follow the same format standards and improving the efficiency of document processing.

[0098] Based on the same technical concept, the embodiment of the present disclosure also provides a document processing device 600 based on a large model, such as Figure 6 As shown, including:

[0099] The determination module 601 is used to determine the format requirements of the target document in response to the interface operation of the target object on the target interface; wherein the target document is obtained based on the large model processing;

[0100] A setting module 602, used to set a format setting interface in a target document editor based on the format requirements of the target document;

[0101] The processing module 603 is used to set the document format of the target document according to the format requirement based on the format setting interface.

[0102] In some embodiments, the processing module includes:

[0103] The processing subunit is used to set the document format of the target document based on the format requirement corresponding to the document identifier of the target document in the format setting interface.

[0104] In some embodiments, format requirements corresponding to multiple document identifiers are recorded in the format setting interface.

[0105] In some embodiments, the setting module includes:

[0106] The setting subunit is used to set the format parameters of the target document in the format setting interface of the target document editor based on the format requirements of the target document.

[0107] In some embodiments, the setting module includes:

[0108] A subunit is created to create a format setting interface corresponding to the target document for the target document editor based on the format requirements of the target document.

[0109] In some embodiments, the determining module includes:

[0110] A determination subunit, configured to determine an initial format of a first target content in a target document in response to an editing operation of a target object on a target template in a target interface; the target template is any one of a plurality of provided templates;

[0111] A comparison subunit, used to perform a preview operation on the initial format to compare the first target content before and after the format setting;

[0112] The change subunit is used to obtain the format requirement in the target document in response to the confirmation operation.

[0113] In some embodiments, the format requirement of the target document includes at least one of the following:

[0114] Format requirements for the second target content; the second target content is determined based on a truncation operation in the target document;

[0115] The formatting requirements are set separately for different content parts in the full text of the target document.

[0116] In some embodiments, the processing module includes:

[0117] The acquisition subunit is used to sequentially acquire the fragments to be processed from the target document;

[0118] The formatting subunit is used to input the acquired to-be-processed segments into the formatting interface, so as to sequentially format the to-be-processed segments in the target document according to the format requirements.

[0119] In some embodiments, a fault handling module is further included, which is used to:

[0120] Record the shard ID of the shard to be processed;

[0121] In the case that the to-be-processed segment is not successfully formatted due to a fault, the to-be-processed segment is obtained based on the segment identifier, so as to sequentially format each segment in the target document according to the format requirement.

[0122] In some embodiments, a recording module is further included for:

[0123] Record the progress of the large model's processing of the target document; and / or,

[0124] Records the formatting progress of the target document.

[0125] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.

[0126] In the technical solution disclosed herein, the acquisition, storage and application 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.

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

[0128] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, 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.

[0129] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0130] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0131] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 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 701 performs the various methods and processes described above, such as a document processing method based on a large model. For example, in some embodiments, a document processing method based on a large model may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the document processing method based on the large model described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the large model-based document processing method in any other appropriate manner (for example, by means of firmware).

[0132] 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), load 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.

[0133] 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 data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. 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.

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

[0135] 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).

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

[0137] 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 of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

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

[0139] 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 principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A document processing method based on a large model, comprising: In response to the interface operation of the target object on the target interface, determining the format requirements of the target document; wherein the target document is obtained based on the large model processing; Based on the format requirements of the target document, setting a format setting interface in the target document editor; Based on the format setting interface, the document format of the target document is set according to the format requirement.

2. The method according to claim 1, wherein: The step of setting the document format of the target document according to the format requirement based on the format setting interface includes: The document format of the target document is set based on the format requirement corresponding to the document identifier of the target document in the format setting interface.

3. The method according to claim 1, wherein: The format setting interface records format requirements corresponding to multiple document identifiers.

4. The method according to claim 1, wherein: The step of setting a format setting interface in a target document editor based on the format requirement of the target document includes: Based on the format requirement of the target document, format parameters of the target document are set in the format setting interface in the target document editor.

5. The method according to claim 1, wherein: The step of setting a format setting interface in a target document editor based on the format requirement of the target document includes: Based on the format requirement of the target document, the format setting interface corresponding to the target document is created for the target document editor.

6. The method according to claim 1, wherein: The step of determining the format requirement of the target document in response to the interface operation of the target object on the target interface includes: In response to an editing operation of a target object on a target template in the target interface, determining an initial format of a first target content in the target document; the target template is any one of a plurality of provided templates; Previewing the initial format to compare the first target content before and after formatting; In response to a confirmation operation, the format requirement of the target document is obtained.

7. The method according to claim 1, wherein: The format requirements of the target document include at least one of the following: Format requirements for second target content; the second target content is determined based on a word truncation operation in the target document; Format requirements are set for different content parts in the full text of the target document.

8. The method according to any one of claims 1 to 7, wherein: The step of setting the document format of the target document according to the format requirement based on the format setting interface includes: Sequentially obtain the fragments to be processed from the target document; The acquired to-be-processed segments are input into the format setting interface, so as to sequentially perform format setting on each to-be-processed segment in the target document according to the format requirement.

9. The method according to claim 8, further comprising: Record the fragment identifier of the fragment to be processed; In the case that the to-be-processed segment fails to be formatted successfully due to a fault, the to-be-processed segment is obtained based on the segment identifier, so as to sequentially set the document format for each segment in the target document according to the format requirement.

10. The method according to claim 8, further comprising: Recording the processing progress of the target document by the large model; and / or, The formatting progress of the target document is recorded.

11. A document processing device based on a large model, comprising: A determination module, configured to determine the format requirements of a target document in response to an interface operation of a target object on a target interface; wherein the target document is obtained based on the large model; A setting module, used to set a format setting interface in a target document editor based on the format requirements of the target document; A processing module is used to set the document format of the target document according to the format requirement based on the format setting interface.

12. The device according to claim 11, wherein The processing module comprises: The processing subunit is used to set the document format of the target document based on the format requirement corresponding to the document identifier of the target document in the format setting interface.

13. The device according to claim 11, wherein: The format setting interface records format requirements corresponding to multiple document identifiers.

14. The device according to claim 11, wherein: The setting module includes: The setting subunit is used to set the format parameters of the target document in the format setting interface in the target document editor based on the format requirements of the target document.

15. The device according to claim 11, wherein The setting module includes: A creation subunit is used to create the format setting interface corresponding to the target document for the target document editor based on the format requirement of the target document.

16. The device according to claim 11, wherein The determining module comprises: a determination subunit, configured to determine an initial format of the first target content in the target document in response to an editing operation of a target object on a target template in the target interface; the target template being any one of the multiple templates provided; A comparison subunit, configured to perform a preview operation on the initial format to compare the first target content before and after format setting; The modification subunit is used to obtain the format requirement of the target document in response to a confirmation operation.

17. The device according to claim 11, wherein: The format requirements of the target document include at least one of the following: Format requirements for second target content; the second target content is determined based on a word truncation operation in the target document; Format requirements are set for different content parts in the full text of the target document.

18. The device according to any one of claims 11 to 17, wherein: The processing module comprises: An acquisition subunit, used to sequentially acquire the to-be-processed fragments from the target document; The format setting subunit is used to input the acquired to-be-processed segments into the format setting interface, so as to sequentially perform format setting on each to-be-processed segment in the target document according to the format requirement.

19. The apparatus according to claim 18, further comprising a fault processing module, configured to: Record the fragment identifier of the fragment to be processed; In the case that the to-be-processed segment fails to be formatted successfully due to a fault, the to-be-processed segment is obtained based on the segment identifier, so as to sequentially set the document format for each segment in the target document according to the format requirement.

20. The apparatus according to claim 18, further comprising a recording module, configured to: Recording the processing progress of the target document by the large model; and / or, The formatting progress of the target document is recorded.

21. 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 10.

22. 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-10.

23. 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 10.

Citation Information

Patent Citations

  • Template-based intelligent format checking method aiming at Word document

    CN101706771A

  • Document format processing device and document format processing method

    CN104346322A

  • Office Word-based document automatic modularization and multi-terminal independent authority limit editing method

    CN110442851A

  • Document content format adjusting method and device and electronic equipment

    CN110956016A

  • Document generation method and device and storage medium

    CN115526156A