Document processing method and device, electronic equipment and storage medium

By combining model identification results and recall rules in document processing, the problem of model identification errors or missed identification is solved, and the accuracy and completeness of document element type recognition is improved.

CN119886112APending Publication Date: 2025-04-25ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411974206.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the prior art, model identification errors or missed identifications lead to inaccurate identification results of document element type identification.

Method used

By obtaining the model identification results of the target document and the recall rules for the set recall target, the recall process is performed in the document to determine the feature type of the paragraph. Specific steps include positioning the recall interval, discarding or correcting the error recognition results, and finally determining the feature type of the paragraph.

Benefits of technology

The accuracy and completeness of document feature type recognition is improved, and by combining model identification results and rule-based recall strategies, the inadequacy of model identification is supplemented to ensure the accuracy of document processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886112A_ABST
    Figure CN119886112A_ABST
Patent Text Reader

Abstract

The invention relates to a document processing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a to-be-processed target document, and determining a model recognition result of a paragraph in the target document through a document element recognition model, the model recognition result comprising an element type of the paragraph determined through the document element recognition model; according to the model identification result of the paragraph in the target document and a set recall rule corresponding to the recall target, performing recall processing of the recall target in the target document; according to the recall processing result of the recall target and the model identification result of the paragraphs in the target document, the element types of the paragraphs in the target document are determined, and the recall processing result comprises the element types of the paragraphs determined through recall processing. Therefore, a scheme for recognizing the paragraph element types in the document by combining the recognition capability of the document element recognition model and the rule-based recall strategy is provided, and the accuracy and integrity of document element type recognition can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a document processing method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of information technology, the application scope of electronic documents is becoming more and more extensive. At the same time, in order to efficiently process electronic documents, it has become a common practice to use models (such as machine learning models, deep learning models, etc.) to identify and analyze documents.

[0003] In the related art, before sending the document to the model for recognition and analysis, some processing work is usually performed on the document, such as eliminating useless or unhelpful information in the document for the model to identify the element type, so as to improve the recognition efficiency of the model and reduce its computational burden. For example, the document is segmented and the model is recognized in units of segments, aiming to find the best balance between recognition efficiency and recognition accuracy, and to ensure that the document element recognition model can perform at its best under limited computing resources. Although such processing work is aimed at improving the recognition efficiency of the model and reducing the burden of the model, it may also introduce some potential problems, such as the problem of model recognition errors. On the other hand, the model cannot completely avoid the problem of limited recognition ability in the face of complex and changeable document structures and contents, such as failure to recognize certain specific information or inaccurate boundary division of certain elements. Summary of the invention

[0004] The present application provides a document processing method, device, electronic device and storage medium to solve the technical problem in the prior art that model recognition errors or missed recognition may exist, thereby resulting in errors in the recognition results of document element types that rely on the model.

[0005] In a first aspect, the present application provides a document processing method, the method comprising:

[0006] Acquire a target document to be processed, and determine a model recognition result of a paragraph in the target document using a document element recognition model, wherein the model recognition result includes: an element type of the paragraph determined by the document element recognition model;

[0007] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall processing of the recall target is performed in the target document;

[0008] According to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, the element type of the paragraph in the target document is determined, wherein the recall processing result includes: the element type of the paragraph determined by the recall processing.

[0009] In a possible implementation, the recall processing of the recall target in the target document according to the model recognition result of the paragraph in the target document and the set recall rule corresponding to the recall target includes:

[0010] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall interval corresponding to the recall target is located from the target document, and the element type of the paragraph in the recall interval is determined.

[0011] In a possible implementation, locating the recall interval corresponding to the recall target from the target document according to the model recognition result of the paragraph in the target document and the set recall rule corresponding to the recall target includes:

[0012] According to the model recognition result of the paragraph in the target document, a paragraph matching the recall rule corresponding to the set recall target is located from the target document as a candidate paragraph;

[0013] Determining the location features of the candidate paragraphs in the target document, and determining the candidate paragraphs whose location features match the recall rule as target paragraphs;

[0014] A recall interval corresponding to the recall target is located from the target document according to the target paragraph.

[0015] In a possible implementation manner, locating a recall interval corresponding to the recall target from the target document according to the target paragraph includes:

[0016] Determine the target paragraph as the starting paragraph of the recall target, and determine the ending paragraph of the recall target in the following of the starting paragraph;

[0017] The start paragraph, the end paragraph, and a paragraph between the start paragraph and the end paragraph are determined as a recall interval corresponding to the recall target.

[0018] In a possible implementation, locating, from the target document according to the model recognition result of the paragraph in the target document, a paragraph that matches a recall rule corresponding to a set recall target as a candidate paragraph includes:

[0019] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the non-directory title paragraph is located from the target document, and the non-directory title paragraph is determined as a candidate paragraph;

[0020] The step of determining the end paragraph of the recall target below the start paragraph includes:

[0021] Obtain the numbering interval and / or outline interval of the paragraphs following the starting paragraph;

[0022] According to the numbering interval and / or outline interval, an end paragraph of the recall target is determined below the start paragraph.

[0023] In a possible implementation, locating, from the target document according to the model recognition result of the paragraph in the target document, a paragraph that matches a recall rule corresponding to a set recall target as a candidate paragraph includes:

[0024] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the unnumbered title paragraph is located from the target document, and the unnumbered title paragraph is determined as a candidate paragraph;

[0025] The step of determining the end paragraph of the recall target below the start paragraph includes:

[0026] Determine the previous paragraph of the first body title paragraph below the start paragraph as the end paragraph of the recall target;

[0027] Alternatively, the previous paragraph of the first determined starting paragraph in the following of the starting paragraph is determined as the ending paragraph of the recall target.

[0028] In a possible implementation, locating, from the target document according to the model recognition result of the paragraph in the target document, a paragraph that matches a recall rule corresponding to a set recall target as a candidate paragraph includes:

[0029] According to the model recognition result of the paragraphs in the target document and the recall rule corresponding to the set recall target, the title paragraph containing the specified content and having the specified text structure is located from the target document to be determined as the candidate paragraph;

[0030] The step of determining the end paragraph of the recall target below the start paragraph includes:

[0031] Determine the last paragraph following the start paragraph as the end paragraph of the recall target;

[0032] Alternatively, the previous paragraph of the first determined starting paragraph in the following of the starting paragraph is determined as the ending paragraph of the recall target;

[0033] Determine the parent directory of the sub-document area to which the start paragraph belongs, and find the first directory title located below the start paragraph from the parent directory; determine the previous paragraph of the found directory title in the target document as the end paragraph of the recall target.

[0034] In a possible implementation, locating the recall interval corresponding to the recall target from the target document according to the model recognition result of the paragraph in the target document and the set recall rule corresponding to the recall target includes:

[0035] Determine the paragraph interval of the directory body from the target document according to the model recognition result of the paragraph in the target document;

[0036] Starting from the first paragraph of the catalog body paragraph interval, traversing upwards paragraph by paragraph, if the traversed paragraph meets the set condition, continue traversing until the catalog title paragraph is traversed or the traversed paragraph does not meet the set condition, stop traversing, and determine the next paragraph of the currently traversed paragraph as the starting paragraph of the recall interval corresponding to the recall target; and / or,

[0037] Starting from the last paragraph of the table of contents body paragraph interval, traverse downwards paragraph by paragraph, and if the traversed paragraph meets the set conditions, continue traversing until the table of contents title paragraph is traversed or the traversed paragraph does not meet the set conditions, then stop traversing, and determine the previous paragraph of the currently traversed paragraph as the end paragraph of the recall interval corresponding to the recall target.

[0038] In a possible implementation, the recall processing of the recall target in the target document according to the model recognition result of the paragraph in the target document and the set recall rule corresponding to the recall target includes:

[0039] According to the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall target, the paragraphs containing the specified content and / or having the specified text structure are located from the recall interval and determined as the target paragraphs belonging to the recall target.

[0040] In a possible implementation, the method further includes:

[0041] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall target is discarded in the target document;

[0042] The determining the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document includes:

[0043] The element type of the paragraph in the target document is determined according to the recall processing result and the discard processing result of the recall target and the model recognition result of the paragraph in the target document.

[0044] In a possible implementation, the method further includes:

[0045] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall target is corrected in the target document;

[0046] The determining the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document includes:

[0047] The element type of the paragraph in the target document is determined according to the recall processing result and the correction processing result of the recall target and the model recognition result of the paragraph in the target document.

[0048] In a possible implementation, the correction process of the recall target in the target document according to the model recognition result of the paragraph in the target document and the set recall rule corresponding to the recall target includes:

[0049] Locating the same-level numbering intervals from the target document according to the model recognition results of the paragraphs in the target document;

[0050] According to the numbers of the paragraphs in the same-level numbering interval, the outline levels of the paragraphs in the same-level numbering interval are modified.

[0051] In a second aspect, the present application provides a document processing device, the device comprising:

[0052] A model recognition module is used to obtain a target document to be processed, and determine a model recognition result of a paragraph in the target document using a document element recognition model, wherein the model recognition result includes: an element type of the paragraph determined by the document element recognition model;

[0053] A recall processing module, used for performing a recall process of the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target;

[0054] A result determination module is used to determine the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, wherein the recall processing result includes: the element type of the paragraph determined by the recall processing.

[0055] In a possible implementation, the recall processing module is specifically used to:

[0056] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall interval corresponding to the recall target is located from the target document, and the element type of the paragraph in the recall interval is determined.

[0057] In a possible implementation, the recall processing module includes:

[0058] a positioning unit, configured to locate, from the target document, a paragraph that matches a recall rule corresponding to a set recall target as a candidate paragraph according to a model recognition result of the paragraph in the target document;

[0059] A discarding unit, configured to determine the location features of the candidate paragraphs in the target document, and determine the candidate paragraphs whose location features match the recall rule as target paragraphs;

[0060] The boundary recall unit is used to locate the recall interval corresponding to the recall target from the target document according to the target paragraph.

[0061] In a possible implementation manner, the boundary recall unit is specifically used to:

[0062] Determine the target paragraph as the starting paragraph of the recall target, and determine the ending paragraph of the recall target in the following of the starting paragraph;

[0063] The start paragraph, the end paragraph, and a paragraph between the start paragraph and the end paragraph are determined as a recall interval corresponding to the recall target.

[0064] In a possible implementation manner, the positioning unit is specifically used to:

[0065] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the non-directory title paragraph is located from the target document, and the non-directory title paragraph is determined as a candidate paragraph;

[0066] The boundary recall unit is specifically used for:

[0067] Obtain the numbering interval and / or outline interval of the paragraphs following the starting paragraph;

[0068] According to the numbering interval and / or outline interval, an end paragraph of the recall target is determined below the start paragraph.

[0069] In a possible implementation manner, the positioning unit is specifically used to:

[0070] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the unnumbered title paragraph is located from the target document, and the unnumbered title paragraph is determined as a candidate paragraph;

[0071] The boundary recall unit is specifically used for:

[0072] Determine the previous paragraph of the first body title paragraph below the start paragraph as the end paragraph of the recall target;

[0073] Alternatively, the previous paragraph of the first determined starting paragraph in the following of the starting paragraph is determined as the ending paragraph of the recall target.

[0074] In a possible implementation manner, the positioning unit is specifically used to:

[0075] According to the model recognition result of the paragraphs in the target document and the recall rule corresponding to the set recall target, the title paragraph containing the specified content and having the specified text structure is located from the target document to be determined as the candidate paragraph;

[0076] The boundary recall unit is specifically used for:

[0077] Determine the last paragraph following the start paragraph as the end paragraph of the recall target;

[0078] Alternatively, the previous paragraph of the first determined starting paragraph in the following of the starting paragraph is determined as the ending paragraph of the recall target;

[0079] Determine the parent directory of the sub-document area to which the start paragraph belongs, and find the first directory title located below the start paragraph from the parent directory; determine the previous paragraph of the found directory title in the target document as the end paragraph of the recall target.

[0080] In a possible implementation, the recall processing module includes:

[0081] A directory area recall unit, used to determine the directory text paragraph interval from the target document according to the model recognition result of the paragraph in the target document;

[0082] Starting from the first paragraph of the catalog body paragraph interval, traversing upwards paragraph by paragraph, if the traversed paragraph meets the set condition, continue traversing until the catalog title paragraph is traversed or the traversed paragraph does not meet the set condition, stop traversing, and determine the next paragraph of the currently traversed paragraph as the starting paragraph of the recall interval corresponding to the recall target; and / or,

[0083] Starting from the last paragraph of the table of contents body paragraph interval, traverse downwards paragraph by paragraph, and if the traversed paragraph meets the set conditions, continue traversing until the table of contents title paragraph is traversed or the traversed paragraph does not meet the set conditions, then stop traversing, and determine the previous paragraph of the currently traversed paragraph as the end paragraph of the recall interval corresponding to the recall target.

[0084] In a possible implementation, the recall processing module includes:

[0085] The specific element recall unit is used to locate the paragraphs containing specified content and / or having a specified text structure from the recall interval and determine them as target paragraphs belonging to the recall target based on the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall target.

[0086] In a possible implementation, the device further includes:

[0087] A discarding module, used for discarding the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target;

[0088] The result determination module is specifically used for:

[0089] The element type of the paragraph in the target document is determined according to the recall processing result and the discard processing result of the recall target and the model recognition result of the paragraph in the target document.

[0090] In a possible implementation, the device further includes:

[0091] A correction module, used for performing correction processing of the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target;

[0092] The result determination module is specifically used for:

[0093] The element type of the paragraph in the target document is determined according to the recall processing result and the correction processing result of the recall target and the model recognition result of the paragraph in the target document.

[0094] In a possible implementation manner, the correction module is specifically used to:

[0095] Locating the same-level numbering intervals from the target document according to the model recognition results of the paragraphs in the target document;

[0096] According to the numbers of the paragraphs in the same-level numbering interval, the outline levels of the paragraphs in the same-level numbering interval are modified.

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

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

[0099] 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 utilizing the document element recognition model to determine the model recognition result of the paragraph in the target document, performs recall processing of the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, determines the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, and provides a scheme for identifying the element type of the paragraph in the document by combining the recognition capability of the document element recognition model and the rule-based recall strategy. The scheme realizes the complementary advantages between the recognition capability of the document element recognition model and the rule-based recall strategy, and can recall the element types that the model cannot recognize or cannot accurately recognize from the target document, thereby improving the accuracy and completeness of document element type recognition. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

[0103] Figure 1 A schematic diagram of a system architecture involved in an embodiment of the present application;

[0104] Figure 2A flowchart of an embodiment of a document processing method provided in an embodiment of the present application;

[0105] Figure 3 A flowchart of an embodiment of the present application for locating a recall interval corresponding to a recall target from a target document based on a model recognition result of a paragraph in a target document and a recall rule corresponding to a set recall target;

[0106] Figure 4 Another embodiment of the present application provides a flowchart of an embodiment of locating a recall interval corresponding to a recall target from a target document based on a model recognition result of a paragraph in a target document and a recall rule corresponding to a set recall target;

[0107] Figure 5 A diagram comparing the effects of using soft and hard carriage returns for text content;

[0108] Figure 6 A diagram showing the attachment of separators to content and the correct segmentation structure;

[0109] Figure 7 This is a schematic diagram of the segmentation effect of a space character or a tab character;

[0110] Figure 8 This is a schematic diagram showing the effect of text content not being segmented correctly;

[0111] Fig. 9 A schematic diagram of using consecutive blank lines to achieve paging effect

[0112] Fig.10 A block diagram of an embodiment of a document processing device provided in an embodiment of the present application;

[0113] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

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

[0116] In order to solve the technical problem in the prior art that model recognition errors or missed recognition may exist, thereby causing erroneous recognition results of document element types relying on the model, the present application provides a document processing method, device, electronic device and storage medium, which can improve the accuracy and completeness of document element type recognition.

[0117] Figure 1 Schematic diagram of a system architecture involved in an embodiment of the present application. Figure 1 As shown, the system architecture 100 may include: a client 101, a server 102, a model 103, and a network 104. The network 104 is used to provide a communication link between the client 101, the server 102, and the model 103, and may include a wireless link, a wired link, or an optical fiber cable, etc., which is not limited in this application.

[0118] The client 101 may be a hardware device or software that supports network connection to provide document editing services and other network services. When the device is hardware, it may support various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, servers, etc. When the device is software, it may be installed in the electronic devices listed above.

[0119] The server 102 is the core processing unit of the entire system architecture 100, and can be deployed with a variety of algorithms and relatively powerful computing resources. Among them, the algorithm may involve multiple fields such as data processing, machine learning, and deep learning, and is used to process the data uploaded or the request sent by the client 101, and perform specific computing tasks, such as document content processing, document content analysis, etc. The computing resources may include high-performance computing clusters, GPU accelerator cards, etc., which are used to support the rapid execution and efficient processing of algorithms.

[0120] The model end 103 is a server or device deployed with one or more models, which are used to process specific computing tasks or provide specific services. For example, a document element recognition model, a natural language processing model, etc. are deployed on the model end 103. Among them, the document element recognition model is used to identify the element type (such as abstract, title, text, etc.) of the paragraph in the input document. When the server end 102 receives the request from the client 101 and needs to call the model, it forwards the request to the model end 103, and the model end 103 uses the deployed model to perform reasoning calculations and outputs the corresponding results. In addition, with the continuous advancement of algorithms and the continuous accumulation of data, the models deployed on the model end 103 can be updated or optimized regularly. Exemplarily, the model end 103 supports automatic updating and version control of the model to ensure that the model can always maintain the latest performance and accuracy. Exemplarily, the server end 102 is responsible for managing the model on the model end 103, including uploading, updating, deleting and version control of the model.

[0121] Understandably, Figure 1 The number of networks and devices in the system architecture 100 is only for illustration. According to actual needs, the system architecture 100 may include any number of networks and devices, which is not limited in the embodiment of the present application.

[0122] In some examples, at least two of the client 101, the server 102, and the model 103 may be the same device, and different terminals in the same device may also transmit data to each other via wireless or wired connections.

[0123] based on Figure 1 In the illustrated system architecture, in an exemplary application scenario, the client 101 sends a document automatic typesetting request to the server 102 and attaches the document to be typeset. The server 102 receives the request and document from the client 101, forwards the document to the model 103, and requests the model 103 to call the deployed document element recognition model to analyze and recognize the document. After receiving the document, the model 103 calls the deployed document element recognition model to analyze and recognize the document, determine the element type of the paragraph in the document, and then returns the recognition result to the server 102.

[0124] Furthermore, after receiving the model recognition result returned by the model end 103, the server end 102 can also use its own algorithms and computing resources to further analyze and verify the model recognition result returned by the model end 103. For example, the server end can check the accuracy of the model recognition result, or further adjust and optimize the model recognition result based on the document's typesetting style, paragraph format and other features. Finally, the server end 103 determines the element type of the paragraph in the document based on the model recognition result and the results of further analysis. Finally, the server end 103 automatically typesets the document according to the determined element type of the paragraph in the document, and returns the typeset document to the client end 101. Alternatively, the server end 103 sends the determined element type of the paragraph in the document to the client end 101, and the client end 101 automatically typesets the document according to the determined element type of the paragraph in the document to obtain the typeset document.

[0125] Through the above process, the server 102 and the model 103 work together. On the one hand, it can efficiently process the automatic typesetting request of the document. On the other hand, the server 102 can make up for the lack of capabilities of the model 103 in certain aspects, thereby improving the accuracy of the final element type recognition result, and further ensuring that the typesetting of the document meets specific standards or requirements.

[0126] It should be noted that the above division of the client 101, the server 102 and the model 103, as well as the functional division of the execution of each end, is only an example, and some functions can be executed by any end, and the embodiments of the present application do not limit this. For example, the above-mentioned typesetting function can be executed on the server 102, or on the client 101; for another example, filtering, streamlining and other operations on the document content can be performed on the server 102, or on the model 103, or partially on the server 102 and partially on the model 103. For the sake of simplicity and clarity, the embodiments of the present application only use some examples to illustrate the functional division of the execution of each end, but the embodiments of the present application do not limit this.

[0127] In the above exemplary application scenario, the reason why the server 102 further analyzes and verifies the model recognition result returned by the model end 103 by using its own algorithm and computing resources after receiving the model recognition result returned by the model end 103 is that: on the one hand, before sending the document to the model end for analysis and recognition, the server 102 usually performs some processing work on the document, such as eliminating useless or unhelpful information in the document for the model to identify the element type, so as to improve the recognition efficiency of the model and reduce its computational burden. For another example, the document (which may be the document after some information is eliminated) is fragmented, and the model recognition is performed on the fragment as a unit, aiming to find the best balance between recognition efficiency and recognition accuracy, and ensure that the document element recognition model can play the maximum performance under limited computing resources. Although such processing work is intended to improve the recognition efficiency of the model and reduce the model burden, it may also introduce some potential problems, such as the model missing recognition or recognition errors, because the model cannot obtain global information and there is an information gap with the server. On the other hand, the model cannot completely avoid the problem of limited recognition ability in the face of complex and ever-changing document structures and contents, such as failure to recognize certain specific information or inaccurate boundary demarcation of certain elements.

[0128] In view of this, an embodiment of the present application provides a document processing method, which aims to provide a method of utilizing the recognition results of the model on the server side, combined with a rule-based recall method, to recall and correct the elements that the model fails to accurately recognize, thereby improving the accuracy and completeness of document element type recognition.

[0129] Figure 2 The flowchart of an embodiment of a document processing method provided in the embodiment of the present application is shown in FIG. In one embodiment, the method is applied to a server, for example Figure 1 The server 102 shown in the example. Figure 2 As shown, the process includes the following steps:

[0130] Step 201: Obtain a target document to be processed, and use a document element recognition model to determine a model recognition result of a paragraph in the target document. The model recognition result includes: an element type of the paragraph determined by the document element recognition model.

[0131] In one embodiment, the target document refers to an original document, for example, a document that needs to be typeset and is attached when the client 101 sends a request for automatic typesetting of a document to the server 102 .

[0132] In one embodiment, the target document is not the original document, but a document obtained by preprocessing a copy of the original document. The key purpose of preprocessing the copy of the original document is to ensure that the content in the document can be correctly segmented, because correct segmentation is an important prerequisite for the subsequent model end to identify the element type of the paragraph in the document, and is also an important prerequisite for correctly typesetting the paragraph after the element type of the paragraph is determined.

[0133] Specifically, for the correct segmentation of the original document, the difficulty lies in that the original document is correctly segmented at the display level (visual level), but if the segmentation is performed based on the document data of the original document, it will lead to incorrect segmentation due to the different segmentation standards adopted. A simple example is that there are three strings in the document data of the original document, string 1, string 2, and string 3, among which string 1 and string 2 are separated by soft returns, and string 2 and string 3 are separated by hard returns. If, from the visual level, it can be clearly determined that string 1, string 2 and string 3 belong to different paragraphs. However, if the original document is segmented from the document data level using the segmentation standard of hard returns, the result of the segmentation is: string 1 and string 2 belong to one paragraph, and string 3 belongs to another paragraph, that is, a segmentation error occurs. In this application, segmentation is performed based on the document data of the original document. In order to obtain correct segmentation, it is necessary to pre-process the copy document of the original document according to the segmentation standard.

[0134] On this basis, the specific implementation of obtaining the target document to be processed includes: creating a copy document of the original document, preprocessing the copy document according to a set preprocessing method, obtaining a preprocessed document, and determining the preprocessed document as the target document to be processed. As for how to preprocess the copy document of the original document according to a set preprocessing method to obtain a preprocessed document, and determine the preprocessed document as the target document to be processed, it will be explained through specific embodiments below, and will not be described in detail here.

[0135] In one embodiment, the target document is a part of the original document or the above-mentioned preprocessed document, such as one or several pages thereof. The exemplary application scenario here may be: after the initial model recognition is performed on the original document or the preprocessed document, it is determined based on the initial model recognition result that the model recognition results of some paragraphs are abnormal, then the page where these paragraphs are located can be taken out separately and the method provided in the embodiment of the present application can be applied for target recall processing to ensure that the element type of these paragraphs can be accurately identified.

[0136] The document element recognition model is a model used to identify the element types of paragraphs in a document. Figure 1In the system architecture shown, the document element recognition model is deployed on the model end 103. Exemplarily, the document element recognition model is a deep learning model or a neural network model. The element type of a paragraph includes information such as the sub-document to which the paragraph belongs, the interval to which the paragraph belongs, the name of the paragraph (such as the body paragraph, the directory title paragraph), and the level of the paragraph.

[0137] In step 201, the server uploads the original document or the processed document to the model side, so that the model side calls the document element recognition model to recognize the element type of the paragraph. The recognition result here is recognized by the document element recognition model, so it is called the model recognition result.

[0138] Step 202: Perform recall processing on the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target.

[0139] Recall targets refer to objects that need to be recalled by the server. In actual applications, these objects may not be accurately identified due to the limitations of the model. Recall targets can be specific document areas, such as embedded sub-document areas, chapter preamble areas, appendix areas, directory areas, etc. At the same time, recall targets can also include specific types of elements, such as the "main recipient" in official documents, "keywords" and "conclusion" in papers, etc.

[0140] Recall rules are rules formulated according to the specific needs of recall target identification. These rules may be formulated based on the structural characteristics of the recall target (such as paragraph position, format, etc.), content characteristics (such as keywords, specific sentence patterns, etc.) or comprehensive consideration of contextual information.

[0141] Recall processing of recall targets in the target document means: combining the model recognition results of the paragraphs in the target document, applying the recall rules corresponding to the recall targets, and recalling the recall targets that the document element recognition model fails to accurately identify. This may involve reclassifying the misclassified recall targets to the correct element type, or identifying the recall targets that were missed by the document element recognition model and classifying them into the correct element type recognition results.

[0142] Generally, different recall targets correspond to different recall rules. Therefore, for different recall targets, the specific recall processing procedures are also different. We will not go into details here. We will discuss the specific recall processing procedures for different recall targets in the following text.

[0143] Step 203: Determine the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, wherein the recall processing result includes: the element type of the paragraph determined by the recall processing.

[0144] It can be seen from the description of step 203 that, by applying the technical solution provided in the embodiment of the present application, the element type of the paragraph determined in the recall processing result is combined with the model recognition result to form the final element type recognition result of the paragraph in the target document.

[0145] In one embodiment, for paragraphs that are set as recall targets and obtain accurate element types through recall processing, the results of the recall processing are adopted as the final element types of these paragraphs. For paragraphs that are not set as recall targets, or are set as recall targets but fail to provide clear element types through recall processing, the final element types of these paragraphs are determined based on the model recognition results.

[0146] The technical solution provided by the embodiment of the present application determines the model recognition result of the paragraph in the target document by utilizing the document element recognition model, performs recall processing of the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, and determines the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document. A solution is provided for identifying the element type of the paragraph in the document by combining the recognition capability of the document element recognition model and the rule-based recall strategy. The solution realizes the complementary advantages between the recognition capability of the document element recognition model and the rule-based recall strategy, and can recall the element types that the model cannot recognize or cannot accurately recognize from the target document, thereby improving the accuracy and completeness of document element type recognition.

[0147] The recall target can be a specific document area, such as an embedded sub-document area, a pre-chapter area, an appendix area, etc. For these document areas, the core task of the recall process is to accurately define the boundary range of these document areas. In this regard, in one embodiment, according to the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall targets, the specific implementation of the recall process of the recall target in the target document includes: according to the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall targets, the recall interval corresponding to the recall target is located from the target document, and the element type of the paragraph in the recall interval is determined. Among them, the recall interval is the interval range of the recall target in the target document determined by the recall process. The paragraphs in the recall interval may not be limited to the paragraphs that have been identified in the model recognition results, and may actually contain some paragraphs that the model has not accurately identified, or contain paragraphs with errors in the model recognition. In the technical solution of the embodiment of the present application, for the paragraphs in the recall interval, the element types of these paragraphs are determined based on the results of the recall process.

[0148] See also Figure 3, is a flowchart of an embodiment of the present application for locating a recall interval corresponding to a recall target from a target document based on a model recognition result of a paragraph in a target document and a recall rule corresponding to a set recall target. Figure 3 As shown, the following steps are included:

[0149] Step 301: Based on the model recognition results of the paragraphs in the target document, locate the paragraphs that match the recall rules corresponding to the set recall target from the target document as candidate paragraphs.

[0150] Step 302: Determine the location features of the candidate paragraphs in the target document, and determine the candidate paragraphs whose location features match the recall rule as the target paragraphs.

[0151] Step 303: locate the recall interval corresponding to the recall target from the target document according to the target paragraph.

[0152] For ease of understanding, steps 301 to 303 are described in a unified manner as follows:

[0153] It can be seen from the description of step 301 to step 303 that, in one embodiment, the entire process of locating the recall interval corresponding to the recall target from the target document can be divided into the following three stages:

[0154] Phase 1: Preliminary positioning of recall targets.

[0155] The first stage corresponds to step 301 above. The core task of this stage is to compare the model recognition results of the paragraphs in the target document with the set recall rules corresponding to the recall target, so as to preliminarily screen out the paragraphs that may contain the key information or features required by the recall target. These paragraphs are regarded as "candidate paragraphs" in the subsequent processing flow.

[0156] Stage 2: Abandonment of the initially identified recall targets.

[0157] The second stage corresponds to step 302 above. The core task of this stage is to combine the specific location features of the recall target and the location features of the candidate paragraphs in the target document, and discard those paragraphs that contain the key information or features required by the recall target but whose positions or contextual relationships in the document are unreasonable. The retained "candidate paragraphs" are regarded as "target paragraphs" in the subsequent processing flow. It can be seen that through the screening in the second stage, a more accurate "target paragraph" that meets the requirements of the recall target can be obtained.

[0158] Phase 3: Final determination of the recall interval.

[0159] The third stage corresponds to the above step 303. The core task of this stage is to accurately define the specific scope of the recall target in the target document according to the target paragraph, that is, the recall interval corresponding to the recall target.

[0160] In this embodiment, the divided steps and stages are only one implementation method. Some steps can be executed simultaneously, and some stages can also be implemented simultaneously. For example, the first stage and the second stage can be implemented simultaneously. For example, while comparing the model recognition results and the recall rules in the first stage, the judgment of the location features in the second stage is discarded. Therefore, the division of the above steps and stages is not restricted in this embodiment.

[0161] In one embodiment, the specific implementation of locating the recall interval corresponding to the recall target from the target document according to the target paragraph includes: determining the target paragraph as the starting paragraph of the recall target, and determining the ending paragraph of the recall target in the context of the starting paragraph; determining the starting paragraph, the ending paragraph, and the paragraph between the starting paragraph and the ending paragraph as the recall interval corresponding to the recall target.

[0162] The following is combined with specific recall goals Figure 3 The three stages included in the process shown are explained by way of example.

[0163] (1) The recall target is the embedded sub-document area.

[0164] In the case of an embedded sub-document in the target document, the embedded sub-document, as an embedded part of the target document, may be a complete document or a part of a complete document, and belongs to the main text of the target document. However, when using the document element recognition model to identify the element type of the target document, the embedded sub-document often has specific structural, format or content characteristics. For example, the embedded sub-document also has its own title. These characteristics distinguish the embedded sub-document from the ordinary main text paragraph, and will also be recognized by the document element recognition model as an element type of non-main text paragraph, such as chapter title, file title, document description title, file description title, document subtitle, file subtitle, table title, picture title, etc. However, these identified non-main text paragraph element types have directory titles, which will be written into the directory tree of the target document, which results in the directory tree of the target document actually embedding the directory tree of the embedded sub-document, resulting in confusion in the numbering or level of the directory tree. Therefore, in some scenarios, it is necessary to accurately define the embedded sub-document area in the target document. After defining the embedded sub-document area in the target document, a directory belonging to the embedded sub-document area may be created, and automatic typesetting or other processing may be performed.

[0165] according to Figure 3The process shown first performs the task of the first stage, that is, based on the model recognition results of the paragraphs in the target document, the paragraphs that match the recall rules corresponding to the embedded sub-document area are located from the target document as candidate paragraphs.

[0166] An embedded subdocument usually has an independent document title. "Independent" here means that the title in the embedded subdocument is self-contained and is not directly related to the title system of the document to which the embedded subdocument belongs (such as the target document or other subdocuments). It can be different from other titles in the target document and is not subject to the numbering continuity rules in the target document. Therefore, based on the independent document title, the specific position of the embedded subdocument area in the target document can be located. There are two cases to discuss here:

[0167] One situation is that, generally, the embedded sub-document in the target document may be a paragraph starting with the document title of the embedded sub-document. However, the document title of the embedded sub-document is usually not recognized as a directory title by the document element recognition model, but is more often recognized as a document title (the document title here may include at least one of the following: file title, document description title, file description title, document subtitle, file subtitle, etc.). Then, the boundary of the embedded sub-document area in the target document can be further located based on the document title recognized by the document element recognition model. In other words, when locating the embedded sub-document area from the target document, the non-directory title paragraph can be located from the target document as a candidate paragraph based on the model recognition result of the paragraph in the target document and the set recall target corresponding amount recall rule. The non-directory title paragraph here refers to: it is essentially a title paragraph, but it has not entered the directory (a directory constructed based on the model recognition structure of the document element recognition model), and the title that enters the directory is the directory title.

[0168] If the document element recognition model cannot identify the document title or document description title in the target document, it can also be recalled through other recall rules. For example, non-table of contents title paragraphs can be located as candidate paragraphs from the target document (including the part of the target document that is identified as the main text by the document element recognition model) based on the number of words in the paragraph, paragraph format attributes (such as font, font size, indentation attributes, etc.), and contextual structural relationships. For example, a short centered paragraph will be determined as a candidate paragraph. For another example, if the text of a paragraph contains a new complete number interval and a table of contents outline interval, then the paragraph can be determined as a candidate paragraph. The candidate paragraph located here may be the document title of an embedded sub-document.

[0169] Another case is that the embedded sub-document in the target document is a table, a picture, or a part of a document. Then, the embedded sub-document in the target document may be a table title, an icon title, or a chapter title as the starting paragraph. For such embedded sub-documents, the starting paragraph can be identified by identifying the title type and analyzing the continuity of the title number in combination with context information. Specifically, first identify the table title, picture title, or chapter title in the target document. These titles often have specific formats or marks, such as bold, centered, specific prefixes and suffixes, etc. Then analyze the continuity of the located title in combination with the context. For example, a table title is "Table 2", but "Table 1" appears in its upper text, and "Table 3" appears in its lower text. Then "Table 2" is likely to be the title in the target document, not the beginning of a new embedded sub-document. For another example, a table title is "Table 1", and there is a "Table 1" in its upper text. Then the current table title "Table 1" is likely to be the beginning of a new embedded sub-document, that is, the starting paragraph of the embedded sub-document.

[0170] Furthermore, the task of the second stage is performed, that is, determining the location features of the candidate paragraphs in the target document, and determining the candidate paragraphs whose location features match the recall rules as the target paragraphs.

[0171] The embedded sub-document area usually appears in the main text area or the appendix area, and it is impossible to appear in the pre-chapter area. Therefore, for the candidate paragraphs located above, the candidate paragraphs are screened and discarded according to the location characteristics of the candidate paragraphs in the target document. For example, the candidate paragraphs located in the pre-chapter area are discarded, and the candidate paragraphs located in the main text area or the appendix area are retained, and then the retained candidate paragraphs are determined as the target paragraph. The target paragraph is very likely to be the document title of the embedded sub-document.

[0172] Among them, the pre-chapter area, the main text area or the appendix area can be the model recognition result, or it can be the area recalled by the recall rules. The specific recall rules will not be described in detail here. The specific recall processing process will be discussed below for the main text area or the appendix area.

[0173] Finally, the task of the third stage is performed, that is, locating the recall interval corresponding to the recall target from the target document according to the target paragraph.

[0174] Since the target paragraph is most likely the document title of an embedded sub-document, the target paragraph is determined as the starting paragraph of the embedded sub-document area in the target document, and the ending paragraph of the embedded sub-document area in the target document is determined in the context of the starting paragraph; the starting paragraph, the ending paragraph, and the paragraph between the starting paragraph and the ending paragraph are determined as the recall interval corresponding to the embedded sub-document area.

[0175] In one embodiment, a specific implementation of determining the ending paragraph of the embedded sub-document area in the target document in the text of the starting paragraph includes: obtaining the numbering interval and / or outline interval of the paragraphs in the text of the starting paragraph; and determining the ending paragraph of the embedded sub-document area in the text of the starting paragraph according to the numbering interval and / or outline interval.

[0176] The numbering interval refers to a continuous numbering sequence consisting of the same numbering type and numbering style. In this sequence, the numbers increase from the starting value (or show an increasing trend, allowing repeated numbers or default numbers), for example, from number "1" to number "10". In other words, the numbers in the same numbering interval have coherence and consistency in type and style.

[0177] Outline levels reflect the hierarchical relationship between paragraphs and help understand the structure of the document.

[0178] The specific implementation of determining the ending paragraph of the embedded sub-document area in the target document in the context of the starting paragraph includes: obtaining the numbering interval and / or outline interval of the paragraphs in the context of the starting paragraph, and checking the numbering and outline level of each paragraph after the starting paragraph one by one according to the numbering interval and / or outline interval, identifying and tracking the continuity of the numbering intervals of the same outline level in the main document or the embedded sub-document, so as to determine the ending paragraph of the embedded sub-document area.

[0179] Take the following main document with an embedded sub-document titled "Indicator Description of XXXX Company" as an example for explanation:

[0180] 1. First level title: Project Overview

[0181] 1.1 Secondary Title: Project Background

[0182] 1.1.1 Paragraph content: Introduce specific information about the project background.

[0183] 1.2 Secondary heading: Project objectives

[0184] 1.2.1 Paragraph content: Describe the goals of the project.

[0185] 1.2.2 Paragraph content: Detailed description of specific indicators of project goals.

[0186] XX Company Index Description (Document Title)

[0187] 1. First level title: Indicator description

[0188] 1.1 Secondary heading: Indicator 1

[0189] 1.1.1 Paragraph content: Introduction to indicator 1.

[0190] 1.1.2 Paragraph content: Further elaborate on the usage, advantages and disadvantages of indicator 1.

[0191] 1.2 Secondary title: Indicator 2

[0192] 1.2.1 Paragraph content: Introduce indicator 2.

[0193] 1.2.2 Paragraph content: Further explain the usage, advantages and disadvantages of indicator 2.

[0194] 1.2.3 Paragraph content: Detailed description of specific indicators of project goals.

[0195] 2. First level title: Practical application of indicators

[0196] 2.1 Secondary Title: Application Example 1

[0197] 2.1.1 Paragraph content: Task description of Example 1.

[0198] 2.1.2 Paragraph content: Explanation of the use of indicator 1 in example 1.

[0199] 2.2 Secondary Title: Application Example 2

[0200] 2.2.1 Paragraph content: Task description of Example 2.

[0201] 2.2.2 Paragraph content: Explanation of the use of indicator 2 in example 1.

[0202] 2. First level title: Project implementation plan

[0203] 2.1 Secondary Title: Phase 1

[0204] 2.1.1 Paragraph content: Task description for Phase 1.

[0205] 2.1.2 Paragraph content: Time schedule for Phase 1.

[0206] 2.2 Secondary Title: Phase 2

[0207] 2.2.1 Paragraph content: Task description for Phase 2.

[0208] 2.2.2 Paragraph content: Time schedule for Phase 2.

[0209] In the above example, the numbering interval is: starting from "1", presented in the form of "1.1", "1.1.1", etc., which is a continuous numbering sequence, and the numbering type is in the form of a number plus a decimal point. The outline interval is: "1" is the first-level title, "1.1" is the second-level title, and "1.1.1" is the third-level title, reflecting the hierarchical relationship.

[0210] Assume that the file title "Indicator Description of a Certain Company" has been determined as the starting paragraph of the embedded sub-document area based on the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall target.

[0211] Get the number interval and outline interval of the paragraphs under the file title "Indicator Description of XXXX Company". First, we can determine that the file title "Indicator Description of XXXX Company" is under the main document title "1.2.2 Paragraph Content: Detailed Description of Specific Indicators of Project Goals.", which means that the embedded sub-document belongs to the main document title.

[0212] According to the numbering interval and / or outline interval, after the starting paragraph, the numbering and outline level of each paragraph are checked one by one, and the continuity of the numbering intervals of the same outline level in the main document or embedded sub-documents is identified and tracked.

[0213] Specifically, when traversing to the title "1. First-level title: Indicator Description", it is determined that the title is not continuous in numbering interval with the title of the same outline level in the main document (Title: First-level title: Project Overview), which means that the title "1. First-level title: Indicator Description" is the title of the embedded sub-document. At this point, the boundary of the embedded sub-document is: the file title "Indicator Description of a certain company" is the starting paragraph, and the title "1. First-level title: Indicator Description" is the ending paragraph.

[0214] For the same reason, continue to traverse to the title "1.2.2 Paragraph content: further elaborate on the use and advantages and disadvantages of indicator 2." Determine that this title is not continuous with the title of the same outline level in the main document (Title: 1.2.2 Paragraph content: detail the specific indicators of project goals.) in the numbering interval, which means that the title "1.2.2 Paragraph content: further elaborate on the use and advantages and disadvantages of indicator 2." is the title of the embedded sub-document. So far, the boundary of the embedded sub-document is: the file title "Indicator Description of a certain company" is the starting paragraph, and the title "1.2.2 Paragraph content: further elaborate on the use and advantages and disadvantages of indicator 2." is the ending paragraph.

[0215] Continue to traverse the title "1.2.3 Paragraph content: Detailed description of specific indicators of project goals." It is continuous in numbering interval with the title of the same outline level in the main document (Title: 1.2.2 Paragraph content: Detailed description of specific indicators of project goals.). Similarly, it is continuous in numbering interval with the title of the same outline level in the embedded sub-document (1.2.2 Paragraph content: Further elaboration of the usage and advantages and disadvantages of indicator 2.). It is determined that the title "1.2.3 Paragraph content: Detailed description of specific indicators of project goals." may belong to the embedded sub-document or the main document. So far, the boundary of the embedded sub-document can be determined as follows: the file title "Indicator Description of XXXX Company" is the beginning paragraph, and the title "1.2.2 Paragraph content: Further elaboration of the usage and advantages and disadvantages of indicator 2." is the ending paragraph. The title "1.2.3 Paragraph content: Detailed description of specific indicators of project goals." may be an embedded sub-document or may belong to the main document, and is marked as a questionable interval.

[0216] For the same reason, we continue to traverse to the title "2. First-level title: Practical application of indicators". At this point, we can determine the boundary of the embedded sub-document: the file title "Indicator Description of XXXX Company" is the beginning paragraph, and the title "1.2.2 Paragraph Content: Further explain the use and advantages and disadvantages of indicator 2." is the end paragraph. The titles "1.2.3 Paragraph Content: Detailed description of specific indicators of project goals." to "2. First-level title: Practical application of indicators" may be embedded sub-documents or may belong to the main document, and are marked as questionable intervals.

[0217] Continue to traverse to the title "2.1 Secondary Title: Application Example 1". Although it is not continuous with the title in the determined main document in the numbering interval, it is continuous in the numbering interval in the combination of the determined embedded sub-document interval and the questionable interval. If the questionable interval is the main document interval, then the title belongs to the main document interval; if the questionable interval belongs to the embedded sub-document interval, then the title belongs to the embedded sub-document interval. Therefore, continue to classify the title as a questionable interval. So far, the boundary of the embedded sub-document is determined as follows: the file title "Indicator Description of a Certain Company" is the beginning paragraph, and the title "1.2.2 Paragraph Content: Further elaborate on the usage and advantages and disadvantages of indicator 2." is the ending paragraph. The titles "1.2.3 Paragraph Content: Detailed description of the specific indicators of the project goals." to "2.1 Secondary Title: Application Example 1" may be an embedded sub-document, or may belong to the main document, and are marked as questionable intervals.

[0218] Based on the same reason, continue to traverse to the title "2.2.2 Paragraph content: Instructions for the use of indicator 2 in Example 1." Although this title is not continuous with the title in the determined main document in the numbering interval, it is continuous in the numbering interval in the combination of the determined embedded sub-document interval and the questionable interval. Therefore, continue to classify this title as a questionable interval. So far, the boundary of the embedded sub-document is determined as follows: the file title "Indicator Description of a certain company" is the beginning paragraph, and the title "1.2.2 Paragraph content: Further explain the usage and advantages and disadvantages of indicator 2." is the ending paragraph. The titles "1.2.3 Paragraph content: Detailed description of specific indicators of project goals." to "2.2.2 Paragraph content: Instructions for the use of indicator 2 in Example 1." may be an embedded sub-document or may belong to the main document and are marked as questionable intervals.

[0219] Continue traversing to the title "2. First-level title: Project Implementation Plan", which is continuous with the main document interval in the numbering interval, but is not continuous in the numbering interval in the combination of the determined embedded sub-document interval and the questionable interval. Then, it can be determined that the title "2. First-level title: Project Implementation Plan" is the title of the main document, and the questionable interval in the above steps belongs to the embedded sub-document interval. So far, the boundary of the embedded sub-document is determined as follows: the file title "Indicator Description of a Certain Company" is the beginning paragraph, the title "2. First-level title: Project Implementation Plan" is the ending paragraph, and the title "2. First-level title: Project Implementation Plan" does not belong to the title of the embedded sub-document.

[0220] Through the above embodiments, the range of the embedded sub-document area can be accurately determined in the target document, thereby ensuring the integrity of the document and the clarity of its structure.

[0221] (2) The recall target is the pre-chapter area

[0222] The pre-chapter area usually refers to the area before a chapter or before the main text, such as the abstract, introduction, table of contents, foreword, etc., which is used to provide readers with an overview of the subsequent content, background information or navigation instructions. In actual applications, a chapter may include multiple pre-chapter areas, such as an introduction, abstract, and table of contents before the main text section. When typesetting, these pre-chapter areas should be paged independently to ensure the clarity of the document structure. However, in actual applications, the document element recognition model may not be accurate enough in defining the pre-chapter area. The model may mistakenly merge two pre-chapter areas that should be separated into one, or mistakenly split a complete pre-chapter area into two. Therefore, in some scenarios, it involves accurately defining each pre-chapter area.

[0223] according to Figure 3The process shown first performs the task of the first stage, that is, based on the model recognition results of the paragraphs in the target document, the paragraphs that match the recall rules corresponding to the pre-chapter area are located from the target document as candidate paragraphs.

[0224] The pre-chapter area usually has independent titles, and these titles are not numbered. Therefore, when locating the pre-chapter area from the target document, you can first locate the unnumbered title paragraphs from the target document based on the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall target, and determine the unnumbered title paragraphs as candidate paragraphs. The candidate paragraph located here may be the title of the pre-chapter area.

[0225] Furthermore, the task of the second stage is performed, that is, determining the location features of the candidate paragraphs in the target document, and determining the candidate paragraphs whose location features match the recall rules as the target paragraphs.

[0226] The pre-chapter area usually appears between the cover and the main text area, and cannot appear in other areas. Therefore, for the candidate paragraphs located above, the candidate paragraphs are screened and discarded according to their location characteristics in the target document. For example, the candidate paragraphs located between the cover and the main text area are retained, and other candidate paragraphs are discarded, and then the retained candidate paragraphs are determined as the target paragraph. The target paragraph is very likely to be the title of the pre-chapter area.

[0227] Finally, the task of the third stage is performed, that is, locating the recall interval corresponding to the recall target from the target document according to the target paragraph.

[0228] Since the target paragraph is most likely the title of the pre-chapter area, the target paragraph is determined as the starting paragraph of the pre-chapter area in the target document. At the same time, multiple pre-chapter areas within a sub-document are usually continuous and uninterrupted. Therefore, once the starting paragraph of the pre-chapter area in the target document is determined, the ending paragraph of the previous pre-chapter area in the target document can also be determined accordingly.

[0229] Accordingly, in one embodiment, the specific implementation of determining the ending paragraph of the pre-chapter area in the target document in the text of the starting paragraph includes: determining the previous paragraph of the first text title paragraph in the text of the starting paragraph as the ending paragraph of the recall target; or, determining the previous paragraph of the first determined starting paragraph in the text of the starting paragraph as the ending paragraph of the recall target.

[0230] Through the above embodiments, the interval range of the pre-chapter area in the target document can be accurately determined, thereby ensuring the integrity of the document and the clarity of its structure.

[0231] (3) Appendix area

[0232] The appendix area is a specific part of a document or book that is used to provide supplementary, explanatory or additional information to the main text. However, in actual applications, due to the diversity and complexity of document content, the document element recognition model may not be accurate enough in defining the appendix area. For example, if the table of contents area is directly followed by an appendix title, then the title should be part of the table of contents, and the document element recognition model may mistakenly identify it as the appendix area. For another example, if an appendix title is inserted between the main text and the signature, this title may actually only serve as explanatory text for the appendix, and the document element recognition model may mistakenly identify it as the appendix area. For another example, when multiple appendix title paragraphs appear consecutively in the main text, these paragraphs may only constitute the explanatory content of the appendix, and the document element recognition model may mistakenly identify them as the appendix area. Therefore, in some scenarios, it is necessary to accurately define the appendix area.

[0233] according to Figure 3 The process shown first performs the task of the first stage, that is, based on the model recognition results of the paragraphs in the target document, the paragraphs that match the recall rules corresponding to the appendix area are located from the target document as candidate paragraphs.

[0234] In practical applications, the appendix presents two main forms. One is the appendix description, which is presented as a continuous paragraph interval, and its structure is similar to the directory, such as "Appendix attachment: 1, 2, 3...", which is used to indicate how many appendices there are after the main text and the corresponding appendix description. The other is an appendix containing specific content. This kind of appendix is ​​followed by one or more independent document intervals after the appendix title, and each document interval has its own document title and document body. Although these two types of appendices differ in content and presentation, they do have a common feature, that is, the number of characters in the appendix title is limited, and usually contains "Appendix" and ":". Therefore, when locating the appendix area from the target document, firstly, according to the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall target, the title paragraph containing the specified content and having the specified text structure is located from the target document to determine as a candidate paragraph. The candidate paragraph located here may be the appendix title of the appendix area. Among them, the specified content is a word with a clear identification, such as "appendix", and the specified text structure is a requirement for the paragraph format and typesetting. For example, the specified text structure refers to the combination of the keyword "appendix" followed by a colon.

[0235] Furthermore, the task of the second stage is performed, that is, determining the location features of the candidate paragraphs in the target document, and determining the candidate paragraphs whose location features match the recall rules as the target paragraphs.

[0236] The appendix area usually appears after the main text area is completely finished. Therefore, for the candidate paragraphs located above, the candidate paragraphs are screened and discarded according to their location characteristics in the target document. For example, the candidate paragraphs located after the main text area are retained, and other candidate paragraphs are discarded, and then the retained candidate paragraphs are determined as the target paragraph. The target paragraph is most likely the appendix title in the appendix area.

[0237] Finally, the task of the third stage is performed, that is, locating the recall interval corresponding to the recall target from the target document according to the target paragraph.

[0238] Since the target paragraph is very likely to be the appendix title in the appendix area, the target paragraph is determined as the starting paragraph of the appendix area in the target document, and the ending paragraph of the appendix area in the target document is determined in the context of the starting paragraph; the starting paragraph, the ending paragraph, and the paragraph between the starting paragraph and the ending paragraph are determined as the recall interval corresponding to the appendix area.

[0239] In one embodiment, the specific implementation of determining the ending paragraph of the embedded sub-document area in the target document in the following of the starting paragraph includes: determining the last paragraph in the following of the starting paragraph as the ending paragraph of the appendix area. This situation is applicable to the case where there is only one appendix area after the main text area.

[0240] In another embodiment, the specific implementation of determining the ending paragraph of the appendix area in the following of the starting paragraph includes: determining the previous paragraph of the first determined starting paragraph in the following of the starting paragraph as the ending paragraph of the recall target. This situation is applicable to the situation where there are multiple continuous appendix areas after the main text area.

[0241] In addition, for an embedded subdocument, the embedded subdocument may also have an independent appendix area. In one embodiment, the appendix area in the embedded subdocument is determined in the following manner: determine the parent directory of the subdocument area to which the starting paragraph belongs, find the first directory title that is located in the text of the starting paragraph from the parent directory; and determine the previous paragraph of the found directory title in the target document as the ending paragraph of the appendix area. The parent directory of the subdocument area to which the starting paragraph belongs refers to a set of directory titles that are one level higher than the outline level of the subdocument area to which the starting paragraph belongs. Among them, the parent directory of the subdocument area to which the starting paragraph belongs refers to a set of directory titles that are one level higher than the outline level of the subdocument area where the starting paragraph is located.

[0242] Through the above embodiments, the interval range of the appendix area in the target document can be accurately determined, thereby ensuring the integrity of the document and the clarity of its structure.

[0243] The above is combined with specific recall targets. Figure 3The three stages included in the process shown are explained by way of example.

[0244] Figure 3 The process shown, by locating the paragraphs matching the recall rules corresponding to the set recall target from the target document as candidate paragraphs based on the model recognition results of the paragraphs in the target document, determining the location features of the candidate paragraphs in the target document, determining the candidate paragraphs whose location features match the recall rules as target paragraphs, locating the recall interval corresponding to the recall target from the target document based on the target paragraphs, and realizing the effective recall of specific recall targets in the target document.

[0245] Recall targets can also be specific types of elements, which are also crucial to the understanding and classification of documents. Specific types of elements can be specific titles, such as table of contents, abstract, references, preface, authorization, conclusion, etc. Specific types of elements can also be elements that indicate specific information. For example, in official documents, "primary recipients" refer to the main recipients of the official document, which is important for determining the scope and purpose of the official document; in papers, "keywords" are short words that summarize the theme and content of the paper, which helps readers quickly understand the research direction of the paper; "conclusion" is a summary or outlook on the content of the paper or report, marking the end of the document.

[0246] For specific types of elements, the core task of recall processing is to accurately and efficiently locate and extract the specific positions and contents of these elements in the document. In one embodiment, for specific types of elements, based on the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall targets, the specific implementation of recall processing of the recall target in the target document includes: based on the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall targets, locating the paragraphs containing the specified content and / or having the specified text structure from the recall interval and determining them as the target paragraphs belonging to the recall target.

[0247] The designated content and designated text structure are set according to the specific requirements of the recall target. The designated content is the designated text content, which is the specific text information corresponding to the recall target. For example, for the "main recipient", the designated content may include a specific institution name or position name; for the "abstract", the designated content may include the two words "abstract"; for the "keywords", the designated content may include the three words "keywords" or the three words "keywords".

[0248] Specifying the text structure means specifying how the information within a document is organized and arranged. The text structure not only involves the overall layout of the document, such as chapter division and paragraph arrangement, but also goes deep into the format and layout within the paragraph. Paragraph format includes elements such as font, font size, line spacing, indentation, and alignment. These elements work together on the paragraph to give it a specific visual effect. For example, for "keywords", its specified text structure may be a short list of words separated by commas. For another example, for a specific title, its specified text structure may be a specific word limit and specific format requirements, such as specific font, font size, bold, indentation, etc.

[0249] In specific implementation, according to the recall rule corresponding to the set recall target, the recall target is searched and matched (such as fuzzy matching) in the target document. During the search process, the recall mechanism provided by the embodiment of the present application combines the model recognition result and the recall rule of the paragraph to locate the paragraph containing the specified content and / or having the specified text structure from the recall interval (which may be the entire document or a specific area in the document). These paragraphs are determined to be the target paragraphs belonging to the recall target.

[0250] In practical applications, the embodiments of the present application further provide a recall target abandonment processing mechanism. The recall target abandonment processing mechanism is intended to abandon, i.e., remove, the recall targets that do not meet the conditions in the target document based on the model recognition results of each paragraph in the target document and in combination with the recall rules set for the recall targets.

[0251] Specifically, in one embodiment, according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall target is discarded in the target document. Correspondingly, according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, the specific implementation of determining the element type of the paragraph in the target document includes: determining the element type of the paragraph in the target document according to the recall processing result of the recall target, the discard processing result and the model recognition result of the paragraph in the target document.

[0252] Among them, according to the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall targets, the abandonment of the recall targets in the target document means: for the recall targets identified by the document element recognition model, these recall targets are compared with the preset recall rules. If a recall target does not match the set recall rules, it means that the recall target does not meet the preset standards or conditions, and the model's recognition result for the recall target is likely to be wrong. In this case, the recall target is abandoned.

[0253] Accordingly, the specific implementation of determining the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document includes: determining the element type of the paragraph in the target document according to the recall processing result of the recall target, the discard processing result and the model recognition result of the paragraph in the target document. In other words, the element type of the paragraph determined in the recall processing result, the discard processing result and the model recognition result are combined to form the final element type recognition result of the paragraph in the target document.

[0254] In one embodiment, for paragraphs that are set as recall targets and obtain accurate element types through recall processing, the results of the recall processing are adopted as the final element types of these paragraphs. For paragraphs that are not set as recall targets, or are set as recall targets but fail to provide clear element types through recall processing, the final element types of these paragraphs are comprehensively determined based on the model recognition results and the discard processing results. Exemplarily, if the discard processing result of a certain recall target shows that the model's recognition of the recall target is incorrect, then the model's recognition result of the recall target is discarded; conversely, if the discard processing result of a certain recall target shows that the model's recognition of the recall target is correct, then the final element type of the recall target is determined based on the model recognition result.

[0255] For example, when the recall target is the catalog title, if the catalog title contains punctuation marks and its word count exceeds the preset limit, you can choose to discard the catalog title to keep the catalog neat and consistent. In addition, if the catalog title with bullet points or the catalog title without numbers interrupts the originally orderly numbered catalog interval and its outline level is abnormal, then these catalog titles can also be discarded to ensure the rationality and readability of the catalog structure.

[0256] The above embodiment can ensure that only those targets that truly meet the requirements are retained through the discard processing mechanism, thereby improving the accuracy and efficiency of document processing, and at the same time being able to cope with various complex situations that may arise in the document, ensuring the robustness and reliability of document processing.

[0257] In practical applications, the embodiments of the present application further provide a correction processing mechanism for the recall target, especially for the correction of the paragraph outline, which aims to correct the paragraph outline by comprehensively considering the model recognition results of the paragraphs in the target document and the set recall rules.

[0258] In one embodiment, according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the correction processing of the recall target is performed in the target document. Accordingly, according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, the element type of the paragraph in the target document is determined, including: according to the recall processing result of the recall target, the correction processing result and the model recognition result of the paragraph in the target document, the element type of the paragraph in the target document is determined.

[0259] Among them, according to the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall targets, the specific implementation of the correction processing of the recall target in the target document includes: according to the model recognition results of the paragraphs in the target document, locating the same level numbering interval from the target document; according to the numbers of the paragraphs in the same level numbering interval, correcting the outline level of the paragraphs in the same level numbering interval.

[0260] The same-level numbering interval refers to the interval composed of paragraphs with the same numbering level. Within the same-level numbering interval, the numbering of all paragraphs should follow the same outline level, numbering type and numbering style. Accordingly, if the outline level of a paragraph is inconsistent with the outline level of other paragraphs in the same-level numbering interval, it will be corrected to the same outline level as other paragraphs.

[0261] For example, the same-level numbering interval includes numbers "one", "two" and "three". Assume that the document element recognition model considers numbers "two" and "three" to be title one (one outline level), and determines number "one" to be title two (one outline level). Then it is obvious that the outline level recognition of number "one" is wrong here, and the outline level of number "one" should be corrected to the same outline level as numbers "two" and "three".

[0262] In actual applications, there is another situation: the numbers in the same-level numbering interval are not continuous. For example, the numbering interval of the same level includes numbers "one" and "three", and the number "two" may be missed in this case. Then, the number "two" can be searched and recalled in the continuous paragraphs between numbers "one" and "three", that is, the number "two" can be searched by keywords in the continuous paragraphs between numbers "one" and "three", or the continuous paragraphs between numbers "one" and "three" can be re-divided into the same document segment, and the document segment is sent to the document element type recognition model for secondary recognition. Here, the document segment can also include the previous paragraph of number "one" and the following paragraph of number "three", so that the document segment is more complete and coherent in content, thereby improving the accuracy of secondary recognition.

[0263] After completing the correction processing of the recall target, the final element type of each paragraph in the target document is determined in combination with the recall processing results (including the corrected results) of the recall target and the model recognition results. Exemplarily, for paragraphs that are set as recall targets and obtain accurate element types through recall processing, the results of the recall processing (if there are corrected results, the corrected results are adopted) are used as the final element types of these paragraphs. For paragraphs that are not set as recall targets, or are set as recall targets but fail to provide clear element types through recall processing, the final element types of these paragraphs are determined based on the model recognition results.

[0264] The following describes through a specific embodiment how to pre-process the copy document of the original document according to a set pre-processing method to obtain the target document processed in the embodiment of the present application.

[0265] In one embodiment, the copy document is preprocessed according to a set preprocessing method, and the specific implementation of obtaining the preprocessed document includes: identifying non-standard typesetting styles related to segmentation or paging from the copy document, converting the non-standard typesetting styles into a set standard typesetting style, and obtaining the preprocessed document.

[0266] Wherein, the set preprocessing mode includes a collection of a series of document processing operations, and these document processing operations are intended to ensure that the content in the document can be correctly segmented. In the process of preprocessing the copy document, a paragraph mapping relationship between the original document and the preprocessed document can also be established. Specifically, in the original document, a unique identifier (such as paragraph number, paragraph ID, etc.) is assigned to each paragraph. In the process of preprocessing the copy document of the original document, the original position and the modified position of each paragraph are recorded to establish a mapping relationship between the paragraph in the original document and the corresponding paragraph in the preprocessed document. In step 201, through the paragraph mapping relationship, the model recognition result of the paragraph in the preprocessed document can be corresponded back to the corresponding paragraph in the original document, thereby determining the model recognition result of the paragraph in the original document.

[0267] In one embodiment, the copy document is preprocessed according to a set preprocessing method, and the specific implementation of obtaining the preprocessed document includes: identifying non-standard typesetting styles related to segmentation or paging from the copy document, converting the non-standard typesetting styles into a set standard typesetting style, and obtaining the preprocessed document.

[0268] Among them, non-standard typesetting styles refer to segmentation or paging operations that do not meet the model recognition requirements. These operations may be due to the document creator using specific tools or specific habits. For example, the segmentation operation required by the model recognition can be based on the hard return character in the document data to determine the segmentation. Non-standard typesetting styles usually cause the model to be unable to accurately recognize the paragraph structure of the document, thereby affecting subsequent feature type recognition tasks. For example, the document creator uses space characters to achieve a segmentation effect in a certain paragraph of the document. Although this can achieve the segmentation effect visually, the document feature recognition model deployed on the model side cannot understand this segmentation achieved by space characters. Therefore, this segmentation operation is regarded as a non-standard typesetting style.

[0269] The standard typesetting style refers to the segmentation operation that meets the model recognition requirements. Such segmentation operation is usually based on the general specifications or standards in the document processing field, such as specific paragraph markers.

[0270] It can be seen that by identifying non-standard typesetting styles related to paragraphing or paging from the copy document, converting the non-standard typesetting styles into the set standard typesetting styles, and obtaining the pre-processed document, it can ensure that the non-standard typesetting styles in the copy document are corrected and converted into standard typesetting styles that the model can accurately recognize. This helps the model accurately recognize the paragraph structure of the document, thereby supporting the subsequent feature type recognition task.

[0271] The standardization of the paragraphing style used in the document (the standardization here refers to the recognition ability of the model) will directly affect the model's recognition of paragraphs in the document. In addition, the separation style used in the document is also crucial to the coherence of the model's paragraph recognition. Therefore, the following discusses the specific implementation of identifying non-standard typesetting styles related to paragraphing or paging from the copy document from the two dimensions of paragraphing style and separation style, and converting non-standard typesetting styles into the set standard typesetting style.

[0272] Among them, from the perspective of segmentation style, as an optional implementation method, non-standard typesetting styles related to segmentation or paging are identified from the copy document, and the specific implementation of converting the non-standard typesetting style into a set standard typesetting style includes: identifying non-standard segmentation styles from the copy document, and converting the non-standard segmentation styles into a set standard segmentation style.

[0273] Exemplarily, the standard segmentation style is a paragraph marker (also known as a hard return), that is, the paragraph marker is used as a standard separation mark between document paragraphs, and the document element recognition model can accurately recognize the standard separation mark as the basis for paragraph recognition.

[0274] In this embodiment, based on the recognition rules corresponding to the preset non-standard typesetting styles, the non-standard typesetting styles can be identified from the copy document based on the recognition rules; in addition, the conversion rules for converting different non-standard typesetting styles into standard typesetting styles can also be determined, and standardized conversion can be performed based on the conversion rules.

[0275] The following examples describe the following non-standard segmentation styles that may exist in the copy document and their corresponding conversion rules:

[0276] The first type: soft return segmentation

[0277] In document editing scenarios, soft returns are often used to wrap lines within the same paragraph, rather than to create new paragraphs. However, due to the user's specific editing habits or insufficient understanding of document typesetting specifications, soft returns may be mistakenly used to try to visually create a segmentation effect.

[0278] In view of this situation, the non-standard segmentation style is identified from the copy document, and the specific implementation of converting the non-standard segmentation style into the set standard segmentation style includes: identifying the soft carriage return from the copy document, and converting the soft carriage return into a paragraph marker. By converting the soft carriage return into a paragraph marker, it is helpful to restore the correct paragraph structure of the document, thereby helping the subsequent model to accurately identify the paragraphs in the copy document and then identify the element type of the paragraph.

[0279] For example, see Figure 5 , which is a diagram comparing the effects of using soft carriage returns and hard carriage returns in text content.

[0280] The second type: the separator is glued to the content paragraph

[0281] In document editing scenarios, separators (such as page breaks and section breaks) are usually used to visually or logically separate document content, and can usually also achieve segmentation in visual effects. For example, Figure 6 The string "I am a free paragraph at the top of the page" on page 2 and the string "I am a glued paragraph at the top of the page, I am part of the paragraph on the previous page" on page 3 are visually displayed as two paragraphs due to the existence of page breaks. However, if the hard return character is used as the paragraph separation criterion, the string "I am a free paragraph at the top of the page" on page 2 and the string "I am a glued paragraph at the top of the page, I am part of the paragraph on the previous page" on page 3 will still be recognized as the same paragraph (see Figure 6 , there is no hard return after the string in page 2), resulting in a difference between the segmentation based on document data and the visual effect segmentation that conforms to user intent.

[0282] That is to say, due to the user's editing habits or specific needs, these separators are sometimes attached to the paragraph content, making it look like two paragraphs visually. However, if the hard return character is used as the segmentation standard, the actual segmentation result will not be correctly separated in the document structure, that is, the two paragraphs separated by the separator will still be divided into the same paragraph.

[0283] In view of this situation, the non-standard paragraphing style is identified from the copy document, and the specific implementation of converting the non-standard paragraphing style to the set standard paragraphing style includes: identifying the separators attached to the paragraph content from the copy document, inserting paragraph markers between the separators and the attached paragraph content, so as to restore the correct paragraph structure of the document. Figure 6 , where page 1 is an example of correct paragraph structure. Figure 6 As shown on page 1 of the text, the string "I am a free paragraph at the top of the page" is followed by a page break, and there is also a hard return after the page break. Based on the hard return as the segmentation standard, the string "I am a free paragraph at the top of the page" in page 1 and the string "I am a free paragraph at the top of the page" in page 2 are identified as two paragraphs. In addition, there is another correct paragraph structure: the delimiter is at the beginning of the paragraph, that is, the delimiter is after the hard return. For example, suppose Figure 6 The content of page 1 is "I am a free paragraph hard return at the top of the page", and the content of page 2 is "Separator I am a free paragraph hard return at the top of the page", which is also the correct paragraph structure and can be used to Figure 6 The string in page 1 and the string in page 2 are correctly identified as two paragraphs.

[0284] Based on this, firstly, the separator mark (such as the specific code of the page break, the identifier of the section break, etc., which vary depending on the document format) is identified from the copy document, and then, for the identified separator, it is analyzed whether it is attached to the paragraph content. Here, the attachment of the separator mark to the paragraph content is manifested as the absence of a paragraph mark between the separator and the paragraph content. For example, see Figure 6 In the example on page 2 of the article, the delimiter tag is attached to the string "I am a free paragraph at the top of the page". Another case is that there is no paragraph tag after the delimiter tag. In other words, if there is no paragraph tag before or after the delimiter tag, it can be considered that the delimiter tag is attached to the paragraph content. In this case, insert a paragraph tag (such as a hard return) between the delimiter tag and the attached paragraph content to ensure that the paragraphs can be separated correctly. For example, Figure 6 Change page 2 in to "I am a free paragraph hard return section break at the top of the page (next page)".

[0285] The third type: space or tab segment

[0286] In a document editing context, users may use spaces or tabs to try to visually separate paragraphs, but these characters do not actually form true paragraph breaks in the document structure. For example, see Figure 7 , which is a schematic diagram of the segmentation effect of space or tab characters.

[0287] In view of this situation, the specific implementation of identifying the non-standard segmentation style from the copy document and converting the non-standard segmentation style into the set standard segmentation style includes: identifying the line ending with multiple continuous spaces or tabs from the copy document, deleting the multiple continuous spaces or tabs at the end of the line, and inserting a paragraph mark at the end of the line. Exemplarily, the copy document content is traversed line by line, and it is checked whether the end of each line contains multiple continuous spaces or tabs. If continuous spaces or tabs are found, these characters are deleted and a paragraph mark is inserted at the end of the line. Specifically, when typesetting, the copy document content is traversed line by line. For example, if a line can display 20 characters, 20 characters are read from the copy document content as a line to be traversed. For the line currently traversed, if the last character position of the current line is a space character or a tab character when traversing to it, it means that the current line ends with a space character or a tab character. Then, delete the continuous spaces or tabs at the end of the line, and insert a paragraph mark at the end of the current line. Continue to read the content of the copy document that can be typeset into a line as the new current traversed line. In this way, the lines between the current line and the previous paragraph mark will be separated into a paragraph, and the next line of the current line will become the starting line of a new paragraph.

[0288] The fourth case: the text content is not segmented

[0289] In document editing scenarios, users may fail to divide text content into multiple paragraphs correctly due to negligence or specific editing habits, resulting in multiple paragraphs being merged into one paragraph. This merging is particularly obvious when the document contains numbered lists, because each numbered item should usually be considered an independent paragraph. For example, see Figure 8 , which is a schematic diagram of the effect of not correctly segmenting text content.

[0290] In view of this situation, the specific implementation of identifying the non-standard paragraphing style from the copy document and converting the non-standard paragraphing style into the set standard paragraphing style includes: identifying a paragraph including at least two numbers from the copy document, and inserting a paragraph marker before the non-first number in the paragraph. Exemplarily, the document content is traversed line by line or paragraph by paragraph to find the paragraphs containing numbers, and for each paragraph containing at least two numbers, the position of the non-first number is found. A paragraph marker is inserted before each non-first number to ensure that after the paragraph marker is inserted, each numbered item is located in a new paragraph.

[0291] In addition, when the text content is not segmented and does not contain a numbered list, the model can also be used to segment the text content. For example, the model segments the text content using contextual semantic recognition technology. This is not limited here.

[0292] From the perspective of separation style, as an optional implementation method, non-standard typesetting styles related to paragraphing or paging are identified from the copy document, and the specific implementation of converting the non-standard typesetting styles into the set standard typesetting styles includes: identifying non-standard separation styles from the copy document, and converting the non-standard separation styles into the set standard separation styles.

[0293] For example, the following non-standard separation styles may exist in the copy document:

[0294] The first type: Section / page break paging

[0295] In a document editing scenario, users may use different paging or sectioning methods to organize content, such as directly inserting page breaks or inserting blank pages (which usually introduce section breaks) to achieve paging effects. However, these different paging or sectioning methods may lead to inconsistent document structures, thus affecting the readability of the document and the efficiency and accuracy of document analysis and recognition.

[0296] In response to this situation, a non-standard separation style is identified from the copy document. The specific implementation of converting the non-standard separation style to the set standard separation style includes: identifying a section break or page break at the end of a line from the copy document, and moving the section break or page break at the end of a line to the beginning of the next line of the line to ensure consistency of the paging or sectioning method in the copy document.

[0297] The second type: paragraph break and line break

[0298] In a document editing scenario, users may sometimes achieve page breaks by simply pressing Enter to add a blank line, but this is not recommended because it will become ineffective as the document layout is adjusted. For example, see Fig. 9 , a schematic diagram of using consecutive blank lines to achieve paging effect

[0299] In response to this situation, a non-standard separation style is identified from the copy document. The specific implementation of converting the non-standard separation style to the set standard separation style includes: identifying a page ending with continuous blank lines from the copy document, inserting a page break at the beginning of the first line of the next page of the page, and deleting the continuous blank lines at the end of the page to ensure the consistency and stability of the paging method in the copy document.

[0300] Specifically, for each page of the copy document, traverse line by line. For the current traversed line, if it is found that there are no valid characters in the line, for example, all are space characters or tab characters, then continue to traverse the next line. If there are valid characters in the traversed line, stop traversing the current page and continue to traverse the next line by line. If it is traversed to the last line of the current page and it is found that there are still no valid characters in the last line, it means that the current page ends with continuous blank lines. Then, insert a page break at the beginning of the first line of the next page of the page, and delete the continuous blank lines at the end of the page. Through this processing method, page redundancy caused by continuous blank lines can be avoided, and the page division of the document can also be made clearer and more reasonable.

[0301] The third type: paragraph attribute paging

[0302] In a document editing scenario, users may use paragraph properties (such as "page break before" or "page break after") to achieve paging effects. This method is more common for professional users such as Office, but it may also be inadvertently introduced into the document due to operations such as copying and pasting, causing other users to be unaware or overwhelmed.

[0303] In view of this situation, the specific implementation of identifying the non-standard delimiting style from the copy document and converting the non-standard delimiting style into the set standard delimiting style includes: identifying the paragraphs with paragraph attributes set from the copy document, determining the first paragraph of the next page according to the paragraph attributes set for the paragraph, and inserting a page break at the beginning of the first paragraph of the next page to ensure the consistency and readability of the paging method of the copy document. Exemplarily, the copy document is traversed line by line or paragraph by paragraph to identify the paragraphs with specific paragraph attributes (such as page break before paragraph, page break after paragraph, etc.). After determining the first paragraph of the next page, a page break is inserted at the beginning of the paragraph, and the paragraph attributes originally used for paging are cleared.

[0304] By deeply analyzing the paragraph and separation styles in the copy documents, identifying the non-standard typesetting styles formed by the document creator's use of specific tools or habits, and converting these non-standard typesetting styles into the set standard typesetting styles, it can ensure that the model can accurately recognize and understand the paragraph structure of the copy documents.

[0305] The consistency and standardization of numbering are also crucial for the model to understand the logical structure of the document. In the document editing scenario, users may use a variety of numbering methods, including manual numbering, single-level automatic numbering, multi-level automatic numbering, etc., and these numbering styles may involve numbers, Chinese characters, special symbols, etc. In addition, the complex relationship between numbering and paragraphs, such as indentation and spacing, may also cause the typesetting to not meet user expectations. Therefore, unifying the numbering method and achieving controllability and consistency of typesetting is an important task in document processing.

[0306] Based on this, as an optional implementation, the specific implementation of identifying the non-standard typesetting style related to paragraphing or paging from the copy document and converting the non-standard typesetting style to the set standard typesetting style includes: identifying the non-standard numbering style from the copy document and converting the non-standard numbering style to the set standard numbering style. Exemplarily, the specific implementation of identifying the non-standard numbering style from the copy document and converting the non-standard numbering style to the set standard numbering style includes: identifying the number set with the automatic numbering style from the copy document and canceling the automatic numbering style setting for the number.

[0307] It can be seen that manual numbering is used in the copy documents to avoid the complexity brought by automatic numbering, thereby improving the reliability and consistency of the copy document layout and laying the foundation for the subsequent model to accurately understand the logical structure of the document.

[0308] In addition, there will be some non-standard content in the document. The non-standard content here refers to the content form in the document that does not conform to the set standard specifications. The set standard specifications are, for example, customized by document processing software, industry practices or users, and are intended to ensure the consistency and readability of the document. Exemplary, non-standard content includes: domain elements, revision marks, etc. Domain elements are used to insert dynamic content into the document, such as page numbers, dates, etc. In the final layout of the document, domain elements should be replaced with domain results. Modification marks indicate that the document has been modified, such as strikethroughs, underlines, texts of different colors, etc. In the final layout of the document, revision marks should be replaced with revised content. It can also be seen from this that non-standard content usually refers to the intermediate form of content generated during the document editing process, while standard content refers to the content presented in the final layout of the document.

[0309] Due to the limited computing power of the model, non-standard content may interfere with the model's paragraph recognition. In this regard, as an optional implementation method, non-standard typesetting styles related to segmentation or paging are identified from the copy document, and the specific implementation of converting the non-standard typesetting styles to the set standard typesetting styles includes: identifying non-standard content styles from the copy document, and converting the non-standard content styles to the set standard content styles. By normalizing the non-standard content styles in the copy document, it can be ensured that they will not interfere with the model's recognition.

[0310] Exemplarily, the specific implementation of identifying non-standard content styles from the copy document and converting the non-standard content styles into the set standard content styles includes: identifying domain elements from the copy document, determining domain results of the domain elements, and using the domain results to replace the domain elements in the copy document.

[0311] Exemplarily, the specific implementation of identifying non-standard content styles from a copy document and converting the non-standard content styles into a set standard content style includes: identifying revised content with revision marks from the copy document, determining the revised content of the revised content, and replacing the revised content with the revised content in the copy document.

[0312] In addition to domain elements and revision content, there may be other types of non-standard content, such as hidden text, footnotes / endnotes, comments, etc. For these contents, corresponding identification and conversion strategies can be formulated according to specific needs, and the embodiments of the present application do not limit this.

[0313] In the above embodiment, a copy document of the original document is created, the copy document is preprocessed according to a set preprocessing method, and a preprocessed document is obtained. The preprocessed document is determined as a target document to be processed, thereby ensuring that the content in the target document is correctly segmented, thereby improving the accuracy of identifying and streamlining redundant content in the document.

[0314] Fig.10 This is a block diagram of an embodiment of a document processing device provided in an embodiment of the present application. Fig.10 As shown, the device comprises:

[0315] The model recognition module 101 is used to obtain a target document to be processed, and determine a model recognition result of a paragraph in the target document using a document element recognition model, wherein the model recognition result includes: an element type of the paragraph determined by the document element recognition model;

[0316] A recall processing module 102, configured to perform a recall process on the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target;

[0317] The result determination module 103 is used to determine the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, wherein the recall processing result includes: the element type of the paragraph determined by the recall processing.

[0318] In a possible implementation, the recall processing module 102 is specifically configured to:

[0319] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall interval corresponding to the recall target is located from the target document, and the element type of the paragraph in the recall interval is determined.

[0320] In a possible implementation, the recall processing module 102 includes:

[0321] a positioning unit, configured to locate, from the target document, a paragraph that matches a recall rule corresponding to a set recall target as a candidate paragraph according to a model recognition result of the paragraph in the target document;

[0322] A discarding unit, configured to determine the location features of the candidate paragraphs in the target document, and determine the candidate paragraphs whose location features match the recall rule as target paragraphs;

[0323] The boundary recall unit is used to locate the recall interval corresponding to the recall target from the target document according to the target paragraph.

[0324] In a possible implementation manner, the boundary recall unit is specifically used to:

[0325] Determine the target paragraph as the starting paragraph of the recall target, and determine the ending paragraph of the recall target in the following of the starting paragraph;

[0326] The start paragraph, the end paragraph, and a paragraph between the start paragraph and the end paragraph are determined as a recall interval corresponding to the recall target.

[0327] In a possible implementation manner, the positioning unit is specifically used to:

[0328] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the non-directory title paragraph is located from the target document, and the non-directory title paragraph is determined as a candidate paragraph;

[0329] The boundary recall unit is specifically used for:

[0330] Obtain the numbering interval and / or outline interval of the paragraphs following the starting paragraph;

[0331] According to the numbering interval and / or outline interval, an end paragraph of the recall target is determined below the start paragraph.

[0332] In a possible implementation manner, the positioning unit is specifically used to:

[0333] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the unnumbered title paragraph is located from the target document, and the unnumbered title paragraph is determined as a candidate paragraph;

[0334] The boundary recall unit is specifically used for:

[0335] Determine the previous paragraph of the first body title paragraph below the start paragraph as the end paragraph of the recall target;

[0336] Alternatively, the previous paragraph of the first determined starting paragraph in the following of the starting paragraph is determined as the ending paragraph of the recall target.

[0337] In a possible implementation manner, the positioning unit is specifically used to:

[0338] According to the model recognition result of the paragraphs in the target document and the recall rule corresponding to the set recall target, the title paragraph containing the specified content and having the specified text structure is located from the target document to be determined as the candidate paragraph;

[0339] The boundary recall unit is specifically used for:

[0340] Determine the last paragraph following the start paragraph as the end paragraph of the recall target;

[0341] Alternatively, the previous paragraph of the first determined starting paragraph in the following of the starting paragraph is determined as the ending paragraph of the recall target;

[0342] Determine the parent directory of the sub-document area to which the start paragraph belongs, and find the first directory title located below the start paragraph from the parent directory; determine the previous paragraph of the found directory title in the target document as the end paragraph of the recall target.

[0343] In a possible implementation, the recall processing module 102 includes:

[0344] A directory area recall unit, used to determine the directory text paragraph interval from the target document according to the model recognition result of the paragraph in the target document;

[0345] Starting from the first paragraph of the catalog body paragraph interval, traversing upwards paragraph by paragraph, if the traversed paragraph meets the set condition, continue traversing until the catalog title paragraph is traversed or the traversed paragraph does not meet the set condition, stop traversing, and determine the next paragraph of the currently traversed paragraph as the starting paragraph of the recall interval corresponding to the recall target; and / or,

[0346] Starting from the last paragraph of the table of contents body paragraph interval, traverse downwards paragraph by paragraph, and if the traversed paragraph meets the set conditions, continue traversing until the table of contents title paragraph is traversed or the traversed paragraph does not meet the set conditions, then stop traversing, and determine the previous paragraph of the currently traversed paragraph as the end paragraph of the recall interval corresponding to the recall target.

[0347] In a possible implementation, the recall processing module 102 includes:

[0348] The specific element recall unit is used to locate the paragraphs containing specified content and / or having a specified text structure from the recall interval and determine them as target paragraphs belonging to the recall target based on the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall target.

[0349] In a possible implementation, the device further includes:

[0350] A discarding module, used for discarding the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target;

[0351] The result determination module 103 is specifically used for:

[0352] The element type of the paragraph in the target document is determined according to the recall processing result and the discard processing result of the recall target and the model recognition result of the paragraph in the target document.

[0353] In a possible implementation, the device further includes:

[0354] A correction module, used for performing correction processing of the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target;

[0355] The result determination module 103 is specifically used for:

[0356] The element type of the paragraph in the target document is determined according to the recall processing result and the correction processing result of the recall target and the model recognition result of the paragraph in the target document.

[0357] In a possible implementation manner, the correction module is specifically used to:

[0358] Locating the same-level numbering intervals from the target document according to the model recognition results of the paragraphs in the target document;

[0359] According to the numbers of the paragraphs in the same-level numbering interval, the outline levels of the paragraphs in the same-level numbering interval are modified.

[0360] like Fig.11 As shown, an embodiment of the present application provides an electronic 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.

[0361] Memory 113, used for storing computer programs;

[0362] 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:

[0363] Acquire a target document to be processed, and determine a model recognition result of a paragraph in the target document using a document element recognition model, wherein the model recognition result includes: an element type of the paragraph determined by the document element recognition model;

[0364] According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall processing of the recall target is performed in the target document;

[0365] According to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, the element type of the paragraph in the target document is determined, wherein the recall processing result includes: the element type of the paragraph determined by the recall processing.

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

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

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

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

[0370] 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 a target document to be processed, and determine a model recognition result of a paragraph in the target document using a document element recognition model, wherein the model recognition result includes: an element type of the paragraph determined by the document element recognition model; According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall processing of the recall target is performed in the target document; According to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, the element type of the paragraph in the target document is determined, wherein the recall processing result includes: the element type of the paragraph determined by the recall processing.

2. The method according to claim 1, characterized in that The step of performing a recall process on the target document according to the model recognition result of the paragraph in the target document and the set recall rule corresponding to the recall target includes: According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall interval corresponding to the recall target is located from the target document, and the element type of the paragraph in the recall interval is determined.

3. The method according to claim 2, characterized in that The step of locating the recall interval corresponding to the recall target from the target document according to the model recognition result of the paragraph in the target document and the set recall rule corresponding to the recall target includes: According to the model recognition result of the paragraph in the target document, a paragraph matching the recall rule corresponding to the set recall target is located from the target document as a candidate paragraph; Determining the location features of the candidate paragraphs in the target document, and determining the candidate paragraphs whose location features match the recall rule as target paragraphs; A recall interval corresponding to the recall target is located from the target document according to the target paragraph.

4. The method according to claim 3, characterized in that The step of locating a recall interval corresponding to the recall target from the target document according to the target paragraph includes: Determine the target paragraph as the starting paragraph of the recall target, and determine the ending paragraph of the recall target in the following of the starting paragraph; The start paragraph, the end paragraph, and a paragraph between the start paragraph and the end paragraph are determined as a recall interval corresponding to the recall target.

5. The method according to claim 4, characterized in that The step of locating, based on the model recognition result of the paragraph in the target document, a paragraph that matches the recall rule corresponding to the set recall target from the target document as a candidate paragraph includes: According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the non-directory title paragraph is located from the target document, and the non-directory title paragraph is determined as a candidate paragraph; The step of determining the end paragraph of the recall target below the start paragraph includes: Obtain the numbering interval and / or outline interval of the paragraphs following the starting paragraph; According to the numbering interval and / or outline interval, an end paragraph of the recall target is determined below the start paragraph.

6. The method according to claim 4, characterized in that The step of locating, based on the model recognition result of the paragraph in the target document, a paragraph that matches the recall rule corresponding to the set recall target from the target document as a candidate paragraph includes: According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the unnumbered title paragraph is located from the target document, and the unnumbered title paragraph is determined as a candidate paragraph; The step of determining the end paragraph of the recall target below the start paragraph includes: Determine the previous paragraph of the first body title paragraph below the start paragraph as the end paragraph of the recall target; Alternatively, the previous paragraph of the first determined starting paragraph in the following of the starting paragraph is determined as the ending paragraph of the recall target.

7. The method according to claim 4, characterized in that The step of locating, based on the model recognition result of the paragraph in the target document, a paragraph that matches the recall rule corresponding to the set recall target from the target document as a candidate paragraph includes: According to the model recognition result of the paragraphs in the target document and the recall rule corresponding to the set recall target, the title paragraph containing the specified content and having the specified text structure is located from the target document to be determined as the candidate paragraph; The step of determining the end paragraph of the recall target below the start paragraph includes: Determine the last paragraph following the start paragraph as the end paragraph of the recall target; Alternatively, the previous paragraph of the first determined starting paragraph in the following of the starting paragraph is determined as the ending paragraph of the recall target; Determine the parent directory of the sub-document area to which the start paragraph belongs, and find the first directory title located below the start paragraph from the parent directory; determine the previous paragraph of the found directory title in the target document as the end paragraph of the recall target.

8. The method according to claim 2, characterized in that: The step of locating the recall interval corresponding to the recall target from the target document according to the model recognition result of the paragraph in the target document and the set recall rule corresponding to the recall target includes: Determine the paragraph interval of the directory body from the target document according to the model recognition result of the paragraph in the target document; Starting from the first paragraph of the paragraph interval of the catalog body, traversing upwards paragraph by paragraph, if the traversed paragraph meets the set condition, continue traversing until the catalog title paragraph is traversed or the traversed paragraph does not meet the set condition, stop traversing, and determine the next paragraph of the currently traversed paragraph as the starting paragraph of the recall interval corresponding to the recall target; and / or, Starting from the last paragraph of the table of contents body paragraph interval, traverse downwards paragraph by paragraph, and if the traversed paragraph meets the set conditions, continue traversing until the table of contents title paragraph is traversed or the traversed paragraph does not meet the set conditions, then stop traversing, and determine the previous paragraph of the currently traversed paragraph as the end paragraph of the recall interval corresponding to the recall target.

9. The method according to claim 1, characterized in that: The recall processing of the recall target in the target document according to the model recognition result of the paragraph in the target document and the set recall rule corresponding to the recall target includes: According to the model recognition results of the paragraphs in the target document and the recall rules corresponding to the set recall target, the paragraphs containing the specified content and / or having the specified text structure are located from the recall interval and determined as the target paragraphs belonging to the recall target.

10. The method according to claim 1, characterized in that The method further comprises: According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall target is discarded in the target document; The determining the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document includes: The element type of the paragraph in the target document is determined according to the recall processing result and the discard processing result of the recall target and the model recognition result of the paragraph in the target document.

11. The method according to claim 1, characterized in that: The method further comprises: According to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target, the recall target is corrected in the target document; The determining the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document includes: The element type of the paragraph in the target document is determined according to the recall processing result and the correction processing result of the recall target and the model recognition result of the paragraph in the target document.

12. The method according to claim 11, characterized in that The step of performing correction processing on the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target includes: Locating the same-level numbering intervals from the target document according to the model recognition results of the paragraphs in the target document; According to the numbers of the paragraphs in the same-level numbering interval, the outline levels of the paragraphs in the same-level numbering interval are modified.

13. A document processing device, characterized in that: The device comprises: A model recognition module is used to obtain a target document to be processed, and determine a model recognition result of a paragraph in the target document using a document element recognition model, wherein the model recognition result includes: an element type of the paragraph determined by the document element recognition model; A recall processing module, used for performing a recall process of the recall target in the target document according to the model recognition result of the paragraph in the target document and the recall rule corresponding to the set recall target; A result determination module is used to determine the element type of the paragraph in the target document according to the recall processing result of the recall target and the model recognition result of the paragraph in the target document, wherein the recall processing result includes: the element type of the paragraph determined by the recall processing.

14. An electronic device, characterized in that: include: 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 according to any one of claims 1 to 12.

15. 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 12.

Citation Information

Cited By

  • Document outline generation method and system, terminal and medium

    CN120911406A