Document processing method and device and storage medium
Through automated document processing methods, the document content is sorted according to the style of the target document, which solves the problem of manual conversion time-consuming and labor-intensive and prone to inconsistent formats, and realizes efficient and fine document format conversion and organization.
Patent Information
- Application Number
- CN202411665546.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, manual document format conversion process is time-consuming and labor-intensive, and problems are prone to missed content, inconsistent content, or style settings do not meet the requirements.
Provide a document processing method, by obtaining the target content in the document, sorting it according to the style of the target document, and forming the target document. The method includes determining the hierarchical relationship and content interval in the target content, determining the content organization structure based on the hierarchical relationship and content interval, and sorting the sorted target content according to the content organization structure.
It realizes the automated organization of document content in one format into documents in another format, which greatly reduces the time for manual conversion and organization, improves the efficiency of document format conversion and organization, and ensures that the converted content format, style and expression are consistent with the target document.
Smart Images

Figure CN119598978A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a document processing method, device and storage medium. Background Art
[0002] Currently, document processing is an indispensable part of daily life and work, and there are multiple document formats in related technologies, such as Microsoft Word, Excel, PDF, HTML, etc. Due to the differences in support for document formats by different systems or platforms, as well as specific business needs, it is often necessary to convert documents in one format to another.
[0003] In this regard, the traditional approach is for users to manually open the original document, read and understand its content, and then copy, paste and adjust the content's position, font, font size, color, paragraph format and other attributes one by one according to the format requirements of the target document. This manual document format conversion process is not only time-consuming and laborious, but also prone to omissions, inconsistent content or style settings that do not meet requirements. Summary of the invention
[0004] The present application provides a document processing method, device and storage medium to solve the technical problems in the prior art that the manual document format conversion process is not only time-consuming and labor-intensive, but also prone to omissions of content, inconsistent content or style settings that do not meet requirements.
[0005] In a first aspect, the present application provides a document processing method, the method comprising:
[0006] Acquire target content in the document, and organize the target content according to the style of the target document to form a target document;
[0007] The document and the target document have different formats, and the target content after arrangement has different attributes from the target content before arrangement.
[0008] In a possible implementation, the acquiring the target content in the document and arranging the target content according to the style of the target document includes:
[0009] In response to an operation of obtaining target content of a document in a target document, the target content is obtained; or in response to an operation of selecting target content in a document, the target content is obtained;
[0010] The target content is collated according to the style required at the output position of the target document, and the collated target content is displayed at the output position of the target document.
[0011] In a possible implementation, the forming of the target document includes:
[0012] Determine the hierarchical relationships and content intervals in the target content;
[0013] Determining a content organization structure of the target content according to the hierarchical relationship and the content interval;
[0014] The organized target content is organized according to the content organization structure of the target content to generate a target document.
[0015] In a possible implementation manner, determining the content organization structure of the target content according to the hierarchical relationship and the content interval includes:
[0016] Determine the subject category to which the content interval belongs;
[0017] The content organization structure of the target content is determined according to the content intervals included in the subject category.
[0018] In a possible implementation manner, determining the content organization structure of the target content according to the content intervals included in the subject category includes:
[0019] The content intervals included in the subject category are input into a content organization structure generation model to obtain a content organization structure of the content intervals included in the subject category.
[0020] In a possible implementation, the organizing the organized target content according to the content organization structure of the target content to generate a target document includes:
[0021] Generate corresponding content items according to the subject category, and generate filling content corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0022] A document page is generated according to the content items and filling contents corresponding to the subject categories, and the content items and filling contents corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
[0023] In a possible implementation manner, when the target document is a presentation document, organizing the organized target content according to the content organization structure of the target content to generate the target document includes:
[0024] Generate a corresponding presentation document section page according to the subject category, and generate a presentation document body page corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0025] A presentation document directory page is generated according to the presentation document section pages and presentation document body pages corresponding to the subject categories, and the presentation document section pages and presentation document body pages corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
[0026] In a possible implementation, generating a corresponding presentation document section page according to the subject category includes:
[0027] The subject category is filled into a preset presentation document section page template to obtain a presentation document section page corresponding to the subject category.
[0028] In a possible implementation, the method further includes:
[0029] determining a cover portion of the document;
[0030] Extracting target text content from the cover part;
[0031] The target text content is filled into a preset cover page template to obtain the document cover page of the target document.
[0032] In a possible implementation manner, when the target document is a table document, organizing the organized target content according to the content organization structure of the target content to generate the target document includes:
[0033] Generate corresponding cell items according to the subject category, and generate cell content corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0034] According to the cell items and cell contents corresponding to the subject category, the cell contents are added to the corresponding cell items to generate a table document page, and the cell items and cell contents corresponding to the subject category are sorted according to the preset subject category arrangement order to obtain the target document.
[0035] In a possible implementation manner, when the target document is a text document, organizing the organized target content according to the content organization structure of the target content to generate the target document includes:
[0036] Generate a corresponding title item according to the subject category, and generate text content corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0037] According to the title items and text contents corresponding to the subject categories, the text contents are added to the corresponding title items to generate a text document page, and the title items and text contents corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
[0038] In a second aspect, the present application provides a document processing device, the device comprising:
[0039] The acquisition module is used to obtain the target content in the document;
[0040] The document conversion module is used to organize the target content according to the style of the target document to form the target document;
[0041] The document and the target document have different formats, and the target content after arrangement has different attributes from the target content before arrangement.
[0042] In a possible implementation manner, the acquisition module is specifically used to:
[0043] In response to an operation of obtaining target content of a document in a target document, the target content is obtained; or in response to an operation of selecting target content in a document, the target content is obtained;
[0044] The document conversion module is specifically used for:
[0045] The target content is collated according to the style required at the output location of the target document, and the collated target content is displayed at the output location of the target document.
[0046] In a possible implementation, the document conversion module includes:
[0047] A first determining unit, used to determine the hierarchical relationship and content interval in the target content;
[0048] A second determining unit, configured to determine a content organization structure of the target content according to the hierarchical relationship and the content interval;
[0049] The reorganization unit is used to organize the organized target content according to the content organization structure of the target content to generate a target document.
[0050] In a possible implementation manner, the second determining unit includes:
[0051] A subject classification subunit, used to determine the subject category to which the content interval belongs;
[0052] The structure determination subunit is used to determine the content organization structure of the target content according to the content intervals included in the subject category.
[0053] In a possible implementation manner, the architecture determination subunit is specifically configured to:
[0054] The content intervals included in the subject category are input into a content organization structure generation model to obtain a content organization structure of the content intervals included in the subject category.
[0055] In a possible implementation manner, the reorganization unit is specifically used to:
[0056] Generate corresponding content items according to the subject category, and generate filling content corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0057] A document page is generated according to the content items and filling contents corresponding to the subject categories, and the content items and filling contents corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
[0058] In a possible implementation manner, the reorganization unit is specifically used to:
[0059] Generate a corresponding presentation document section page according to the subject category, and generate a presentation document body page corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0060] A presentation document directory page is generated according to the presentation document section pages and presentation document body pages corresponding to the subject categories, and the presentation document section pages and presentation document body pages corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
[0061] In a possible implementation manner, the reorganization unit is specifically used to:
[0062] The subject category is filled into a preset presentation document section page template to obtain a presentation document section page corresponding to the subject category.
[0063] In a possible implementation, the device further includes:
[0064] The cover generation module is used to determine the cover part in the document; extract the target text content from the cover part; fill the target text content into a preset cover page template to obtain the document cover page of the target document.
[0065] In a possible implementation manner, the reorganization unit is specifically used to:
[0066] Generate corresponding cell items according to the subject category, and generate cell content corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0067] According to the cell items and cell contents corresponding to the subject category, the cell contents are added to the corresponding cell items to generate a table document page, and the cell items and cell contents corresponding to the subject category are sorted according to the preset subject category arrangement order to obtain the target document.
[0068] In a possible implementation manner, the reorganization unit is specifically used to:
[0069] Generate a corresponding title item according to the subject category, and generate text content corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0070] According to the title items and text contents corresponding to the subject categories, the text contents are added to the corresponding title items to generate a text document page, and the title items and text contents corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
[0071] In a third aspect, the present application provides a device, comprising: a processor and a memory, wherein the processor is used to execute a document processing program stored in the memory to implement the document processing method described in any one of the first aspects.
[0072] In a fourth aspect, the present application provides a storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the document processing method described in any one of the first aspects.
[0073] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by acquiring the target content in the document, organizes the target content according to the style of the target document, and forms a target document, thereby realizing a scheme for automatically organizing the content of a document in one format into a document in another format. This automated method greatly reduces the time for manual conversion and organization, improves the efficiency of document format conversion and organization, and, in the process of organization, the target content in the original document can be finely adjusted in style according to the style requirements of the target document, thereby ensuring that the converted content is consistent with the target document in format, style and expression, thereby improving the professionalism and readability of the document. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0075] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0076] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0077] Figure 1 A flowchart of an embodiment of a document processing method provided in an embodiment of the present application;
[0078] Figure 2 A flowchart of another document processing method provided in an embodiment of the present application;
[0079] Figure 3 This is a schematic diagram of the title hierarchy of the main text of the paper document to be processed;
[0080] Figure 4 An example of a presentation document section page;
[0081] Figure 5 This is an example of a presentation document body page;
[0082] Figure 6 This is an example of a table of contents page for a demonstration document;
[0083] Figure 7 A block diagram of an embodiment of a document processing device provided in an embodiment of the present application;
[0084] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0085] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0086] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0087] In order to solve the technical problems in the prior art that the manual document format conversion process is not only time-consuming and labor-intensive, but also prone to omissions of content, inconsistent content, or style settings that do not meet requirements, the present application provides a document processing method, device, and storage medium, which can realize a solution for automatically organizing the content of a document in one format into a document in another format. This automated method can greatly reduce the time for manual conversion and organization, improve the efficiency of file format conversion and organization, and, in the process of organization, the target content in the original document can be finely adjusted in style according to the style requirements of the target document, thereby ensuring that the converted content is consistent with the target document in format, style, and expression, thereby improving the professionalism and readability of the document.
[0088] Figure 1 A flowchart of an embodiment of a document processing method provided in an embodiment of the present application.
[0089] like Figure 1 As shown, the method comprises the following steps:
[0090] Step 101: Acquire target content in a document, organize the target content according to the style of the target document, and form a target document.
[0091] The formats of the above-mentioned document and the target document are different, and the properties of the target content after sorting are different from those of the target content before sorting.
[0092] In an exemplary application scenario, the document may be a document in a format such as .doc, .docx, or .pdf, and the target document may be a presentation (such as a document in a format such as .ppt, .pptx, .key, or .pdf) or a slide. A presentation is a whole file that includes multiple slides, and a slide is a separate page in a presentation that is a basic unit of a presentation and is used to display specific information or viewpoints.
[0093] In another exemplary application scenario, the above-mentioned document can be a text document in the format of .doc, .docx, .pdf, etc., the target document can be a presentation (such as a document in the format of .ppt, .pptx, .key, .pdf, etc.) or a slide, or the target document can be a spreadsheet document, such as excel, or a form, etc.
[0094] In another exemplary application scenario, the document may be a presentation document. ( Such as .PPT, .PPTX ) The target document may be a text document in a format such as .doc, .docx, or .pdf, or a table document such as excel or a spreadsheet.
[0095] In another exemplary application scenario, the above-mentioned document can be a spreadsheet document, such as Excel, or a form, and the target document can be a text document in the format of .doc, .docx, .pdf, etc., or the target document can be a presentation (such as a document in the format of .ppt, .pptx, .key, .pdf, etc.) or a slide.
[0096] Among them, format is at the document level, such as table documents and text documents; style is the style adjustment for the target content; attribute refers to the target content at the content level, such as pictures, texts, tables, links, etc.
[0097] The target content in the document may be part of the content in the document, such as part of a paragraph, part of a page, etc. From the perspective of the content type dimension, the target content may include text, pictures, tables, etc., and the embodiment of the present application does not limit this. In step 101, part of the content in the document may be sorted according to the required style to form a target document. Here, "required style" may refer to the style required for a page of a certain part of the target document, or the style required for a certain position in the target document. Style refers to the requirements of the target document for the content presentation method, which determines the overall style and visual effect of the target document, including but not limited to fonts, font sizes, colors, layouts, animation effects, etc. Here, sorting may be to process the target content, such as processing the target content using a large model, and obtaining new target content based on the target content, or, for example, using a server to process the target content, and obtaining new target content based on the target content, or directly processing the target content through the function on the document, and obtaining new target content based on the target content; wherein, the way of sorting may be to modify, polish, convert, expand, etc. the target content, or convert the content or format so that the obtained new target content can meet the style required by the target document.
[0098] In an exemplary application scenario, when the target document is a slide, the document may also be a presentation document. In step 101, in an existing presentation document, for a certain page or several pages of slides, the target content in the existing presentation document is used, and the target content is organized according to the style required by those pages of slides to generate the content in the slides.
[0099] In an exemplary application scenario, when the target document is a table document, the document may also be a text document. In step 101, in an existing text document, for the content of a certain page or several pages, the target content in the existing text document is used to organize the target content according to the style required by the cells in the table document to generate the content in the table document.
[0100] Arranging the target content according to the style of the target document refers to performing a series of operations on the target content according to the style requirements of the target document, including but not limited to one or more of the operations of modification, arrangement, conversion, etc. Among them, the modification operation is, for example, modifying the text style and content background of the target content, summarizing, polishing, and expanding the target content. The arrangement operation is, for example, adjusting the order of the text in the target content, summarizing and polishing the target content. The conversion operation is, for example, converting the target content into another format, such as text to picture, text to video, etc. After arrangement, the new target content can be obtained.
[0101] In an exemplary application scenario, the target content in the document is arranged and sorted according to the style of the presentation document to form a presentation document. In this exemplary application scenario, the target content is first extracted from the document, and then a new presentation document is created. The target content is sorted and sorted in the new presentation document to form a presentation document. The arrangement and use of text documents, table documents, and presentation documents are similar.
[0102] In another exemplary application scenario, the target content in the document is sorted and arranged and then adjusted according to the style of the presentation document to form a presentation document. In this exemplary application scenario, the target content extracted from the document is first arranged and then output in a newly created document to form a presentation document. Here, the newly created document is not limited to whether it is a presentation document, it can be a blank document, and then converted into a presentation document. The same is true for the arrangement of text documents, table documents, and presentation documents.
[0103] In another exemplary application scenario, the corresponding content is extracted from the document according to the needs of the presentation document, and then sorted and organized to form a presentation document. In this exemplary application scenario, after the existing presentation document is associated with the document, the required target content is extracted from the document to form a presentation document. The same is true for the arrangement and use of text documents, table documents, and presentation documents.
[0104] From the above description, it can be seen that the technical solution provided in the embodiment of the present application, by acquiring the target content in the document, organizes the target content according to the style of the target document, and forms a target document, realizes a solution for automatically organizing the content of a document in one format into a document in another format. This automated method greatly reduces the time for manual conversion and organization, improves the efficiency of document format conversion and organization, and, in the process of organization, the target content in the original document can be finely adjusted in style according to the style requirements of the target document, thereby ensuring that the converted content is consistent with the target document in format, style and expression, thereby improving the professionalism and readability of the document.
[0105] In one embodiment, the specific implementation of acquiring the target content in the document and arranging the target content according to the style of the target document includes: acquiring the target content in response to an acquisition operation on the target content in the target document; or acquiring the target content in response to a selection operation on the target content in the document. Arranging the target content according to the style required at the output position of the target document, and displaying the arranged target content at the output position of the target document.
[0106] Among them, in response to the acquisition operation of the target content of the document in the target document, the target content is acquired, which means allowing the user to trigger the document processing software to automatically search and extract the pre-defined target content in the document through certain operations, such as clicking a button, selecting a menu item, etc.
[0107] In response to the selection operation of the target content in the document, the target content is obtained, which means that the user is allowed to manually select, such as using a mouse to drag and select specific content in the document, and then the document processing software obtains the target content according to the user's selection result. This method is more flexible and allows the user to accurately select the content to be processed according to the needs.
[0108] After acquiring the target content, the document processing software will organize the target content according to the style required by the output location of the target document. Here, the style includes, for example, attributes such as font, font size, color, alignment, border, background, etc. The purpose of the arrangement is to ensure that the target content can meet the overall style and requirements of the target document when it is at the output location. For example, if the target content needs to be inserted into the title part of the target document, the document processing software can organize the target content according to the style of the title (such as increasing the font size, bolding, centering, etc.). For example, it can also be that the target content needs to be converted from text content to a picture and inserted into the target document for display, or the target content needs to be converted from table content to text content and inserted into the target document, etc. For example, it can also be that the target content is a title, and then the body content is described according to the title, and the body content is inserted into the target document for display.
[0109] After finishing, the document processing software will display the processed target content in the output location of the target document. This location may be a user-specified location or a location automatically determined based on the layout and style of the document.
[0110] In one embodiment, the specific implementation of forming the target document includes: determining the hierarchical relationship and content interval in the target content; determining the content organization structure of the target content according to the hierarchical relationship and content interval; organizing the organized target content according to the content organization structure of the target content to generate the target document.
[0111] Wherein, determining the hierarchical relationship in the target content includes: identifying and extracting the title paragraphs and text paragraphs in the target content, and then analyzing the hierarchical relationship between the title paragraphs, such as determining the hierarchical relationship between the title paragraphs through the style of the title or a specific mark, and determining the text paragraph corresponding to each title paragraph, which is usually located below the title paragraph until the next title paragraph of the same level or higher level is encountered. Alternatively, determining the hierarchical relationship in the target content includes: identifying and extracting the text paragraphs in the target content, and then analyzing the hierarchical relationship between the paragraphs, such as determining the hierarchical relationship between the paragraphs through the style of the paragraph or a specific mark, and determining the text paragraph corresponding to each paragraph. Determining the hierarchical relationship in the target content includes: identifying and extracting the titles in the target content, and then analyzing the hierarchical relationship between the titles, such as determining the hierarchical relationship between the titles through the style of the title or a specific mark, and determining the content corresponding to each title. Here, the hierarchical relationship can be a parallel relationship, a superior-female relationship, a sorting relationship with a front-to-back order, etc.
[0112] There are usually multiple content intervals in the target content. Determining the content intervals in the target content includes: dividing the target content into multiple content intervals according to the hierarchical relationship of the target content. Each content interval consists of a title of a specified level and all subtitles and / or text paragraphs under it. Here, the content texts in different content intervals do not overlap, that is, each text paragraph belongs to only one content interval.
[0113] Determining the content organization structure of the target content according to the hierarchical relationship and content interval includes: constructing a tree-shaped or hierarchical content organization structure according to the hierarchical relationship and content interval. This structure reflects the logical structure and information hierarchy of the target content.
[0114] Among them, optionally, the content organization structure follows the original hierarchical relationship of the target content. For example, in the content organization structure, the first-level title is the root node of the structure tree, the sub-title is the child node of the root node, and the text paragraph is the leaf node of the sub-node. For example, it can be parallel first-level titles or parallel first-level document paragraphs, etc.
[0115] Optionally, the content organization structure may also be a tree structure re-formed according to the hierarchical relationship and content intervals of the target content.
[0116] In one embodiment, the specific implementation of determining the content organization structure of the target content according to the hierarchical relationship and content intervals in the target text includes: determining the subject category to which each content interval belongs; and determining the content organization structure of the target content according to the content intervals included in each subject category.
[0117] Here, each content interval is developed around a specific theme and has relative independence and integrity. Based on this, the theme category to which each content interval belongs is determined here, and then the content organization structure of the target content is determined according to the content intervals included in each theme category.
[0118] Here, the subject category to which each content interval belongs is determined from a preset subject category set, which includes multiple subject categories, which are usually set according to actual business needs, and can cover the main content in the paper document and have sufficient distinction so as to accurately classify each content interval into the corresponding subject category.
[0119] Exemplarily, the specific implementation of determining the content organization structure of the target content according to the content intervals included in each subject category includes: for each subject category, the content intervals included in the subject category are input into the trained content organization structure generation model to obtain the content organization structure of the content intervals included in the subject category. The content organization structure of the content intervals included in different subject categories forms the complete content organization structure of the target content.
[0120] In another embodiment, the specific implementation of determining the content organization structure of the target content according to the hierarchical relationship and content interval in the target text includes: inputting the hierarchical relationship and content interval in the target content into a trained content organization structure generation model to obtain the content organization structure of the target content.
[0121] Finally, the organized target content is organized according to the content organization structure of the target content, and the generation of the target document includes: first, creating a new document, and then inserting the organized target content into the newly created document according to the content organization structure, ensuring that the style, format and hierarchical relationship of the title and / or text paragraph are correctly presented in the document; or, in an existing document, and then inserting the organized target content into the existing document according to the content organization structure.
[0122] In addition, in actual applications, you can also add additional information such as cover, header, footer, directory, notes, comments, file name, attachments, etc. to the target document according to actual needs.
[0123] Taking adding a cover to a target document as an example, in one embodiment, the cover part in the document is determined; the target text content is extracted from the cover part; the target text content is filled into a preset cover page template to obtain the document cover page of the target document.
[0124] The cover part of a document is usually the first page of the document, so determining the cover part of a document is, for example, extracting the first page of the document. But sometimes the cover page may not just be the first page of a document, but a page with a specific format or content. For example, the cover page may contain a specific title, font size, color, or layout. In this case, the cover part of the document can be extracted by checking these features of the pages in the document.
[0125] The cover of a document usually includes two elements: text content and pictures. Of course, in actual applications, the cover of a document may also include elements such as lines or borders, graphics or icons. Usually, the cover part other than the text content is used to reflect the specific presentation format and presentation effect of the cover, but the original presentation format and presentation effect of the cover part of the document may not meet the needs of the target document. Therefore, text extraction technology is used here to identify and extract the text content (i.e., target text content) on the cover part of the document, such as the title, author name, date and other text content, and then fill the target text content into the preset cover page template. The preset cover page template is usually a cover page template that meets the style requirements of the target document.
[0126] It should be noted that, in actual applications, it may also involve extracting pictures or other types of elements such as graphics, icons, etc. on the cover part of the document, and filling the extracted elements into a preset cover page template to obtain the document cover page of the target document. In addition, after the extracted elements, such as target text content or other types of elements are filled into the preset cover page template, the size and / or position of the target text content or other types of elements in the preset cover page template may be adjusted as needed to meet the design requirements of the cover page template. The embodiments of the present application are not limited to this.
[0127] Taking adding an attachment to a target document as an example, in one embodiment, it is determined that an attachment is needed in the document, and the target content is extracted from the target document. The corresponding attachment file can be searched for based on the target content, and the attachment file can be added to the required location in the target document. Alternatively, an attachment file can be generated based on the target content or an attachment file can be generated based on part of the target content, and the attachment file can be added to the required location in the target document.
[0128] The above explains the technical solution provided in the embodiment of the present application as a whole. The following uses the application scenario in which the document is a paper document and the target document is a presentation document as an example to explain the technical solution provided in the embodiment of the present application.
[0129] In the application scenario where the document is a thesis document and the target document is a presentation document, the purpose of applying the technical solution provided in the embodiment of the present application is to realize a solution for automatically generating a presentation document for a thesis document, such as a defense PPT. Under this solution, the thesis content required for each part of the defense PPT can be automatically extracted from the thesis document, and the corresponding PPT content can be generated for the content, which can significantly save manual operations and improve the efficiency of making defense PPTs.
[0130] In one embodiment, see Figure 2 , which is a flow chart of another document processing method provided in an embodiment of the present application. Figure 2 The process shown is used to generate a presentation document for a paper document, including the following steps:
[0131] Step 201: determine the body of the paper document to be processed, and determine the title level of each title paragraph in the body.
[0132] Among them, the paper documents to be processed correspond to Figure 1 In the embodiment shown, the target presentation document corresponds to Figure 1 The target document in the embodiment shown. The body part of the paper document to be processed corresponds to Figure 1 Target content in a document in the illustrated embodiment.
[0133] In practical applications, the paper documents to be processed usually include the following parts: cover, table of contents, abstract, introduction, main text, conclusion, summary, acknowledgments, references, and appendix. In the scenario of generating presentation documents for paper documents, since the main purpose of presentation documents is to convey the core ideas and research results of the paper in a concise and clear manner, the focus is usually on the key parts of the paper, especially the main text. The main text contains the core contents of the paper, such as the research content, experimental methods, data analysis, and results discussion, and is the main body of displaying research results and proving ideas. Therefore, the main text of the paper document to be processed is obtained here as the target content to be sorted.
[0134] In one embodiment, the body of a paper document usually includes a specific title (e.g., "Main Text"), font size, color, or layout, etc. Therefore, the body of the paper document can be determined by checking these features of the pages in the document. In addition, the body of the extracted paper document can be cleaned to remove invalid content, such as spaces, invalid characters, etc., and then the cleaned body is used to generate the target presentation document.
[0135] The main body of a paper usually contains multiple chapters. Each chapter or subsection revolves around a specific research topic or problem. Chapters can contain subsections, and subsections can contain further subsections. These chapters and subsections are organized in an orderly manner through different heading levels, making the structure of the entire paper clear and logically rigorous. Common heading levels include first-level headings, second-level headings, third-level headings, and so on. For example, see Figure 3 , which is a schematic diagram of the title hierarchy of the main text of the paper document to be processed. Figure 3 The example includes 5 first-level headings, namely: Introduction, Materials and Methods, Results and Analysis, Discussion and Conclusion, Summary and Outlook. Some of the first-level headings also include second-level headings. For example, the first-level heading "Materials and Methods" includes 4 second-level headings, namely: Experimental Materials, Culture Conditions, Establishment of Leaf Regeneration System of Drosera foetida, Data Statistics and Analysis. Some second-level headings also include third-level headings. For example, the second-level heading "Experimental Materials" includes 3 third-level headings, namely: Plant Materials, Test Agents, Instruments and Consumables.
[0136] Different levels of titles usually have specific writing rules, which constrain the format and style of titles from the dimensions of text composition, font size, color or layout. In addition, in a paper document, titles at the same level usually use the same format and style to ensure the consistency and coordination of the entire paper. Therefore, as an optional implementation method, the title paragraphs can be identified by checking the format features of each paragraph in the body of the text, and the title level of each title paragraph can be determined.
[0137] Each title paragraph has its own corresponding text paragraph, which is usually located below the title paragraph until the next title paragraph of the same or higher level is encountered. Therefore, after determining the title level of each title paragraph, the level of the text paragraph under each title paragraph can also be determined. For example, the text paragraph under the third-level title is a third-level text paragraph. At this point, it is also possible to determine the hierarchical relationship of the target content, such as the body of the paper document.
[0138] Step 202: Divide the body of the text into a plurality of content sections according to the title levels of each title paragraph, and determine the subject category to which each content section belongs.
[0139] In step 202, the body part is divided into a plurality of content intervals according to the title levels of each title paragraph, and the content texts in different content intervals do not overlap, that is, each text paragraph belongs to only one content interval.
[0140] In one embodiment, the specific implementation of dividing the main text part into multiple content intervals according to the title level of each title paragraph includes: determining the management interval of different designated title paragraphs in the main text part as a content interval respectively, wherein the designated title paragraph is a title paragraph of a designated title level, and the management interval of the title paragraph refers to the interval composed of the title paragraph and its related text content paragraphs.
[0141] Optionally, in order to balance the richness and amount of content, the above-specified title level is set to the secondary title level, which means that the content intervals will be divided based on the secondary title. Since secondary titles are usually used to identify larger logical units or sub-chapters under chapters in a paper, dividing the content intervals based on secondary titles can better balance the richness and amount of content. For example, for each secondary title paragraph, the secondary title paragraph itself and all text content paragraphs that follow it and before the next secondary title paragraph are determined as the management interval of the secondary title paragraph, and then the management interval is determined as a content interval.
[0142] It can be seen that each content section is developed around a specific theme and has relative independence and integrity. Accordingly, in step 202, the theme category to which each content section belongs can be further determined.
[0143] Here, the subject category to which each content interval belongs is determined from a preset subject category set. The subject category set includes multiple subject categories, which are usually set according to actual business needs, and can cover the main content in the paper document, and have sufficient differentiation to accurately classify each content interval into the corresponding subject category. For example, in the scenario of generating a defense PPT for a paper document, the preset subject category set may include five subject categories: research background, research content, research results, research conclusions, summary and outlook. Among them, the research background usually introduces the source of the research problem, the importance of the research and the current status of the research; the research content usually describes the research methods, experimental design, data collection and processing process in detail; the research results usually show the main findings and data results of the experiment or research; the research conclusions usually explain and analyze the research results and draw research conclusions; the summary and outlook usually summarize the main contributions and shortcomings of the research, and put forward future research directions and suggestions.
[0144] In one embodiment, the specific implementation of determining the subject category to which each content interval belongs includes: for each content interval, determining at least one title paragraph of the title level to which the content interval belongs, and determining the subject category to which the content interval belongs based on the title paragraph of at least one title level to which the content interval belongs. Here, since the title paragraph is usually used to summarize the content and contains key information, determining the subject category to which the content interval belongs based on the title paragraph is accurate, and the title paragraph usually has less content than the text content paragraph, therefore, determining the subject category to which the content interval belongs based on the title paragraph can reduce the amount of calculation and improve processing efficiency.
[0145] Wherein, in the case of dividing the content interval based on the second-level title, the title paragraph of at least one title level to which the content interval belongs includes the first-level title paragraph and the second-level title paragraph to which the content interval belongs. Then, the subject category to which the content interval belongs will be determined here according to the first-level title paragraph and the second-level title paragraph to which the content interval belongs.
[0146] As an optional implementation method, the specific implementation of determining the subject category to which the content interval belongs based on the title paragraphs of at least one title level to which the content interval belongs includes: splicing the title paragraphs of at least one title level to which the content interval belongs in hierarchical order to obtain corresponding spliced title texts; inputting the spliced title texts into a trained subject classification model to obtain the subject category to which the content interval belongs, wherein the subject classification model is used to determine the subject category to which the input content belongs in a preset subject category set.
[0147] by Figure 3Taking the paper document shown as an example, by splicing the title paragraphs of at least one title level belonging to the content interval in hierarchical order, the following spliced title text can be obtained: [Materials and Methods_Experimental Materials, Materials and Methods_Culture Conditions, Materials and Methods_Establishment of Leaf Regeneration System of Drosera capensis, Materials and Methods_Data Statistics and Analysis, Results and Analysis_Seed Germination Medium Screening Results, Results and Analysis_Leaf Regeneration Culture Results, Results and Analysis_Root Culture Results, Discussion and Conclusion_Aseptic Seeding, Discussion and Conclusion_Plant Growth Hormone, Introduction]. Here, "Introduction" is not a spliced title text, but "Introduction" is usually very important for understanding the background and purpose of the entire paper document. Therefore, the "Introduction" part is used as a whole for subject classification, and the title level is no longer distinguished.
[0148] The above topic classification model is a multi-classification model. In practical applications, before the concatenated title text is input into the topic classification model, it is usually necessary to preprocess the concatenated title text, such as word segmentation, stop word removal, and other processing operations, and then convert the preprocessed concatenated title text into a feature vector, which is then input into the topic classification model. The topic classification model outputs a probability distribution, including the probability that the input concatenated title text belongs to each topic category in the preset topic category set, and finally selects the topic category with the highest probability as the final classification result.
[0149] For example, for the concatenated title text of the above example, the following classification results are obtained:
[0150] [{Materials and Methods_Experimental Materials, Research Content},
[0151] {Materials and methods_Cultivation conditions, research content},
[0152] {Materials and methods_Establishment of leaf regeneration system of Drosera capensis, research content},
[0153] {Materials and methods_Data statistics and analysis, research content},
[0154] {Results and Analysis_Seed Germination Medium Screening Results, Research Results},
[0155] {Results and Analysis_Leaf Regeneration Culture Results, Research Results},
[0156] {Results and Analysis_Rooting Culture Results, Research Results},
[0157] {Discussion and Conclusion_Aseptic Seeding, Research Conclusion},
[0158] {Discussion and Conclusion_Plant Growth Hormone, Research Conclusion},
[0159] {Introduction, Research Background}]
[0160] In another embodiment, the specific implementation of determining the subject category to which each content interval belongs includes: for each content interval, extracting the subject of the content interval, matching the extracted subject with the subject categories in the preset subject category set, and determining the subject category matching the extracted subject according to the matching result. Optionally, matching the extracted subject with the subject categories in the preset subject category set refers to calculating the cosine distance or Euclidean distance between the two to characterize the similarity between the two, and finally selecting the subject category with the highest similarity as the final classification result.
[0161] Step 203: Generate a content organization structure for the main text using content sections of different subject categories.
[0162] In one embodiment, the target content, such as the body of a paper document, is divided into content intervals of different subject categories, and then for each subject category, the content intervals included in the subject category are used to generate a content organization structure for the subject category. Through this processing method, a clear and organized content framework can be created for each subject category, thereby providing strong support for subsequent document reconstruction.
[0163] As an optional implementation method, for each subject category, the content interval corresponding to the subject category is input into a trained content organization structure generation model to obtain the content organization structure of the subject category.
[0164] Referring to the example in the above step 202, the subject category "research content" includes 4 content sections, namely: the content section corresponding to materials and methods_experimental materials, the content section corresponding to materials and methods_culture conditions, the content section corresponding to materials and methods_establishment of the leaf regeneration system of Drosera capensis, and the content section corresponding to materials and methods_data statistics and analysis. In this embodiment, the 4 content sections are spliced in sequence, and the spliced content is input into the trained content organization structure generation model to obtain the text organization structure of the subject category "research content".
[0165] Exemplarily, the above text organization structure adopts Markdown structure. The above content organization structure generation model adopts a large language model based on prompt words to achieve.
[0166] For example, the prompt words are as follows:
[0167] You are an expert. You have rich knowledge in this field and are good at summarizing long papers. Now please make a paper defense ppt based on my paper. The first step is to summarize the research content of the paper. Attach the full text of the paper. Please help me summarize the full text of the paper. 200 words. Requirements: Use framework:
[0168] 1) Brief summary of data and materials
[0169] 2) Focus on the research methods
[0170] 3) Focus on the technical route
[0171] The content range corresponding to "Research content" is:
[0172] Materials and Methods
[0173] Experimental Materials
[0174] Plant materials
[0175] The experimental materials were the seeds of D. capensis purchased commercially and propagated in the laboratory growth room. This experiment was conducted in the laboratory 303 of the South Building of the College of Horticulture and Forestry of Huazhong Agricultural University.
[0176] Test drug
[0177] The reagents used in this study are: 75% ethanol, anhydrous ethanol, NaOH solution, sucrose agar, plant gel, MS basic medium, 1 / 2MS medium, sterile water, 6-BANAAZTIBAGA3, etc.
[0178] Instruments and consumables
[0179] High pressure steam sterilizer, clean bench, electronic balance with precision of 0.01, scissors, tweezers, filter paper, scalpel, weighing paper, medicine spoon, volumetric flask, pipette gun, sealing film, culture bottle, culture dish, conical flask, etc.
[0180] Culture conditions
[0181] The tissue culture seedlings were cultured in a sterile seedling culture room at a temperature of 25±2°C and a photoperiod of 14h light / 10h dark with a light intensity of 2000lx.
[0182] Establishment of leaf regeneration system of Drosera natans
[0183] Sterile seeding
[0184] The seeds of Drosera capensis were sown aseptically in an ultra-clean bench.
[0185] Leaf regeneration culture
[0186] The leaf regeneration rate and leaf regeneration coefficient of Drosera capensis were counted and the growth status was recorded.
[0187] Rooting culture
[0188] Cut the strong single buds grown in the leaf regeneration culture.
[0189] Data statistics and analysis
[0190] Microsoft Office Excel 2010 software was used for data statistics.
[0191] The output markdown structure is:
[0192] #Experimental study on Cape Drosera
[0193] ##Experimental Materials and Methods
[0194] ###Experimental Materials
[0195] -The seeds of D. capensis were used as experimental materials, and the experiment was conducted in Laboratory 303, South Building, College of Horticulture and Forestry, Huazhong Agricultural University.
[0196] ###Test reagents
[0197] -The agents used in the experiment include 75% ethanol, anhydrous ethanol, NaOH solution, sucrose, agar plant gel, MS basic medium, 1 / 2MS medium, sterile water, 6-BANAAZTIBAGA3 and other agents.
[0198] ###Instruments and consumables
[0199] -The experiment used instruments and consumables such as high-pressure steam sterilizer, clean bench, electronic balance, scissors, tweezers, filter paper, scalpel, weighing paper, medicine spoon, volumetric flask, pipette, sealing film, culture bottle, culture dish, conical flask, etc.
[0200] ##Cultivation conditions and experimental steps
[0201] ###Cultivation conditions
[0202] -The tissue culture seedlings were cultured in a sterile seedling culture room with the temperature set at 25±2°C, a photoperiod of 14 h light / 10 h dark, and a light intensity of 2000 lx.
[0203] ###Sterile seeding
[0204] -The seeds of Drosera capensis were sown aseptically in a clean bench, disinfected with 75% ethanol and anhydrous ethanol, and then sown in MS basic medium with different concentrations of GA3 solution.
[0205] ###Leaf regeneration culture
[0206] -To investigate the effect of different basic culture media on the leaf regeneration rate of Drosera capensis, three basic culture media, MS, 1 / 2MS, and 1 / 4MS, were used, and different concentrations of ZT and NAA were added to carry out leaf regeneration culture.
[0207] ###Rooting Culture
[0208] -The robust single buds grown in the leaf regeneration culture were cut and transferred into the rooting medium to explore the effects of different auxins IBA and NAA on the root germination and elongation of Drosera capensis.
[0209] ##Data Statistics and Analysis
[0210] ###Statistics
[0211] -Data statistics were performed using Microsoft Office Excel 2010 software.
[0212] Data Analysis
[0213] -SPSS 20.0 software was used for analysis of significance of differences and Duncan's new multiple range method for multiple comparisons.
[0214] In the markdown structure of the above example, the "#" symbol plus a space represents a title, and the number of # represents the title level, for example: #Title 1, ##Title 2, and so on. Use the "-" or "" symbol plus a space to represent an unordered list, and use a number plus "." plus a space to represent an ordered list, for example: -List Item 1, List Item 2, 1.List Item 3. Bold and italic: Use two asterisks "**" to wrap text to represent bold, and use one asterisk "*" to wrap text to represent italics, for example: bold text, italic text. Use the ">" symbol plus a space to represent a reference, for example: >reference text. Use square brackets "[]" to wrap link text, and then use parentheses "()" to wrap the link address to represent a link, for example: link text. When inserting an image, add "!" before the link address. Use three backticks "```" to wrap a code block. The above are some commonly used Markdown code structures and abbreviations. Using these structures and abbreviations, you can quickly and easily edit and format text.
[0215] In another embodiment, the content intervals corresponding to each subject category are input into the trained content organization structure generation model to obtain an overall content organization structure. The specific implementation method is similar to the above description and will not be repeated here.
[0216] Step 204: Generate a target presentation document based on the content organization structure of the main text.
[0217] Generating a target presentation document based on the content organization structure of the main body of the paper is a process of converting information from one form (such as the content organization structure) to another form (such as a presentation document). This process aims to create a clear, organized and easy-to-understand presentation document that showcases the key information and content structure of the paper document.
[0218] In one embodiment, the specific implementation of generating a target presentation document according to the content organization structure of the main text portion includes: performing the following processing for each subject category: generating a corresponding presentation document section page according to the subject category, and generating a presentation document main text page corresponding to the subject category according to the content organization structure of the subject category; generating a presentation document directory page according to presentation document section pages and presentation document main text pages corresponding to multiple subject categories, and sorting presentation document section pages and presentation document main text pages corresponding to multiple subject categories according to a preset subject category arrangement order to obtain a target presentation document.
[0219] Among them, the presentation section page (or chapter page) is a slide used to identify different subject categories in the presentation document, usually including the title of the subject category. The presentation body page is a slide used to display the specific content under the subject category in the presentation document, usually including the subtitles and content (such as text, data, charts, pictures and other elements) under the subject category.
[0220] Based on this, in this embodiment, for each subject category, a new slide is created as a presentation document section page, and content is added to the presentation document section page, usually the subject category. For example, see Figure 4 , is an example of a presentation document section page. Figure 4 The effect of the example is an optional implementation method. The specific implementation of generating corresponding presentation document section pages according to the subject category includes: filling the subject category into a preset presentation document section page template to obtain the presentation document section page corresponding to the subject category.
[0221] At the same time, in this embodiment, for each subject category, one or more new slides are created as the presentation document body page corresponding to the subject category, and content is added to the presentation document body page according to the content organization structure of the subject category. Figure 5 , which is an example of a presentation document body page.
[0222] Figure 5 The example content is organized as follows:
[0223] {
[0224] #Classification and characteristics of Cape Drosera
[0225] ##Classification Status
[0226] Cape Sundew (D.capensis) belongs to the genus Drosera of the family Droseraceae and is an insectivorous plant.
[0227] ##Growth Environment
[0228] -Prefers to grow in open swampy or sandy environments with high humidity and acidic soil.
[0229] ##Distribution Area
[0230] -Mainly distributed in areas south of the Yangtze River and northeast China.
[0231] In addition, see Figure 5 For example, pictures or icons related to the subject category can also be added to the body page of the presentation document to attract the audience's attention and help them better understand the content of the subject category. This embodiment of the application will not be described in detail.
[0232] The presentation table of contents is a slide used to show the structure of the entire presentation. It usually contains the titles of all subject categories and the corresponding page numbers or links so that the audience can quickly find the sections of interest based on the presentation table of contents.
[0233] For the presentation document directory page, in this embodiment, a new slide is created as the presentation document directory page. On the new slide, the titles of all subject categories are added, and corresponding page numbers or links are added according to their order in the presentation document. For example, see Figure 6 , which is an example of a presentation document catalog page.
[0234] Finally, all presentation document section pages and presentation document body pages are sorted according to the preset subject category arrangement order (such as the chapter order in the paper document), so as to ensure that the content in the target presentation document is presented in a logical and sequential manner. And all the sorted presentation document section pages and presentation document body pages are combined with the presentation document directory page to form a complete presentation document.
[0235] Figure 2 The process shown in the figure determines the main body of the paper document to be processed, and determines the title level of each title paragraph in the main body; divides the main body into multiple content sections according to the title level of each title paragraph, and determines the subject category to which each content section belongs; generates a content organization structure of the main body using content sections of different subject categories, wherein the content organization structure includes the title level and the corresponding text content; generates a target presentation document according to the content organization structure of each subject category, thereby realizing a scheme for automatically generating presentation documents for paper documents, such as defense PPT. Under this scheme, the paper content required for each part of the defense PPT can be automatically extracted from the paper document, and the corresponding PPT content can be generated for the content. On the one hand, this can significantly save manual operations and improve the efficiency of making defense PPT. On the other hand, it can create a PPT presentation document with a clear structure and rich content to show the audience the key information and content structure in the paper.
[0236] pass Figure 5 As can be seen from the example, the body page of a presentation document usually includes a major title, several sub-titles, and the specific content under each sub-title. In actual applications, the title levels and the number of titles contained in the content organization structure of a subject category are complex and varied. Therefore, when forming a presentation document, how to generate a presentation document body page that matches the content organization structure of the subject category, especially the varied title levels and the number of titles, is an important task.
[0237] In this regard, in one embodiment, based on the content organization structure of the subject category, the specific implementation of generating the presentation document body page corresponding to the subject category includes: determining the management interval of each first-level title in the content organization structure of the subject category, wherein the management interval of the first-level title refers to the interval composed of the first-level title, the subordinate level titles of the first-level title and the text content under the title; performing the following processing for the management interval of each first-level title: determining the number of titles of each level in the management interval of the first-level title; determining the main title and sub-title of the presentation document body page from the management interval according to the number of titles of each level and the preset strategy; filling the main title, sub-title and text content in the management interval into the preset presentation document body page template to obtain the presentation document body page corresponding to the subject category.
[0238] Among them, according to the number of titles at each level and the preset strategy, the specific implementation of determining the main title and subtitle of the presentation document body page from the management interval is divided into the following three cases for discussion:
[0239] Case 1: When the management interval contains only the first-level title and the second-level title, the first-level title is determined as the main title of the presentation document body page, and the second-level title is determined as the sub-title of the presentation document body page.
[0240] When the management interval of the first-level title only contains the first-level title and the second-level title, it means that the content organization structure of the subject category is relatively simple. In this case, the first-level title can be directly determined as the main title of the main page of the presentation document, and the second-level title can be determined as the sub-title of the main page of the presentation document.
[0241] Case 2: When the management interval contains three-level titles and the number of three-level titles is less than or equal to the set number threshold, the first-level title is determined as the main title of the presentation document body page, and the third-level title is determined as the subtitle of the presentation document body page.
[0242] The management range of the first-level title includes the first-level title, the second-level title, and the third-level title. However, when the number of the third-level titles is less than or equal to the set number threshold, it means that the content organization structure of the subject category is slightly more complicated than that of the first case, but it still maintains simplicity as a whole. In this case, the first-level title can be directly determined as the main title of the presentation document body page, and the third-level title can be determined as the subtitle of the presentation document body page. Here, the third-level title rather than the second-level title is determined as the subtitle of the presentation document body page mainly due to the following considerations:
[0243] Content richness: Compared with the second-level headings, the third-level headings usually contain more specific and detailed content. Using them as subheadings can divide the content structure of the presentation document more finely.
[0244] Hierarchical relationship: In a management area containing a level 3 heading, the level 3 heading is a subordinate level of the level 2 heading. Using them as subheadings can keep the content hierarchy clear and coherent.
[0245] Quantity control: Since the number of level 3 headings is less than or equal to the set number threshold, using them as subheadings will not make the presentation body page too long or complicated. This helps keep the presentation concise and easy to read.
[0246] Case 3: When the management interval contains level 3 titles and the number of level 3 titles is greater than the set number threshold, the level 3 titles contained in the management interval are grouped according to the arrangement order, wherein the number of level 3 titles in each level 3 title group is less than or equal to the set number threshold. Afterwards, for each level 3 title group, the level 2 title to which the first level 3 title in the level 3 title group belongs is determined as the main title of the presentation document body page, and each level 3 title in the level 3 title group is determined as the subtitle of the presentation document body page.
[0247] The management interval of the first-level title includes the first-level title, the second-level title and the third-level title, but when the number of the third-level titles is greater than the set number threshold, it means that the content organization structure of the subject category is slightly complicated. In this case, in order to ensure that the main text page of the presentation document is not too lengthy or complicated, and to maintain the simplicity and readability of the presentation document, the first-level title is directly determined as the main title of the main text page of the presentation document, and the sub-title is set in the following way: the third-level titles included in the management interval are grouped according to the arrangement order, wherein the number of third-level titles in each third-level title group is less than or equal to the set number threshold. Afterwards, for each third-level title group, the second-level title to which the first third-level title in the third-level title group belongs is determined as the main title of the main text page of the presentation document, and each third-level title in the third-level title group is determined as the sub-title of the main text page of the presentation document.
[0248] For example, the content organization structure of a topic category is as follows:
[0249] {
[0250] #First level title
[0251] ##Secondary Title 1
[0252] ###Level 3 heading 1
[0253] ###Level 3 title 2
[0254] ##Secondary Title 2
[0255] ###Level 3 heading 3
[0256] ###Level 3 heading 4
[0257] ##Second level title 3
[0258] ###Level 3 heading 5
[0259] ###Level 3 heading 6
[0260] ##Second level title 4
[0261] ###Level 3 heading 7
[0262] ###Level 3 heading 8
[0263] ###Level 3 Title 9
[0264] }
[0265] In the above example, the number of level 3 titles contained under each level 2 title is 2, 2, 2, and 3 respectively, and it is assumed that the set number threshold is 4. According to the above description, these level 3 titles are grouped to obtain the following level 3 title grouping results: [[level 3 title 1, level 3 title 2, level 3 title 3, level 3 title 4], [level 3 title 5, level 3 title 6], [level 3 title 7, level 3 title 8, level 3 title 9]. Continuing with the above description, the level 2 title to which the first level 3 title in the level 3 title group [level 3 title 1, level 3 title 2, level 3 title 3, level 3 title 4] belongs is level 2 title 1, and level 2 title 1 is determined as one of the main titles of the main page of the presentation document. Each level 3 title in the level 3 title group is determined as a sub-title under the main title, including: level 3 title 1, level 3 title 2, level 3 title 3, and level 3 title 4. The same is true for other level 3 title groups, which will not be repeated here.
[0266] Finally, the main title, subtitle and text content in the management interval are filled into the preset presentation document body page template to obtain the presentation document body page corresponding to the subject category. In one embodiment, the specific implementation of filling the main title, subtitle and text content in the management interval into the preset presentation document body page template to obtain the presentation document body page corresponding to the subject category includes: determining the number of subtitles corresponding to the main title; determining the number of presentation document body pages S according to the number of subtitles; creating S pages of blank presentation document body pages using the preset presentation document body page template; filling the subtitles corresponding to the main title and the text content under the subtitles into S pages of blank presentation document body pages in the order of arrangement to obtain S pages of presentation document body pages corresponding to the subject category.
[0267] It can be seen from the above description that the number of pages S of the presentation document body will be determined based on the number of subheadings. This processing method can flexibly allocate one or more presentation document body pages to the relevant content of a subject category, which can ensure that the text content under each subheading can be presented completely and accurately, and can ensure the clarity and high readability of each body page. If the content under a subheading is particularly lengthy or complex, it can be split into multiple pages for display to maintain the clarity and readability of each page. For example, if the number of subheadings is relatively small, the subheadings can be merged into the same body page to reduce the number of pages of the presentation document. If the number of subheadings is relatively large, these subheadings can be split into multiple pages for display to maintain the clarity and readability of each page.
[0268] Exemplarily, the maximum content volume that can be accommodated on each text page can be preset, and then the number S of presentation document text pages can be determined based on the maximum content volume and the number of subheadings.
[0269] Exemplarily, a preset presentation document body page template is used to create S blank presentation document body pages. During the creation process, it is ensured that the preset template style is applied to each page to maintain the overall style and consistency of the presentation document.
[0270] Finally, fill the subheadings corresponding to the main headings and the text content under the subheadings into S pages of blank presentation document text pages in the order of arrangement, and make sure they are placed accurately on the corresponding presentation document text pages.
[0271] In addition, in the specific implementation, the font size, color, line spacing and other parameters of the text can also be adjusted to meet the layout requirements and reading experience of the presentation document. In addition, before filling the content into the newly created blank presentation document body page, the text style (such as font, color, line spacing, etc.) of the content to be filled can be set to ensure that the text style on each page of the presentation document body is consistent.
[0272] Add pictures and charts: If the management area contains multimedia elements such as pictures and charts, they also need to be added to the corresponding presentation document body page as required to enhance the visual effect and persuasiveness of the presentation document.
[0273] Through the above-mentioned embodiment, a presentation document body page corresponding to the required subject category can be generated.
[0274] In one embodiment, when the target document is a table document, the organized target content is organized according to the content organization structure of the target content to generate the target document, including:
[0275] Generate corresponding cell items according to the subject categories, and generate cell contents corresponding to the subject categories according to the content organization structure of the content intervals included in the subject categories;
[0276] According to the cell items and cell contents corresponding to the subject categories, the cell contents are added to the corresponding cell items to generate a table document page, and the cell items and cell contents corresponding to the subject categories are sorted according to the preset subject category arrangement order to obtain the target document.
[0277] Among them, the cell item can be a row header, column header, row subject, or column subject in the page. The cell item here can be in a single cell or in a merged cell; the cell content is the content of the corresponding cell item. For example, in the cell content column or row of the cell item belonging to "Name", fill in the names "Xiao Ming", "Xiao Hong", etc.
[0278] There can be one or more table document pages in a table document, and one or more table document pages can constitute a table document; the arrangement of cell items can be arranged according to the subject category after analysis based on the target content in the document, for example, there is a sequence of descriptions of the target content in the document. For example, if the document is a news content, then the news content is sorted according to the content of the document, and the key points of the news content are extracted, including time, place, people, events, etc. This information is formed into time cell items, place cell items, people cell items, and event cell items, and corresponding rows or columns are formed in this order in the table document page. Then, the information of the news content in the document is filled with the corresponding cell contents into the cells under these cell items, for example, "November 11, 2024" is filled in the cell row corresponding to the time cell item until the corresponding cell contents are filled in to form a table document page. Secondly, when multiple news contents are selected, multiple table document pages can be formed.
[0279] In one embodiment, when the target document is a text document, the organized target content is organized according to the content organization structure of the target content to generate the target document, including:
[0280] Generate corresponding title items according to the subject categories, and generate text content corresponding to the subject categories according to the content organization structure of the content intervals included in the subject categories;
[0281] According to the title items and text contents corresponding to the subject categories, the text contents are added to the corresponding title items to generate a text document page, and the title items and text contents corresponding to the subject categories are sorted according to the preset subject category arrangement order to obtain the target document.
[0282] Among them, the title item can be the top-level title of the text document: the main title of the document or article, usually displayed at the beginning, summarizing the entire content, and having the highest level of importance; it can be a subtitle: located under the top-level title, used to further explain or summarize the content of the main title, providing more details or information; it can be a chapter title: used to distinguish different chapters or main parts in an article or document, with a higher hierarchical structure; it can be a sub-chapter title: under the chapter title, used to divide different sub-parts or topics within a chapter to make the content more readable; it can be a secondary title: under the chapter or sub-chapter title, used to further subdivide the content, lead paragraphs or sections, and help readers better understand the topic; it can be a tag title: usually used in introductions or advertisements, to succinctly summarize or emphasize the topic and attract the attention of readers or viewers; it can be a question title: presenting a question or question in the form of a title to guide readers to think or stimulate interest; it can be a functional title: a title that guides or explains a specific function, step or process, used to guide readers to perform specific tasks or operations.
[0283] The text content is the content corresponding to the title item. For example, if the top-level title is "Application of Artificial Intelligence in Office", then the text content is the description of the corresponding title content. The content required for "Application of Artificial Intelligence in Office" is described in detail. The description may contain text, pictures, tables and other different types of content.
[0284] According to the title items and text contents corresponding to the subject categories, the text contents are added to the corresponding title items to generate a text document page. This can be understood as follows: for example, if the document is a table document, the content of the table document is the "Project Information Management Table", which includes multiple cell items, including: project name, project number, person in charge, participating members, project start and end dates, etc., and the cell contents corresponding to these cell items are filled in accordingly, for example, under the cell of the project name is the project "AI Project". In the case where the document is a table document and the target document is a text document, the target content in the table document is processed. For example, when processing the "Project Information Management Table", the cell items "Project Number, Person in Charge, Participating Members, Project Start and End Dates" can be organized as chapter titles in the document, and the "Project Name" can be organized as the top-level title of the document; and the cell contents corresponding to the cell items "Project Number, Person in Charge, Participating Members, Project Start and End Dates" can be organized as text contents under the title.
[0285] In a text document page formed by multiple titles, a document text page may have at least one title or may not include a title, and may include text content or may not include text content. Secondly, the text content may be described continuously across pages; for example, the title "Project Start and End Dates" uses, for example, 2 pages in the text document to describe it.
[0286] Figure 7 This is a block diagram of an embodiment of a document processing device provided in an embodiment of the present application. Figure 7 As shown, the device comprises:
[0287] An acquisition module 71 is used to acquire target content in a document;
[0288] The document conversion module 72 is used to organize the target content according to the style of the target document to form a target document;
[0289] The document and the target document have different formats, and the target content after arrangement has different attributes from the target content before arrangement.
[0290] In a possible implementation manner, the acquisition module 71 is specifically configured to:
[0291] In response to an operation of obtaining target content of a document in a target document, the target content is obtained; or in response to an operation of selecting target content in a document, the target content is obtained;
[0292] The document conversion module 72 is specifically used for:
[0293] The target content is arranged according to the style required at the output position of the target document, and the arranged target content is displayed at the output position of the target document, wherein the arrangement includes one or more of modification, arrangement, and conversion.
[0294] In a possible implementation, the document conversion module 72 includes:
[0295] A first determining unit, used to determine the hierarchical relationship and content interval in the target content;
[0296] A second determining unit, configured to determine a content organization structure of the target content according to the hierarchical relationship and the content interval;
[0297] The reorganization unit is used to organize the organized target content according to the content organization structure of the target content to generate a target document.
[0298] In a possible implementation manner, the second determining unit includes:
[0299] A subject classification subunit, used to determine the subject category to which the content interval belongs;
[0300] The structure determination subunit is used to determine the content organization structure of the target content according to the content intervals included in the subject category.
[0301] In a possible implementation manner, the architecture determination subunit is specifically configured to:
[0302] The content intervals included in the subject category are input into a content organization structure generation model to obtain a content organization structure of the content intervals included in the subject category.
[0303] In a possible implementation manner, the reorganization unit is specifically used to:
[0304] Generate corresponding content items according to the subject category, and generate filling content corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0305] A document page is generated according to the content items and filling contents corresponding to the subject categories, and the content items and filling contents corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
[0306] In a possible implementation manner, the reorganization unit is specifically used to:
[0307] Generate a corresponding presentation document section page according to the subject category, and generate a presentation document body page corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0308] A presentation document directory page is generated according to the presentation document section pages and presentation document body pages corresponding to the subject categories, and the presentation document section pages and presentation document body pages corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
[0309] In a possible implementation manner, the reorganization unit is specifically used to:
[0310] The subject category is filled into a preset presentation document section page template to obtain a presentation document section page corresponding to the subject category.
[0311] In a possible implementation, the device further includes (not shown in the figure):
[0312] The cover generation module is used to determine the cover part in the document; extract the target text content from the cover part; fill the target text content into a preset cover page template to obtain the document cover page of the target document.
[0313] In a possible implementation manner, the reorganization unit is specifically used to:
[0314] Generate corresponding cell items according to the subject category, and generate cell content corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0315] According to the cell items and cell contents corresponding to the subject category, the cell contents are added to the corresponding cell items to generate a table document page, and the cell items and cell contents corresponding to the subject category are sorted according to the preset subject category arrangement order to obtain the target document.
[0316] In a possible implementation manner, the reorganization unit is specifically used to:
[0317] Generate a corresponding title item according to the subject category, and generate text content corresponding to the subject category according to the content organization structure of the content interval included in the subject category;
[0318] According to the title items and text contents corresponding to the subject categories, the text contents are added to the corresponding title items to generate a text document page, and the title items and text contents corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
[0319] like Figure 8As shown, an embodiment of the present application provides a device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0320] Memory 113, used for storing computer programs;
[0321] In one embodiment of the present application, the processor 111 is used to execute the program stored in the memory 113 to implement the document processing method provided by any of the above method embodiments, including:
[0322] Obtain target content in the document, organize the target content according to the style of the target document, and form a target document;
[0323] The document and the target document have different formats, and the target content after arrangement has different attributes from the target content before arrangement.
[0324] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the document processing method provided in any of the aforementioned method embodiments are implemented.
[0325] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0326] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0327] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0328] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A document processing method, characterized in that: The method comprises: Acquire target content in the document, and organize the target content according to the style of the target document to form a target document; The document and the target document have different formats, and the target content after arrangement has different attributes from the target content before arrangement.
2. The method according to claim 1, characterized in that The step of obtaining target content in the document and arranging the target content according to the style of the target document includes: In response to an operation of obtaining target content of a document in a target document, the target content is obtained; or in response to an operation of selecting target content in a document, the target content is obtained; The target content is collated according to the style required at the output position of the target document, and the collated target content is displayed at the output position of the target document.
3. The method according to claim 2, characterized in that The forming of the target document comprises: Determine the hierarchical relationships and content intervals in the target content; Determining a content organization structure of the target content according to the hierarchical relationship and the content interval; The organized target content is organized according to the content organization structure of the target content to generate a target document.
4. The method according to claim 3, characterized in that: The determining the content organization structure of the target content according to the hierarchical relationship and the content interval includes: Determine the subject category to which the content interval belongs; The content organization structure of the target content is determined according to the content intervals included in the subject category.
5. The method according to claim 4, characterized in that Determining the content organization structure of the target content according to the content intervals included in the subject category includes: The content intervals included in the subject category are input into a content organization structure generation model to obtain a content organization structure of the content intervals included in the subject category.
6. The method according to claim 4, characterized in that The step of organizing the organized target content according to the content organization structure of the target content to generate a target document includes: Generate corresponding content items according to the subject category, and generate filling content corresponding to the subject category according to the content organization structure of the content interval included in the subject category; A document page is generated according to the content items and filling contents corresponding to the subject categories, and the content items and filling contents corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
7. The method according to claim 4, characterized in that In the case where the target document is a presentation document, the target content is sorted according to the content organization structure of the target content to generate the target document, including: Generate a corresponding presentation document section page according to the subject category, and generate a presentation document body page corresponding to the subject category according to the content organization structure of the content interval included in the subject category; A presentation document directory page is generated according to the presentation document section pages and presentation document body pages corresponding to the subject categories, and the presentation document section pages and presentation document body pages corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
8. The method according to claim 7, characterized in that The step of generating a corresponding presentation document section page according to the subject category includes: The subject category is filled into a preset presentation document section page template to obtain a presentation document section page corresponding to the subject category.
9. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: determining a cover portion of the document; Extracting target text content from the cover part; The target text content is filled into a preset cover page template to obtain the document cover page of the target document.
10. The method according to claim 6, characterized in that In the case where the target document is a table document, the step of arranging the arranged target content according to the content organization structure of the target content to generate the target document includes: Generate corresponding cell items according to the subject category, and generate cell content corresponding to the subject category according to the content organization structure of the content interval included in the subject category; According to the cell items and cell contents corresponding to the subject category, the cell contents are added to the corresponding cell items to generate a table document page, and the cell items and cell contents corresponding to the subject category are sorted according to the preset subject category arrangement order to obtain the target document.
11. The method according to claim 6, characterized in that In the case where the target document is a text document, the step of organizing the organized target content according to the content organization structure of the target content to generate the target document includes: Generate a corresponding title item according to the subject category, and generate text content corresponding to the subject category according to the content organization structure of the content interval included in the subject category; According to the title items and text contents corresponding to the subject categories, the text contents are added to the corresponding title items to generate a text document page, and the title items and text contents corresponding to the subject categories are sorted according to a preset subject category arrangement order to obtain a target document.
12. A document processing device, characterized in that: The device comprises: The acquisition module is used to obtain the target content in the document; The document conversion module is used to organize the target content according to the style of the target document to form the target document; The document and the target document have different formats, and the target content after arrangement has different attributes from the target content before arrangement.
13. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the document processing method according to any one of claims 1 to 11.
Citation Information
Cited By
Document processing method and apparatus, and storage medium
WO2026108867A1