Intelligent document typesetting method and device, equipment and storage medium
通过检测文档段落数量和进行特征分析,生成公文结构树,解决了公文排版中人工参与多的问题,实现了公文个性化定制和自动排版,显著提高了企业公文排版效率,并降低了使用门槛。
Patent Information
- Application Number
- CN202411023429.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-12-06
AI Technical Summary
The existing official document typesetting process requires more manual participation, which is low in efficiency and high threshold for use. The functions of the typesetting software are too complicated and complicated, making it difficult to meet the requirements of personalized customization, resulting in low efficiency of corporate official document typesetting.
By detecting whether the number of paragraphs in the document meets the minimum paragraph requirements, perform feature analysis on paragraph by paragraph, generate official document structure trees, perform conditional processing according to format requirements, identify and ignore elements such as tables and images, realize automatic layout, and provide devices and computing equipment to Lower the threshold for use.
It realizes the simplicity, lightness and efficiency of personalized customization and automatic layout of official documents, significantly improving the efficiency of corporate official documents, and automatically installing the VSTO operation support library, lowering the threshold for staff use.
Smart Images

Figure CN119089862A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence algorithm technology, and in particular to an official document intelligent typesetting method, device and storage medium. Background Art
[0002] Official document typesetting refers to the process of automatically typesetting and formatting official documents using artificial intelligence technology. In the prior art, the typesetting of official documents usually needs to be done manually, including adjusting the font, font size, line spacing, paragraph spacing, etc., to ensure that the format of the official document meets the specifications and standards.
[0003] With the development of artificial intelligence technology, especially the progress of natural language processing and computer vision, the intelligent typesetting of official documents has been significantly improved. Now, by using algorithms and models, the text content in official documents, including titles, paragraphs, tables and images, can be automatically identified and processed. However, in reality, there is still a lot of manual participation in the typesetting process of official documents, which is inefficient. The reason is that the threshold for use is high and the typesetting software is difficult to operate. In addition, the existing software functions are too cumbersome and complex, and it is not easy to meet the requirements of personalized customization.
[0004] Therefore, how to achieve simple, lightweight and efficient automatic typesetting of official documents according to different official document requirements, as well as personalized customization according to requirements, and improve the efficiency of corporate document typesetting is an urgent problem to be solved. Summary of the invention
[0005] To this end, the present application provides a technical solution to provide new solutions and technical methods to make up for the above-mentioned defects of the prior art. The present invention provides an intelligent document typesetting method, device and storage medium to solve at least one of the above-mentioned technical problems.
[0006] To achieve the above objectives, in a first aspect, the present invention provides a method for intelligent typesetting of official documents, comprising:
[0007] Check whether the number of paragraphs in the current document meets the minimum paragraph requirement of the official document;
[0008] If the requirements are met, continue to perform a first feature analysis on the document content paragraph by paragraph, wherein the first feature analysis content includes: document title, main sender unit information, signature and signature date identification;
[0009] Then, a second feature analysis is performed on the document content, wherein the second feature analysis includes: identification of first-level titles, second-level titles and multi-level titles, and identification of multiple elements such as attachments and text;
[0010] Generate a document structure tree based on the results of the first feature analysis and the second feature analysis; scan the text content of each paragraph in the document structure tree according to the document format requirements, detect the parts that do not meet the document format requirements, and perform conditional processing until the requirements are met;
[0011] A termination word is set for the document, and a judgment is made when the termination word is scanned; if it is determined that there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format, the scanning is terminated and the end of typesetting is prompted; otherwise, the scanning and typesetting are continued until there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format.
[0012] Furthermore, the minimum paragraph requirement includes at least 5 paragraphs, namely: title, main addressee, main text, signature and signature date.
[0013] Furthermore, in the analysis process, related elements such as tables, images and charts contained in the document are identified and ignored.
[0014] Furthermore, the format requirements include: replacing half-width punctuation marks in the document; deleting extra blank lines, spaces and punctuation marks; setting the document page format and setting the page number format according to odd and even pages; calculating and setting the margins for aligning the attachment title; calculating and setting the right margin of the signature based on the text length of the document signature; calculating and setting the right margin of the signature and signature date based on the position of the signature.
[0015] In a second aspect, the present invention further provides an intelligent document typesetting device, the device comprising: a document detection module, a document scanning module, a document analysis module, and a document judgment module;
[0016] The document detection module is used to detect whether the number of paragraphs in the current document meets the minimum paragraph requirement of the official document; and according to the official document format requirement, scan the text content of each paragraph in the official document structure tree, detect the parts that do not meet the official document format requirement and perform conditional processing until the detection meets the requirement and the module terminates;
[0017] The document scanning module is used to scan the document, extract the termination word set in the document, and receive the instruction issued by the judgment module to perform the next operation;
[0018] The document analysis module is used to perform a first feature analysis on the document content paragraph by paragraph, wherein the first feature analysis includes: identification of the document title, the main addressee information, the signature and the signature date; then perform a second feature analysis on the document content, wherein the second feature analysis includes: identification of the first-level title, the second-level title and the multi-level title, and identification of multiple elements such as attachments and the main text; and generate a document structure tree based on the results of the first feature analysis and the second feature analysis;
[0019] The document judgment module is used to judge the termination word provided by the document scanning module; if it is judged that there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format, a termination scanning signal is sent to the document scanning module; otherwise, a continuation scanning signal is sent until there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format.
[0020] Furthermore, the minimum paragraph requirement includes at least 5 paragraphs, namely: title, main addressee, main text, signature and signature date.
[0021] Furthermore, in the analysis process, related elements such as tables, images and charts contained in the document are identified and ignored.
[0022] Furthermore, the format requirements include: replacing half-width punctuation marks in the document; deleting extra blank lines, spaces and punctuation marks; setting the document page format and setting the page number format according to odd and even pages; calculating and setting the margins for aligning the attachment title; calculating and setting the right margin of the signature based on the text length of the document signature; calculating and setting the right margin of the signature and signature date based on the position of the signature.
[0023] In a third aspect, the present invention provides a computing device, comprising:
[0024] A memory for storing program instructions;
[0025] The processor is used to call the program instructions stored in the memory and execute the above-mentioned intelligent document typesetting method according to the obtained program instructions.
[0026] In a fourth aspect, the present invention provides a computer-readable storage medium, including computer-readable instructions. When a computer reads and executes the computer-readable instructions, the above-mentioned method for intelligent typesetting of official documents is implemented. The readable medium may be multiple, and the multiple readable media can operate independently of each other.
[0027] Compared with the prior art, this solution detects whether the number of document paragraphs meets the minimum paragraph requirement of the official document, performs feature analysis on the document content paragraph by paragraph, generates an official document structure tree according to the analysis results, scans the text content of each paragraph in the official document structure tree according to the format requirements, detects the parts that do not meet the official document format requirements, performs conditional processing, sets a termination word, and judges the termination word until it meets the requirements. While realizing the personalized customization of official documents, it also realizes simpler, lighter, and more efficient automatic typesetting when editing official documents, significantly improving the typesetting efficiency of corporate official documents. In addition, the device provided by the present invention automatically installs the VSTO runtime support library according to the software environment, and automatically registers as an extension plug-in for Word or WPS, which reduces the threshold for use by staff, brings a better user experience, and improves the overall work efficiency of staff. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present disclosure 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, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0029] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for intelligent typesetting of official documents provided by the present invention;
[0030] Figure 2 A structural block diagram of an embodiment of an intelligent document typesetting device provided by the present invention. DETAILED DESCRIPTION
[0031] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0032] It will be understood by those skilled in the art that, unless otherwise stated, the singular forms "a", "an" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0033] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0034] The VSTO (Visual Studio Tools for Office) toolkit adopted by the present invention is developed using C# language and is embedded in Word or WPS text for operation and use in the form of a function extension plug-in.
[0035] In order to make the objectives, technical solutions and advantages of the present application more clear, the specific implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0036] The core of the present invention is to provide a method for intelligent typesetting of official documents, such as Figure 1 The figure is a flow chart of the intelligent document typesetting method provided in this embodiment. In order to better understand the method, Figure 1 The technical solution of this embodiment is described in detail:
[0037] Step S1: Detect whether the number of paragraphs in the current document meets the minimum paragraph requirement of the official document. If so, continue to perform first feature and second feature analysis on the document content paragraph by paragraph;
[0038] In a preferred embodiment, according to the requirements of the official document format, a complete official document needs to include at least five parts: title, main addressee, body, signature and signature date. Therefore, a complete official document should contain at least five paragraphs.
[0039] Step S2: The first feature analysis includes: document title, recipient information, signature and signature date identification; then a second feature analysis is performed on the document content, and the second feature analysis includes: first-level title, second-level title and multi-level title identification, attachments and text and other multi-factor information identification.
[0040] In a preferred embodiment, the document content is analyzed paragraph by paragraph to identify each document element. When analyzing the document, the title, the main addressee, the signature and the signature date of the first document are first identified, and then the feature analysis of the rest of the text content is performed to accurately identify the first-level title, second-level title, third-level title, attachments and ordinary text elements.
[0041] Step S3: Generate a document structure tree according to the first feature analysis and the second feature analysis results.
[0042] Step S4: Scan the text content of each paragraph in the document structure tree according to the document format requirements, detect the parts that do not meet the document format requirements, and perform conditional processing until the requirements are met.
[0043] In a preferred embodiment, according to the document format requirements, the text content of each paragraph in the document structure tree is scanned, all half-width punctuation marks are replaced, and redundant blank lines, spaces and punctuation marks are deleted.
[0044] In a preferred embodiment, the document page format is set, the page number format is set according to odd and even pages, and the corresponding format is set for each type of paragraph in the document structure tree according to the document format requirements.
[0045] In a preferred embodiment, the margin for aligning the attachment title is calculated and set; the right margin of the signature is calculated and set based on the text length of the signature; and the right margin of the signature and the signature date is calculated and set based on the position of the signature to ensure that the signature and the signature date are centered.
[0046] Step S5: Set a termination word for the document, and make a judgment when scanning to the termination word; if it is determined that there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format, terminate the scan and prompt the end of typesetting; otherwise, continue scanning and typesetting until there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format.
[0047] In a preferred embodiment, when there is no paragraph after the date of signature or the paragraph begins with "Attachment", the paragraph scanning and typesetting are finished. Otherwise, the scanning and typesetting of the next document are carried out, and so on, until all paragraphs are scanned.
[0048] In one embodiment, the minimum paragraph requirement includes at least five paragraphs, namely: title, addressee, body, signature and signature date.
[0049] In one embodiment, during the analysis process, related elements such as tables, images, and charts contained in the document are identified and ignored.
[0050] In one embodiment, the format requirements include: replacing half-width punctuation marks in the document; deleting extra blank lines, spaces and punctuation marks; setting the document page format and setting the page number format according to odd and even pages; calculating and setting the margins for aligning the attachment title; calculating and setting the right margin of the signature based on the text length of the document signature; calculating and setting the right margin of the signature and the signature date based on the position of the signature.
[0051] In this embodiment, by detecting whether the number of document paragraphs meets the minimum paragraph requirement of the official document, the document content is analyzed paragraph by paragraph, and the official document structure tree is generated according to the analysis results. The text content of each paragraph in the official document structure tree is scanned according to the format requirements, and the parts that do not meet the official document format requirements are detected for conditional processing, and the termination words are set and judged until they meet the requirements. While realizing the personalized customization of official documents, it also realizes simpler, lighter and more efficient automatic typesetting when editing official documents, which significantly improves the efficiency of corporate document typesetting.
[0052] In one embodiment, the present application provides an intelligent document typesetting device, see Figure 2 The figure shows a structural block diagram of an intelligent document typesetting device provided in this embodiment, wherein the device comprises: a document detection module 10, a document scanning module 20, a document analysis module 30, and a document judgment module 40;
[0053] Document detection module 10: used to detect whether the number of paragraphs in the current document meets the minimum paragraph requirement of the official document; and according to the official document format requirements, scan the text content of each paragraph in the official document structure tree, detect the parts that do not meet the official document format requirements and perform conditional processing until the detection meets the requirements and terminates.
[0054] In a preferred embodiment, according to the requirements of official document format, a complete official document needs to include at least five parts: title, main addressee, body, signature and signature date, so a complete official document should contain at least five paragraphs.
[0055] The document scanning module 20 is used to scan the document, extract the termination word set in the document, and receive the instruction sent by the judgment module to perform the next operation.
[0056] In a preferred embodiment, the document scanning module 20 is used to scan the text content of each paragraph in the document structure tree according to the document format requirements, replace all half-width punctuation marks, and delete unnecessary blank lines, spaces and punctuation marks.
[0057] In a preferred embodiment, the document scanning module 20 is used to set the document page format, set the page number format according to odd and even pages, and set corresponding formats for each type of paragraph in the document structure tree according to the document format requirements.
[0058] In a preferred embodiment, the document scanning module 20 is used to calculate and set the margin for aligning the attachment title; calculate and set the right margin of the signature based on the text length of the signature; calculate and set the right margin of the signature and the signature date based on the position of the signature to ensure that the signature and the signature date are centered.
[0059] Document analysis module 30: used to perform a first feature analysis on the document content paragraph by paragraph, the first feature analysis content includes: document title, main addressee information, signature and signature date identification; then perform a second feature analysis on the document content, the second feature analysis content includes: first-level title, second-level title and multi-level title identification, attachment and text and other multi-factor information identification; based on the results of the first feature analysis and the second feature analysis, generate a document structure tree.
[0060] In a preferred embodiment, the document analysis module 30 is used to analyze the document content paragraph by paragraph to identify each document element. When analyzing the document, the title, the main addressee, the signature and the signature date of the first document are first identified, and then the feature analysis of the other text contents is performed to accurately identify the first-level title, second-level title, third-level title, attachments and ordinary text elements.
[0061] Document judgment module 40: used to judge the termination word provided by the document scanning module; if it is judged that there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format, a termination scanning signal is sent to the document scanning module; otherwise, a continuation scanning signal is sent until there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format.
[0062] In a preferred embodiment, the document judgment module 40 is used to judge: when there is no paragraph after the date of signature or the paragraph begins with "Attachment", the paragraph scanning and typesetting are finished. Otherwise, the scanning and typesetting of the next document are carried out, and so on, until all paragraphs are scanned.
[0063] In one embodiment, the minimum paragraph requirement includes at least five paragraphs, namely: title, addressee, body, signature and signature date.
[0064] In one embodiment, during the analysis process, related elements such as tables, images, and charts contained in the document are identified and ignored.
[0065] In one embodiment, the format requirements include: replacing half-width punctuation marks in the document; deleting extra blank lines, spaces and punctuation marks; setting the document page format and setting the page number format according to odd and even pages; calculating and setting the margins for aligning the attachment title; calculating and setting the right margin of the signature based on the text length of the document signature; calculating and setting the right margin of the signature and the signature date based on the position of the signature.
[0066] In one embodiment, during the installation process, the device automatically installs the VSTO runtime support library according to the software environment on the running computer, and automatically registers as an extension plug-in for Word or WPS text.
[0067] In this embodiment, by detecting whether the number of document paragraphs meets the minimum paragraph requirement of the official document, the document content is analyzed paragraph by paragraph, and the official document structure tree is generated according to the analysis results. The text content of each paragraph in the official document structure tree is scanned according to the format requirements, and the parts that do not meet the official document format requirements are detected for conditional processing, and the termination words are set and judged until they meet the requirements. While realizing the personalized customization of official documents, it also realizes simpler, lighter and more efficient automatic typesetting when editing official documents, which significantly improves the efficiency of corporate document typesetting.
[0068] In addition, the device provided in this embodiment automatically installs the VSTO runtime support library according to the software environment, and automatically registers as an extension plug-in for Word or WPS, thereby lowering the usage threshold for staff, bringing a better user experience and improving the overall work efficiency of staff.
[0069] The document intelligent typesetting device of this embodiment is used to implement the document intelligent typesetting method described above, so the specific implementation of the document intelligent typesetting device can be seen in the specific implementation of the document intelligent typesetting method described above. Therefore, its specific implementation can refer to the description of the corresponding embodiments of each part, and the device provided by the present invention is attached to the method provided by the present invention, and its specific effects can refer to the above method, which will not be repeated here.
[0070] In one embodiment, a computing device is provided, comprising:
[0071] A memory for storing program instructions;
[0072] A processor is used to implement the steps of the document intelligent typesetting method as described in any one of the above when executing the computer program. The document intelligent typesetting method of the present invention has obvious advantages and beneficial effects compared with the prior art. By detecting whether the number of document paragraphs meets the minimum paragraph requirement of the document, the document content is analyzed paragraph by paragraph, and the document structure tree is generated according to the analysis result. The text content of each paragraph in the document structure tree is scanned according to the format requirements, and the parts that do not meet the document format requirements are detected and conditional processing is performed, and the termination word is set, and the termination word is judged until it meets the requirements. While realizing the personalized customization of the document, it also realizes a simpler, lighter and more efficient automatic typesetting when editing the document, and significantly improves the typesetting efficiency of the enterprise document. And the present invention automatically installs the VSTO operation support library according to the software environment, and automatically registers as an extension plug-in of Word or WPS, which reduces the threshold for staff to use, brings a better user experience and improves the overall work efficiency of the staff.
[0073] In one embodiment, a computer-readable storage medium is provided, including computer-readable instructions, when a computer reads and executes the computer-readable instructions, the steps of the above-mentioned method for intelligent typesetting of official documents are realized, the method for intelligent typesetting of official documents of the present invention, compared with the prior art, has obvious advantages and beneficial effects, by detecting whether the number of document paragraphs meets the minimum paragraph requirements of the official document, the document content is analyzed paragraph by paragraph, the official document structure tree is generated according to the analysis result, the text content of each paragraph in the official document structure tree is scanned according to the format requirements, the parts that do not meet the format requirements of the official document are detected, and conditional processing is performed, and a termination word is set, and the termination word is judged until it meets the requirements. While realizing the personalized customization of official documents, it is also realized when editing official documents, and a simpler, lighter and more efficient automatic typesetting is realized, which significantly improves the efficiency of typesetting of enterprise official documents. And the present invention automatically installs the VSTO operation support library according to the software environment, and automatically registers as an extension plug-in of Word or WPS, which reduces the threshold for use of staff, brings better user experience and improves the overall work efficiency of staff.
[0074] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the specific device can be divided into different functional modules to complete all or part of the functions described above.
[0075] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0076] In several embodiments covered by the present application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or it can be an electrical, mechanical or other form of connection.
[0077] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0078] In addition, each functional module in each embodiment of the present application can be implemented in the form of hardware or in the form of software functional modules. If these functional modules are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or part of the prior art that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a computer program product, which includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer program product is stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, a computer instruction can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives (SSDs)).
[0079] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
Claims
1. A method for intelligent typesetting of official documents, characterized in that: include: Check whether the number of paragraphs in the current document meets the minimum paragraph requirement of the official document; If the requirements are met, continue to perform a first feature analysis on the document content paragraph by paragraph, wherein the first feature analysis content includes: document title, main sender unit information, signature and signature date identification; Then, a second feature analysis is performed on the document content, wherein the second feature analysis includes: identification of first-level titles, second-level titles and multi-level titles, and identification of multiple elements such as attachments and text; Generate a document structure tree based on the results of the first feature analysis and the second feature analysis; scan the text content of each paragraph in the document structure tree according to the document format requirements, detect the parts that do not meet the document format requirements, and perform conditional processing until the requirements are met; A termination word is set for the document, and a judgment is made when the termination word is scanned; if it is determined that there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format, the scanning is terminated and the end of typesetting is prompted; otherwise, the scanning and typesetting are continued until there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format.
2. The method for intelligent typesetting of official documents according to claim 1, characterized in that: The minimum paragraph requirement includes at least 5 paragraphs, namely: title, main addressee, main text, signature and signature date.
3. The method for intelligent typesetting of official documents according to claim 1, characterized in that: During the analysis process, relevant elements such as tables, images and charts contained in the document are identified and ignored.
4. The method for intelligent typesetting of official documents according to claim 1, characterized in that: The format requirements include: replacing half-width punctuation marks in the document; deleting extra blank lines, spaces and punctuation marks; setting the document page format and setting the page number format according to odd and even pages; calculating and setting the margins for aligning the attachment title; calculating and setting the right margin of the signature based on the text length of the document signature; calculating and setting the right margin of the signature and signature date based on the position of the signature.
5. An intelligent document typesetting device, characterized in that: The device comprises: a document detection module, a document scanning module, a document analysis module, and a document judgment module; The document detection module is used to detect whether the number of paragraphs in the current document meets the minimum paragraph requirement of the official document; and according to the official document format requirement, scan the text content of each paragraph in the official document structure tree, detect the parts that do not meet the official document format requirement and perform conditional processing until the detection meets the requirement and the module terminates; The document scanning module is used to scan the document, extract the termination word set in the document, and receive the instruction issued by the judgment module to perform the next operation; The document analysis module is used to perform a first feature analysis on the document content paragraph by paragraph, wherein the first feature analysis includes: identification of the document title, the main addressee information, the signature and the signature date; then perform a second feature analysis on the document content, wherein the second feature analysis includes: identification of the first-level title, the second-level title and the multi-level title, and identification of multiple elements such as attachments and the main text; and generate a document structure tree based on the results of the first feature analysis and the second feature analysis; The document judgment module is used to judge the termination word provided by the document scanning module; if it is judged that there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format, a termination scanning signal is sent to the document scanning module; otherwise, a continuation scanning signal is sent until there is no paragraph after the termination word or the paragraph after the termination word starts with a specific format.
6. The intelligent document typesetting device according to claim 5, characterized in that: The minimum paragraph requirement includes at least 5 paragraphs, namely: title, main addressee, main text, signature and signature date.
7. The intelligent document typesetting device according to claim 5, characterized in that: During the analysis process, relevant elements such as tables, images and charts contained in the document are identified and ignored.
8. The intelligent document typesetting device according to claim 5, characterized in that: The format requirements include: replacing half-width punctuation marks in the document; deleting extra blank lines, spaces and punctuation marks; setting the document page format and setting the page number format according to odd and even pages; calculating and setting the margins for aligning the attachment title; calculating and setting the right margin of the signature based on the text length of the document signature; calculating and setting the right margin of the signature and signature date based on the position of the signature.
9. A computing device, characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 4 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: It includes computer-readable instructions. When a computer reads and executes the computer-readable instructions, it implements the method as claimed in any one of claims 1 to 4. There can be multiple readable media, and the multiple readable media can operate independently of each other.
