A method, apparatus, electronic device and storage medium for identifying an attachment description
By recognizing the first paragraph and corresponding content of attachment descriptions in a document, and utilizing key characters and numbering features, the layout format of attachment descriptions is automatically adjusted. This solves the problem of cumbersome operation and errors caused by manual adjustment by users in existing technologies, and improves the user experience.
Patent Information
- Application Number
- CN202110726720.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-29
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2041-06-29
AI Technical Summary
Existing document editing software cannot automatically recognize and adjust the formatting of attachment descriptions, requiring users to perform manual operations, which are cumbersome and prone to errors.
By identifying the first paragraph and corresponding content of attachment descriptions in a document, and utilizing key characters and numbering features, the system automatically identifies and adjusts the formatting of attachment descriptions, including determining the first paragraph, numbering continuity, and paragraph relationships, and handling user editing errors.
It automatically recognizes and adjusts the formatting of attachment descriptions, reducing manual operations for users, improving operational efficiency and accuracy, and enhancing the user experience.
Smart Images

Figure CN115545062B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer software application technology, and in particular to a method, apparatus, electronic device, and storage medium for identifying attachment descriptions. Background Technology
[0002] Currently, when users edit documents using document editing software, they may need to edit documents with fixed formatting. For example, administrative documents. In administrative documents, the content of attachment descriptions has a fixed formatting. For instance, if an attachment name is long and needs to be wrapped to a new line, it should be aligned with the first character of the attachment name on the previous line.
[0003] Users often need to manually adjust the formatting of content with fixed layouts in documents, such as attachment descriptions. This is not only tedious but also prone to errors. Software should typically recognize the attachment descriptions and automatically format them. However, current document editing software does not support the recognition of attachment descriptions. Summary of the Invention
[0004] The purpose of this invention is to provide a method, apparatus, electronic device, and storage medium for identifying attachment descriptions, so as to automatically identify attachment descriptions in documents and facilitate automatic adjustment of the attachment description layout. The specific technical solution is shown below.
[0005] This invention provides a method for identifying attachment descriptions, including:
[0006] Obtain the document to be recognized;
[0007] Traverse each paragraph in the document to be identified, and determine the paragraph containing the key characters as the first paragraph of the attachment description;
[0008] For each appendix description paragraph, the appendix description content corresponding to each appendix description paragraph is determined in the paragraph following each appendix description paragraph; the appendix description content corresponding to each appendix description paragraph has a consecutive number.
[0009] For each appendix description's first paragraph, the appendix description content corresponding to each appendix description's first paragraph and each appendix description's first paragraph are defined as a whole appendix description.
[0010] Optionally, determining the content of the attachment description corresponding to the first paragraph of each attachment description includes:
[0011] The initial value of the current serial number to be added is determined based on the first paragraph of each attachment description; the current serial number to be added represents the serial number contained in the paragraph of the attachment description content corresponding to the first paragraph of each attachment description.
[0012] Iterate through the paragraphs following the first paragraph of each appendix description, and perform the following steps:
[0013] If the currently traversed paragraph has a numeric number and the number is the same as the number to be added, add the currently traversed paragraph to the attachment description content corresponding to the first paragraph of each attachment description; increment the current number to be added by 1; stop traversing if the currently traversed paragraph meets the preset conditions.
[0014] Optionally, the preset conditions include any one of the following: the currently traversed paragraph has a non-numeric type number; the currently traversed paragraph has a numeric type number but the number sequence is different from the current sequence number to be added; the currently traversed paragraph is the last paragraph of the document to be identified.
[0015] Optionally, determining the initial value of the current sequence number to be added based on the first paragraph of each attachment description includes:
[0016] If the first paragraph of each attachment description does not have a number, the initial value of the current serial number to be added is determined to be 1; if the first paragraph of each attachment description contains a number, the initial value of the current serial number to be added is determined to be the serial number contained in the first paragraph of each attachment description + 1.
[0017] Optionally, determining the initial value of the current sequence number to be added based on the first paragraph of each attachment description includes:
[0018] Determine whether the first paragraph of each attachment description has a number. If the first paragraph of each attachment description does not have a number, determine that the initial value of the current serial number to be added is 1.
[0019] If the first paragraph of each attachment description has a number, determine whether the number contained in the first paragraph of each attachment description is a numeric type; if the first paragraph of each attachment description contains a numeric type number, determine that the initial value of the current serial number to be added is the serial number contained in the first paragraph of each attachment description + 1.
[0020] Optionally, the paragraphs between the first paragraph of each attachment description and the first paragraph of the corresponding attachment description content are not numbered.
[0021] Optionally, defining the attachment description content corresponding to the first paragraph of each attachment description and the first paragraph of each attachment description as a whole attachment description includes:
[0022] The entire paragraphs between the first paragraph of each attachment description and the last paragraph of the attachment description content corresponding to the first paragraph of each attachment description are defined as a whole attachment description.
[0023] This invention also provides an apparatus for identifying appendix descriptions, comprising:
[0024] The acquisition module is used to acquire the document to be recognized;
[0025] The traversal module is used to traverse each paragraph in the document to be identified and determine the paragraph containing the key characters as the first paragraph of the attachment description;
[0026] The determination module is used to determine the attachment description content corresponding to each attachment description first paragraph in the paragraph following each attachment description first paragraph; the attachment description content corresponding to each attachment description first paragraph has a consecutive number of numbers;
[0027] The merging module is used to combine the attachment description content corresponding to each attachment description's first paragraph and each attachment description's first paragraph into a single attachment description.
[0028] Optionally, the determining module includes:
[0029] An initialization submodule is used to determine the initial value of the current serial number to be added based on the first paragraph of each attachment description; the current serial number to be added represents the serial number contained in the paragraph of the attachment description content corresponding to the first paragraph of each attachment description.
[0030] Add a submodule to iterate through the paragraphs following the first paragraph of each attachment description and perform the following steps: if the currently iterated paragraph has a numeric number and the number is the same as the current number to be added, add the currently iterated paragraph to the attachment description content corresponding to the first paragraph of each attachment description; increment the current number to be added by 1; stop iterating if the currently iterated paragraph meets a preset condition.
[0031] Optionally, the preset conditions include any one of the following: the currently traversed paragraph has a non-numeric type number; the currently traversed paragraph has a numeric type number but the number sequence is different from the current sequence number to be added; the currently traversed paragraph is the last paragraph of the document to be identified.
[0032] Optionally, the initialization submodule includes:
[0033] The initial value determination submodule is used to determine the initial value of the current serial number to be added as 1 when the first paragraph of each attachment description does not have a number; and to determine the initial value of the current serial number to be added as the serial number contained in the first paragraph of each attachment description plus 1 when the first paragraph of each attachment description contains a number.
[0034] Optionally, the initialization submodule includes:
[0035] The first judgment submodule is used to determine whether the first paragraph of each attachment description has a number. If the first paragraph of each attachment description does not have a number, the initial value of the current serial number to be added is determined to be 1.
[0036] The second judgment submodule is used to determine whether the number contained in the first paragraph of each attachment description is of numeric type when the first paragraph of each attachment description has a number; and to determine the initial value of the current serial number to be added is the serial number contained in the first paragraph of each attachment description + 1 when the first paragraph of each attachment description contains a numeric number.
[0037] Optionally, in the determining module, the paragraphs between the first paragraph of each attachment description and the first paragraph of the corresponding attachment description content are not numbered.
[0038] Optionally, the merging module includes:
[0039] The overall determination submodule is used to determine all paragraphs between the first paragraph of each attachment description and the last paragraph of the attachment description content corresponding to the first paragraph of each attachment description as a whole attachment description.
[0040] This invention also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0041] Memory, used to store computer programs;
[0042] When a processor executes a program stored in memory, it implements the method steps described above for identifying the attachment.
[0043] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method steps for identifying the attachment as described above.
[0044] This invention provides a method for identifying attachment descriptions. By utilizing the characteristics of attachment descriptions, it can determine the first paragraph and corresponding content of the attachment description, and is compatible with various situations where users may make editing errors. It can identify attachment descriptions in complex document editing scenarios. Not only is it error-tolerant and convenient for users to edit and use, but it also allows for the automatic adjustment of the identified attachment descriptions to the correct format, facilitating user operation and improving the user experience.
[0045] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0047] Figure 1 This is a schematic diagram illustrating an example of editing an attachment description provided in an embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram illustrating a correct layout example of an appendix description provided in an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram illustrating an example of incorrect formatting in an appendix description provided in an embodiment of the present invention;
[0050] Figure 4 This is a flowchart illustrating a method for identifying attachment descriptions provided in an embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram illustrating the principle of document interaction in a method for identifying attachment descriptions provided in an embodiment of the present invention;
[0052] Figure 6 This is a flowchart of another method for identifying attachment descriptions provided in an embodiment of the present invention;
[0053] Figure 7 This is a schematic diagram illustrating an attachment to be identified according to an embodiment of the present invention;
[0054] Figure 8 This is a schematic diagram illustrating another unidentified attachment provided in an embodiment of the present invention;
[0055] Figure 9 This is a schematic diagram of the structure of a device for identifying attachment descriptions provided in an embodiment of the present invention;
[0056] Figure 10 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0057] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art should fall within the scope of disclosure.
[0058] Currently, when users edit documents using document editing software, they may need to edit documents with fixed formatting. For example, official administrative documents.
[0059] In official administrative documents, there is a fixed format for the description of attachments: If there are attachments, the word "Attachment" should be placed one line below the main text, indented two spaces from the left, followed by a full-width colon and the attachment name. If there are multiple attachments, use Arabic numerals to indicate their sequence number (e.g., "Attachment: 1.XXXXX"); no punctuation marks should be added after the attachment name. If the attachment name is too long and needs to be wrapped to a new line, it should be aligned with the first character of the attachment name on the previous line.
[0060] The correct formatting is shown below.
[0061] If there is only a single attachment, the correct formatting is as follows.
[0062] Attachment: xxxxx
[0063] If there are multiple attachments, they should be numbered using Arabic numerals. The correct format is shown below.
[0064] Attachment: 1.xxx
[0065] 2.xxx
[0066] 3.xxx
[0067] If an attachment has a long name and needs to be wrapped to a new line, it should usually be aligned with the first character of the attachment name. The correct formatting example is shown below.
[0068] Attachment: Environmental Protection Initiative on Further Rectifying the Deterioration of the Ecological Environment and the Surrounding Environment of Rural Areas in a Certain County, a Certain City, a Certain Province
[0069] It should be clarified that the serial numbers in the document are usually described as numbers, and the numbers in the attachment description do not have multi-level numbering, that is, there are no cases of multi-level numbering such as 1.1, 1.1.1, etc., only Arabic numeral numbers such as 1, 2, 3, ... exist.
[0070] When editing a document, users typically use the body text format to edit attachment descriptions. Specific examples are as follows: Figure 1 As shown. Among them, Figure 1 This is a schematic diagram illustrating an example of editing an attachment description provided in an embodiment of the present invention.
[0071] Users often need to manually adjust the formatting of attachment descriptions in documents, which is not only tedious but also prone to errors. Software should typically recognize and automatically format the attachment descriptions. However, current document editing software does not support the recognition of attachment descriptions.
[0072] For ease of understanding, such as Figure 2 As shown, Figure 2 This is a schematic diagram illustrating a correct layout example of an appendix description provided in an embodiment of the present invention. Figure 2 The middle is the user's target Figure 1 The appendix descriptions edited in this article were manually modified according to the formatting guidelines outlined in the appendix descriptions.
[0073] If the document editing software's built-in intelligent recognition function or other intelligent recognition plugins cannot recognize the attachment description, it will usually adjust the text format used by the user when editing the attachment description to recognize the attachment description as part of the main text.
[0074] like Figure 3 As shown, Figure 3 This is a schematic diagram illustrating an example of incorrect formatting in an appendix description provided in an embodiment of the present invention. Figure 3 The middle is the user's target Figure 1 The appendix description edited by the editor shows the layout adjustments made after the intelligent recognition plugin identified it as main text.
[0075] To address the aforementioned problems, this invention provides a method for identifying attachment descriptions. This method can be applied to document editing software as well as other software.
[0076] In the method for identifying attachment descriptions provided by this invention, identification can be based on the characteristics of the attachment descriptions in the document, including the presence of key characters in paragraphs. After identifying the attachment descriptions in the document, they can be automatically adjusted to the correct formatting, thereby facilitating user operation and avoiding errors.
[0077] The following detailed description of a method for identifying attachment descriptions provided by an embodiment of the present invention will be provided through specific examples.
[0078] Before introducing the specific methods, let's first explain the concepts involved in this method flow.
[0079] Document: Specifically, it can be an object edited by the user in document editing software. It can consist of characters and may include at least one paragraph. Paragraphs can be separated by a carriage return.
[0080] Attachment description: Specifically, it can be the content used to fill in the attachment name in the administrative document. It can contain at least one paragraph, and usually the first two characters of the first paragraph indicate that it is an attachment.
[0081] The first paragraph of the attachment description: This can be the first paragraph of the identified attachment description. It usually contains keywords such as "attachment," indicating that the first paragraph and subsequent paragraphs are likely attachment descriptions. To facilitate the identification of attachment descriptions, the first paragraph can be determined based on the characteristics of key characters, thus making further identification of the attachment descriptions easier.
[0082] The attachment description content: Specifically, this can be the set of paragraphs in the identified attachment description excluding the first paragraph, and it can uniquely correspond to the first paragraph of an attachment description. It should be noted that since an attachment description may only have one paragraph, the attachment description content may not exist. When there are at least two paragraphs in the attachment description, it usually indicates that there are multiple attachments, which need to be identified using numbering.
[0083] The entirety of the attachment description: Specifically, it may include a header paragraph of the attachment description and the corresponding attachment description content, which can be used to indicate that this whole is the identified attachment description.
[0084] Furthermore, the concepts in the first paragraph of the above-mentioned appendix description and the content of the appendix description are merely descriptions used to distinguish different paragraphs in the appendix description for ease of description in this method flow, and the names themselves do not limit the scope of this method flow.
[0085] like Figure 4 As shown, Figure 4 This is a flowchart illustrating a method for identifying attachment descriptions according to an embodiment of the present invention. It includes the following steps.
[0086] S101: Obtain the document to be recognized.
[0087] Optionally, the document to be identified can be any document. For ease of description, the document used to identify the attachment description will be referred to as the document to be identified.
[0088] In one alternative embodiment, the electronic device used to edit the document to be identified can execute this method flow locally without interacting with other devices. In a specific example, this method flow can be implemented through local logic included in the document editing software client.
[0089] In another alternative embodiment, other electronic devices interacting with the electronic device editing the document to be identified can also execute this method flow. In a specific example, this method flow can be implemented through a server that interacts with a document editing software client.
[0090] Therefore, in one optional embodiment, the client can send any document to the server based on user actions. That is, the server receives the document to be identified from the client, enabling it to identify attachment descriptions within the document and return the identification result to the client. The identification result can be a document containing attachment description annotations, or it can be a paragraph identifier identified as an attachment description.
[0091] S102: Traverse each paragraph in the document to be identified, and determine the paragraph containing the key characters as the first paragraph of the attachment description.
[0092] In the correct format of official administrative documents, the first two characters of the attachment description are "attachment".
[0093] Therefore, in one alternative embodiment, the key characters may include "attachment," and it is necessary to determine that the first two characters of the paragraph are attachments. Specifically, the paragraph whose first two characters are attachments may be determined as the first paragraph of the attachment description.
[0094] However, users often make several non-standard or incorrect editing mistakes when editing documents. For example, they might edit "attachment" as "attached image"; or they might not edit "attachment" in the first two characters of a paragraph, but instead edit it in another position in the paragraph. A specific example is a user editing "attachment" as "The following is the name of the attachment".
[0095] To facilitate error correction, accommodate various non-standard or erroneous situations that may occur when users edit documents, and improve user experience, in an optional embodiment, the paragraph containing key characters can be designated as the first paragraph of the attachment description.
[0096] Optionally, keywords can be used to characterize the features described in the appendix. Specifically, the position or content of the keywords is not limited.
[0097] Optionally, keywords may include: attachments, figures, appendices, tables, supplementary documents, attachment names, attachment descriptions, or additional documents. Clearly, a paragraph containing any of the above keywords can be designated as the first paragraph of the attachment description, regardless of the keyword's position within the paragraph.
[0098] Optionally, the position of keywords within a paragraph can be specified. Specifically, paragraphs whose first few characters are keywords can be designated as the first paragraph of the appendix description.
[0099] Furthermore, in an alternative embodiment, the method for identifying attachment descriptions can be extended to other content with the same or similar format. Specifically, the format may include: the first paragraph containing keywords, and subsequent paragraphs having consecutive numeric numbering.
[0100] Different content can correspond to different keywords. For example, references. When identifying references, keywords can include "reference articles," "references," "bibliography," or simply "reference," etc.
[0101] Clearly, based on this method, it is easy to deduce other content recognition methods with the same or similar formats. This allows for convenient identification of content with the same or similar formats in a document and facilitates automatic formatting. These content recognition methods derived through simple deduction are all within the scope of this specification.
[0102] In an alternative embodiment, subsequent steps can be performed after traversing the document to be identified. Typically, one or more attachment description paragraphs can be identified in the document. Of course, if no attachment description paragraph is identified in the document, it indicates that no attachment description was identified, and subsequent steps are unnecessary.
[0103] S103: For each appendix description, determine the appendix description content corresponding to the first paragraph in the paragraph following the first paragraph.
[0104] Specifically, for each appendix description paragraph, the step of determining the corresponding appendix description content in S103 can be executed, so that each appendix description paragraph has a one-to-one corresponding appendix description content.
[0105] In one alternative embodiment, the content of the appendix description corresponding to the first paragraph of each appendix description may be determined in the paragraph following the first paragraph of the appendix description.
[0106] Based on the formatting regulations for attachment descriptions in official administrative documents, when there are multiple attachment names, Arabic numerals should be used to indicate the attachment sequence number, that is, a number with a numerical type, and the numbering should be consecutive.
[0107] Therefore, optionally, the appendix description content corresponding to the first paragraph of each appendix description determined in S103 may have a consecutive numbered sequence.
[0108] Furthermore, since the content of the appendix description is determined in the paragraphs following the first paragraph of the appendix description, there may be multiple sets of numbers in the paragraphs following the first paragraph of the appendix description. In order to improve the accuracy of the determined appendix description content, optionally, the paragraphs between the first paragraph of the appendix description and the first paragraph of the corresponding appendix description content are not numbered.
[0109] Therefore, optionally, for each appendix description first paragraph, the appendix description content corresponding to the appendix description first paragraph can meet the following two conditions: the paragraphs between the appendix description first paragraph and the first paragraph of the corresponding appendix description content do not have numbers, and the corresponding appendix description content has consecutive numbered numbers.
[0110] If the attachment description edited by the user contains only one attachment, then the attachment description typically does not contain a number. In an optional embodiment, there may not be any paragraphs in the paragraphs following the first paragraph of the attachment description that meet the above two conditions, and the attachment description content will be empty. Correspondingly, in S104, the first paragraph of the attachment description can be directly treated as a whole attachment description, thereby determining the attachment description that meets the user's needs.
[0111] If the attachment description edited by the user contains multiple attachments, the paragraph containing the names of the multiple attachments can have a number type, specifically Arabic numerals, and the numbering can be sequential. For example, 1, 2, 3, ... etc.
[0112] It should be clarified that the consecutive serial numbers indicate that the serial numbers are incremented sequentially, increasing by 1 each time.
[0113] Furthermore, since the first paragraph of the appendix description and the appendix description content are usually adjacent, and the next paragraph after the first paragraph of the appendix description usually belongs to the appendix description content, it is optional to limit that there is no paragraph between the first paragraph of the appendix description and the first paragraph of the corresponding appendix description content.
[0114] However, during the document editing process, there are also cases where other users make mistakes in editing, such as wrapping the content of the first paragraph of the attachment description to the next paragraph or several subsequent paragraphs, or other situations that cause a paragraph to exist between the first paragraph of the attachment description and the first paragraph of the corresponding attachment description content.
[0115] Specific error examples are shown below.
[0116] Attachment: 1. Environmental Protection Initiative on Further Rectifying the Deterioration of the Ecological Environment and the Surrounding Environment of Rural Areas in a Certain County, a Certain City, a Certain Province
[0117] 2. Public Opinion Collection Form Regarding Further Rectification of Ecological Environment Deterioration and Rural Surrounding Environment in a Certain County, a Certain City, a Certain Province
[0118] In one instance, the word "Initiative" in the name of the attachment with serial number 1 was incorrectly edited to the next paragraph, resulting in a paragraph gap between the first paragraph of the attachment description and the first paragraph of the corresponding attachment description content (i.e., the paragraph containing serial number 2).
[0119] To facilitate error tolerance and further simplify editing and use, a paragraph may be allowed between the first paragraph of the attachment description and the first paragraph of the corresponding attachment description content. However, to clarify the relationship between the first paragraph of the attachment description and the attachment description content, it may be stipulated that the paragraphs between the first paragraph of each attachment description and the first paragraph of the corresponding attachment description content are not numbered.
[0120] Obviously, if there is no paragraph between the first paragraph of the appendix description and the first paragraph of the corresponding appendix description content, then there is naturally no numbering, which satisfies the condition.
[0121] Therefore, when a user-edited attachment description contains multiple attachments, the above conditions can be used to determine the attachment description content that meets the user's needs.
[0122] When determining the content of the appendix description corresponding to the first paragraph of each appendix description through specific methods and steps, the determination can be based on the specific circumstances of each appendix description's first paragraph. Different circumstances can correspond to different determination methods.
[0123] This method does not limit the specific method for determining the content of the appendix description. Several embodiments are provided below for illustrative purposes.
[0124] In one alternative embodiment, in order to identify attachment descriptions with consecutive numerical numbers, the initial value of the current number to be added can be determined based on the first paragraph of each attachment description; the current number to be added can represent the number of the paragraph in the attachment description content corresponding to the first paragraph of each attachment description.
[0125] For example, if the paragraphs in the appendix description already contain consecutive numbered 1, 2, 3, the current number to be added is 4, which connects to 3, thus ensuring that the numbering in the appendix description is continuous.
[0126] Therefore, the following steps can be performed after each paragraph following the first paragraph of the attachment description: If the currently traversed paragraph has a numeric number and the number is the same as the current number to be added, then the currently traversed paragraph is added to the attachment description content corresponding to the first paragraph of the attachment description; the current number to be added is incremented by 1; if the currently traversed paragraph meets the preset conditions, then the traversal stops.
[0127] Specifically, by determining whether a paragraph has a current number to be added, and whether the paragraph belongs to the attachment description content, and by updating the current number to be added by 1 each time a paragraph is added to the attachment description content, the current number to be added can be used to ensure the continuity of the numbering.
[0128] In addition, the preset conditions may optionally include any of the following: the currently traversed paragraph has a non-numeric type number; the currently traversed paragraph has a numeric type number but the number sequence is different from the current sequence number to be added; the currently traversed paragraph is the last paragraph of the document to be identified.
[0129] The process stops iterating after reaching the last paragraph of the document to be identified, indicating that there are no further paragraphs. Similarly, it stops iterating when a paragraph with discontinuous numbering is encountered, indicating that subsequent paragraphs will not be consecutive and therefore do not belong to the attachment description content corresponding to the first paragraph of the attachment description. Specifically, this could be a paragraph with non-numeric numbering or a paragraph with numeric numbering but discontinuous numbering.
[0130] Of course, there are other ways to ensure that the serial numbers are consecutive.
[0131] It needs to be further clarified that different initial values for the current serial number to be added can correspond to different consecutive numbering patterns. For example, if the initial value of the current serial number to be added is 1, the serial numbers in the attachment description can start from 1 and continue consecutively; if the initial value of the current serial number to be added is 2, the serial numbers in the attachment description can start from 2 and continue consecutively.
[0132] The initial value of the serial number to be added will differ depending on the specific circumstances described in the first paragraph of the appendix. This method does not limit the specific method for determining the initial value; three examples are provided below for illustrative purposes.
[0133] Example 1.
[0134] In one optional embodiment, if the first paragraph of the appendix description does not have a number, the initial value of the current serial number to be added can be determined to be 1; if the first paragraph of the appendix description contains a number of type numeric, the initial value of the current serial number to be added can be determined to be the serial number contained in the first paragraph of the appendix description + 1.
[0135] In cases where the first paragraph of the attachment description does not have a number, it indicates that the attachment name may not be written in the first paragraph of the attachment description. Therefore, it can be determined that the initial value of the current serial number to be added is 1, so that the serial number in the attachment description content can start from 1 and continue continuously.
[0136] In official administrative documents, the first paragraph of the attachment description usually needs to include the attachment name. If there are multiple attachment names, the first paragraph should usually include the serial number 1.
[0137] However, users may make editing errors, causing the attachment name, which should have been numbered 1 at the beginning of the attachment description, to be moved to the next paragraph by a line break.
[0138] Specific error examples are shown below.
[0139] appendix:
[0140] 1. A proposal regarding further addressing the ecological degradation and surrounding rural environment in a certain county of a certain city in a certain province.
[0141] 2. Public Opinions on Further Rectifying the Deterioration of the Ecological Environment and the Surrounding Environment of Rural Areas in a Certain County, a Certain City, a Certain Province
[0142] In this case, to facilitate error tolerance and further make it easier for users to edit and use, the initial value of the current serial number to be added can be determined to be 1. The consecutive serial numbers can be identified starting from the paragraph with serial number 1 after the first paragraph of the attachment description, so that the serial numbers in the attachment description can start from 1 and continue.
[0143] If the first paragraph of the attachment description contains a numeric number, it indicates that there are multiple attachment names in the attachment description, and therefore, there are numbers. Therefore, the initial value of the current number to be added can be determined as the number contained in the first paragraph of the attachment description + 1, so that the numbering in the attachment description content can start consecutively from "the number contained in the first paragraph of the attachment description + 1".
[0144] For example, if the first paragraph of the attachment description contains the number 1, it means that there are multiple attachment names in the attachment description, and the attachment name with the number 1 has already been identified. Therefore, the initial value of the number to be added can be determined to be 2. Continuous numbering can be identified starting from the paragraph with the number 2 after the first paragraph of the attachment description, so that the numbering in the attachment description content can start from 2 and continue continuously.
[0145] Of course, if the user makes a mistake in editing, the first paragraph of the attachment description will contain a serial number greater than 1, for example, serial number 2. Specific examples of errors are shown below.
[0146] Attachment 2: Proposal on Further Rectifying the Deterioration of the Ecological Environment and the Surrounding Environment of Rural Areas in a Certain County, a Certain City, a Certain Province
[0147] 3. Public Opinions Regarding Further Rectification of the Deteriorating Ecological Environment and Rural Surrounding Environment in a Certain County, a Certain City, a Certain Province
[0148] In this scenario, to mitigate errors and facilitate user operation, the initial value of the current serial number to be added can be determined to be 3. Continuous serial numbers can be identified starting from the paragraph with serial number 3 after the first paragraph of the attachment description, ensuring that the serial numbers in the attachment description can start consecutively from 3.
[0149] Example 2.
[0150] In another optional embodiment, it can be first determined whether the first paragraph of the attachment description has a number. If it does have a number, it can then be further determined whether it contains a numeric number. This embodiment simplifies the determination process, allowing the initial value of the current sequence number to be added to be directly initialized if no number is found, thereby improving execution efficiency.
[0151] Optionally, it can specifically determine whether the first paragraph of the attachment description has a number. If the first paragraph of the attachment description does not have a number, the initial value of the current serial number to be added can be determined to be 1. If the first paragraph of the attachment description has a number, it can determine whether the number contained in the first paragraph of the attachment description is of numeric type. If the first paragraph of the attachment description contains a numeric type number, the initial value of the current serial number to be added can be determined to be the serial number contained in the first paragraph of the attachment description + 1.
[0152] Example 3.
[0153] If the first paragraph of the attachment description does not have a number, it may be because the attachment description only contains an attachment name, and there is no need to configure a number for the attachment name.
[0154] Specific examples are shown below.
[0155] Attachment: Proposal on Further Rectifying the Deterioration of the Ecological Environment and the Surrounding Environment of Rural Areas in a Certain County, a Certain City, a Certain Province
[0156] Therefore, the additional features of the first paragraph can be explained through the appendix to help determine whether the initial value of the current sequence number to be added should be 1.
[0157] When editing attachment descriptions, users may move the attachment name containing the serial number 1 to the next paragraph. Therefore, optionally, if the first paragraph of the attachment description does not have a number, and the next paragraph has a numeric number and the serial number of the next paragraph is 1, it is obvious that the attachment description corresponding to the first paragraph of the attachment description may not contain an attachment name. Thus, the initial value of the serial number to be added can be set to 1.
[0158] Specific examples are shown below.
[0159] appendix:
[0160] 1. A proposal regarding further addressing the ecological degradation and surrounding rural environment in a certain county of a certain city in a certain province.
[0161] 2. Public Opinions on Further Rectifying the Deterioration of the Ecological Environment and the Surrounding Environment of Rural Areas in a Certain County, a Certain City, a Certain Province
[0162] In addition, the determination can be made by checking whether the first paragraph of the attachment description itself contains the attachment name. Optionally, if the first paragraph of the attachment description ends with any of the following three conditions: a specified keyword, a specified keyword and a comma, or a specified keyword and a colon, then the first paragraph of the attachment description does not contain the attachment name, and therefore it will not be a case of "the attachment description contains only one attachment name". Therefore, the initial value of the current serial number to be added can be set to 1.
[0163] Specific examples are shown below.
[0164] appendix:
[0165] 1. A proposal regarding further addressing the ecological degradation and surrounding rural environment in a certain county of a certain city in a certain province.
[0166] 2. Public Opinions on Further Rectifying the Deterioration of the Ecological Environment and the Surrounding Environment of Rural Areas in a Certain County, a Certain City, a Certain Province. The designated keywords may include the key characters in S102.
[0167] Optionally, after the key character, the specified keyword may also include: at least one number and / or at least one letter. For example, Annex 1, Appendix A, etc.
[0168] Users may have made editing errors, resulting in letters or numbers remaining in the specified keywords. Specific examples of such errors are shown below.
[0169] Attachment 1:
[0170] 1. A proposal regarding further addressing the ecological degradation and surrounding rural environment in a certain county of a certain city in a certain province.
[0171] 2. Public Opinions on Further Rectifying the Deterioration of the Ecological Environment and the Surrounding Environment of Rural Areas in a Certain County, a Certain City, a Certain Province
[0172] In this case, to facilitate error tolerance and further make it easier for users to edit and use, the initial value of the current serial number to be added can be set to 1, so that consecutive serial numbers can be identified starting from the paragraph with serial number 1 after the first paragraph of the attachment description.
[0173] Optionally, regular expressions can also be used to identify the first paragraph of the attachment description. Specifically, regular expressions can be used to determine whether the paragraph contains keywords.
[0174] S104: For each appendix description's first paragraph, the appendix description content corresponding to the first paragraph and the appendix description's first paragraph are determined as a whole appendix description.
[0175] Typically, in attachment descriptions, multiple attachment names are separated by consecutive paragraphs, with each paragraph containing only one number and attachment name.
[0176] However, if a user makes an error while editing, they may wrap part of the attachment name to the next paragraph, and that paragraph cannot be recognized by the above steps.
[0177] Specific error examples are shown below.
[0178] Attachment: 1. Proposal on Further Rectifying the Deterioration of the Ecological Environment and Rural Environment in a Certain County, a Certain City, a Certain Province
[0179] 2. Feedback from the public regarding further measures to address the deterioration of the ecological environment and the surrounding rural environment in a certain county of a certain city in a certain province.
[0180] As can be seen, in the attachment title numbered 2, "Public Opinion Feedback" has been moved to the next paragraph, and since this paragraph is not numbered, it will not be added to the attachment description through the above steps.
[0181] Therefore, in an optional embodiment, in order to facilitate error tolerance and further facilitate user editing and use, all paragraphs between the first paragraph of the attachment description and the last paragraph of the attachment description content corresponding to the first paragraph of the attachment description can be defined as a whole attachment description.
[0182] It should be clarified that the appendix description should include at least the first paragraph and the content of the appendix description.
[0183] Optionally, before executing S104, for each attachment description first paragraph, a paragraph with non-empty content can be added to the attachment description content corresponding to the attachment description first paragraph, between the attachment description first paragraph and the last paragraph of the attachment description content corresponding to the attachment description first paragraph.
[0184] Clearly, the appendix descriptions determined by S104 are the result of identifying the appendix descriptions, that is, the identified appendix descriptions.
[0185] When the electronic device used to edit the document to be recognized executes this method locally, the layout format can be automatically adjusted directly based on the recognition results.
[0186] In an alternative embodiment, when other electronic devices interacting with the electronic device editing the document to be identified execute this method process, after determining all the attachment descriptions for the document to be identified as a whole, the identification result can be further returned to the electronic device editing the document to be identified. Of course, it can also be returned after adjusting the layout format.
[0187] Optionally, the paragraph identifier corresponding to each identified attachment description can be returned so that the layout can be adjusted for the paragraph corresponding to the received paragraph identifier.
[0188] Optionally, the overall layout of each identified attachment description in the document to be identified can be adjusted, and the adjusted document to be identified can be returned.
[0189] like Figure 5 As shown, Figure 5 This is a schematic diagram illustrating the principle of document interaction in a method for identifying attachment descriptions provided in an embodiment of the present invention.
[0190] In this process, the user can trigger an operation to identify attachment descriptions in a document via a client, causing the client to send the document to the server. The client can specifically be a document editing software.
[0191] After the server identifies the attachment description in the document to be identified, it can return the paragraph identifiers contained in the attachment description to the client.
[0192] In this embodiment, by returning the recognition results to the client, the client can automatically adjust the layout, thereby avoiding manual adjustments by the user, making the operation more convenient and improving the user experience.
[0193] Therefore, when applying the method provided in the embodiments of the present invention, by utilizing the characteristics of the attachment description, the first paragraph of the attachment description and the corresponding attachment description content are determined, and it is compatible with various situations in which users may make editing errors. It can identify attachment descriptions in many situations in complex document editing scenarios. Not only is it error-tolerant and convenient for users to edit and use, but it can also automatically adjust the identified attachment descriptions to the correct formatting, facilitating user operation and improving user experience.
[0194] The attachment descriptions identified through the above process can be used for subsequent proofreading and conversion of administrative documents.
[0195] Specifically, when using the administrative document proofreading function provided by the software, the above-mentioned method can be used to identify attachment descriptions in the document, and further check whether the formatting of the identified attachment descriptions complies with regulations. If it complies with regulations, a proofreading pass result is returned; if it does not comply with regulations, a proofreading fail result is returned, or the formatting of the identified attachment descriptions can be automatically adjusted to ensure that the adjusted formatting complies with regulations.
[0196] Alternatively, when using the administrative document conversion function provided by the software, the above-mentioned method can be used to identify the attachment descriptions in the document, and then the layout of the identified attachment descriptions can be automatically adjusted to conform to the prescribed layout format.
[0197] For ease of understanding, an application embodiment of the present invention is also disclosed.
[0198] like Figure 6 As shown, Figure 6 This is a flowchart of another method for identifying attachment descriptions provided in an embodiment of the present invention. To facilitate the differentiation of the first paragraph of attachment descriptions in different situations, attachment segmentation is used in this method, where attachment segmentation refers to the paragraph used to separate the main text and the attachments.
[0199] For ease of description, this method does not distinguish between the first paragraph of the attachment description and the content of the attachment description; the paragraph can be directly identified as the attachment description.
[0200] S201: Traverse each paragraph in the user document, identifying whether the paragraph is a sub-section for attachments based on its content. If it is not a sub-section for attachments, continue to identify whether it is an attachment description; if it is not an attachment description, identify it as something else. Execute S202 and S204 respectively. The execution order of S202 and S204 is not limited. They can be executed in parallel or sequentially.
[0201] Specifically, when identifying attachment splits, if a paragraph contains a key character but does not have a number, then the paragraph can be identified as an attachment split; if a paragraph contains a key character but is followed by a comma or colon without a number, then the paragraph can be identified as an attachment split.
[0202] When identifying attachment descriptions, if a paragraph contains key characters, it can be identified as an attachment description.
[0203] Key characters may include attachments, figures, tables, appendices, and supplementary documents.
[0204] S202: Traverse the paragraphs identified as attachment descriptions and determine whether a number is contained after a comma or colon in the paragraph. If a number is contained, proceed to S203.
[0205] S203: Traverse the paragraphs downwards, finding paragraphs with the same number type and consecutive numbers as the attachment description. These are all identified as attachment descriptions and collected in a single attachment description list, indicating that multiple paragraphs belong to the same attachment description. Traverse stops when encountering paragraphs with different number types or paragraphs with the same number type but non-consecutive numbers, and proceeds to S205.
[0206] S204: Traverse the paragraphs identified as attachments. If the next paragraph of an attachment segment contains a number of type numeric, traverse downwards to find paragraphs with consecutive numeric numbers, and mark them as attachment descriptions, collecting them in a list of attachment descriptions. This indicates that multiple paragraphs belong to the same attachment description. Also mark attachment segments as attachment descriptions and collect them in the list. Stop traversing when encountering paragraphs with different number types or paragraphs with the same number type but non-consecutive numbers, and proceed to S205.
[0207] S205: Iterate through the list of collected attachment descriptions, iterate through the paragraphs contained in each attachment description, and mark paragraphs that are identified as other paragraphs and whose content is not empty as attachment descriptions.
[0208] To facilitate further understanding, this invention also provides two specific application examples.
[0209] Application Example 1.
[0210] like Figure 7 As shown, Figure 7 This is a schematic diagram illustrating an attachment to be identified according to an embodiment of the present invention. It contains five paragraphs, which are also marked in the diagram.
[0211] The five paragraphs in the diagram are identified. The first paragraph, which contains the keyword "attachment" and has a number, is identified as the attachment description, while the second to fifth paragraphs are identified as other paragraphs, resulting in [1, Attachment Description], [2, Other], [3, Other], [4, Other] and [5, Other].
[0212] The first paragraph contains a number after the colon. The number type is numeric and the number is 1. Therefore, we search downwards for numbered paragraphs and find the paragraphs with consecutive numbers. That is, the third paragraph containing number 2 and the fifth paragraph containing number 3 are collected in an attachment description list, resulting in [[1,Attachment Description], [3,Attachment Description], [5,Attachment Description]].
[0213] Iterate through the paragraphs in the attachment description list, and mark the paragraphs that are identified as other paragraphs and whose content is not empty as attachment descriptions, resulting in [[1, Attachment Description], [2, Attachment Description], [3, Attachment Description], [4, Attachment Description], [5, Attachment Description]].
[0214] Therefore, paragraphs 1-5 can be identified as a whole appendix description.
[0215] Application Example 2.
[0216] like Figure 8 As shown, Figure 8 This is a schematic diagram illustrating another unidentified attachment provided in an embodiment of the present invention. It contains three paragraphs, which are already marked in the diagram.
[0217] The three paragraphs in the graph are traversed and identified. The first paragraph, which contains the keyword "attachment" but does not contain a number, is identified as an attachment segment, while the second and third paragraphs are identified as others, resulting in [1, Attachment Segment], [2, Other] and [3, Other].
[0218] If the next paragraph of the attachment is numbered, the number type is numeric, and the serial number is 1, then both the next paragraph of the attachment and the attachment section are identified as attachment descriptions, resulting in [1, Attachment Description], [2, Attachment Description], and [3, Other].
[0219] Traversing down the paragraphs, we find that the numbering type of the third paragraph is numeric, and its serial number is 2, which connects with the serial number 1 of the second paragraph. Therefore, the third paragraph can be identified as an attachment description, resulting in [1, Attachment Description], [2, Attachment Description], and [3, Attachment Description], which are collected in a list of attachment descriptions.
[0220] Iterate through the paragraphs in the attachment description list, and mark the paragraphs that are identified as other paragraphs and whose content is not empty as attachment descriptions, resulting in [[1, Attachment Description], [2, Attachment Description], [3, Attachment Description]].
[0221] Corresponding to the above-described method for identifying attachment descriptions, this embodiment of the invention also provides a device for identifying attachment descriptions.
[0222] like Figure 9 As shown, Figure 9 This is a schematic diagram of a device for identifying attachment descriptions provided in an embodiment of the present invention. The device may include the following modules.
[0223] The acquisition module 301 is used to acquire the document to be recognized.
[0224] The traversal module 302 is used to traverse each paragraph in the document to be identified and to determine the paragraph containing the key characters as the first paragraph of the attachment description.
[0225] The determination module 303 is used to determine the content of the attachment description corresponding to the first paragraph of the attachment description in the paragraphs following the first paragraph of the attachment description for each attachment description first paragraph; the content of the attachment description corresponding to each attachment description first paragraph has a consecutive number of numbers.
[0226] The merging module 304 is used to combine the attachment description content corresponding to the first paragraph of each attachment description into a single attachment description.
[0227] Optionally, the determining module 303 may include: an initialization submodule 3031, used to determine the initial value of the current serial number to be added based on the first paragraph of each attachment description; the current serial number to be added represents the serial number contained in the paragraph of the attachment description content corresponding to the first paragraph of the attachment description.
[0228] Add submodule 3032 to iterate through the paragraphs following the first paragraph of each attachment description and perform the following steps: if the currently iterated paragraph has a numeric number and the number is the same as the current number to be added, add the currently iterated paragraph to the attachment description content corresponding to the first paragraph of each attachment description; increment the current number to be added by 1; stop iterating if the currently iterated paragraph meets the preset conditions.
[0229] Optionally, the preset conditions in the submodule 3032 may include any of the following: the currently traversed paragraph has a non-numeric type number; the currently traversed paragraph has a numeric type number but the number sequence is different from the current number to be added; the currently traversed paragraph is the last paragraph of the document to be identified.
[0230] Optionally, the initialization submodule 3031 may include: an initial value determination submodule 3031a, used to determine the initial value of the current serial number to be added as 1 when the first paragraph of the appendix description does not have a number; and to determine the initial value of the current serial number to be added as the serial number contained in the first paragraph of the appendix description + 1 when the first paragraph of the appendix description contains a number of numeric type.
[0231] Optionally, the initialization submodule 3031 may include: a first judgment submodule 3031b, used to determine whether the first paragraph of the attachment description has a number, and if the first paragraph of the attachment description does not have a number, to determine that the initial value of the current serial number to be added is 1.
[0232] The second judgment submodule 3031c is used to determine whether the number contained in the first paragraph of the attachment description is of numeric type when the first paragraph of the attachment description has a number; and to determine that the initial value of the current serial number to be added is the serial number contained in the first paragraph of the attachment description + 1 when the first paragraph of the attachment description contains a numeric number.
[0233] Optionally, in module 303, the paragraphs between the first paragraph of each attachment description and the first paragraph of the corresponding attachment description content are not numbered.
[0234] Optionally, the merging module 304 includes: an overall determination submodule 3041, used to determine all paragraphs between the first paragraph of the attachment description and the last paragraph of the attachment description content corresponding to the first paragraph of the attachment description as a whole attachment description.
[0235] This invention also provides an electronic device, such as... Figure 10 As shown, it includes a processor 1001, a communication interface 1002, a memory 1003, and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other through the communication bus 1004.
[0236] Memory 1003 is used to store computer programs;
[0237] When the processor 1001 executes the program stored in the memory 1003, it implements the method for identifying the attachment description as described in any of the above embodiments.
[0238] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0239] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0240] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0241] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0242] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform the method for identifying the appendix description as described in any of the above embodiments.
[0243] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the method for identifying the appendix description as described in any of the above embodiments.
[0244] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0245] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0246] The various embodiments in this invention are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0247] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for identifying attachment descriptions, characterized in that, include: Obtain the document to be recognized; Traverse each paragraph in the document to be identified, and determine the paragraph containing key characters as the first paragraph of the attachment description. Here, key characters are used to characterize the character features of the attachment description, and the paragraph whose first few characters are key characters is determined as the first paragraph of the attachment description. For each attachment description's first paragraph, determine the attachment description content corresponding to each attachment description's first paragraph in the paragraphs following it. This includes: determining the initial value of the current to-be-added sequence number based on each attachment description's first paragraph; traversing the paragraphs following each attachment description's first paragraph and performing the following steps: if the currently traversed paragraph has a numeric number and the number is the same as the current to-be-added sequence number, add the currently traversed paragraph to the attachment description content corresponding to each attachment description's first paragraph; increment the current to-be-added sequence number by 1; stop traversing if the currently traversed paragraph meets a preset condition; the attachment description content corresponding to each attachment description's first paragraph has a consecutive numeric number. For each appendix description's first paragraph, the appendix description content corresponding to each appendix description's first paragraph and each appendix description's first paragraph are defined as a whole appendix description.
2. The method according to claim 1, characterized in that, The current number to be added represents the number of the paragraph to be added to the content of the attachment description corresponding to the first paragraph of each attachment description.
3. The method according to claim 2, characterized in that, The preset conditions include any one of the following: The currently traversed segment has a non-numeric type number; The currently traversed paragraph has a numeric type number, but the number sequence is different from the current sequence number to be added; The currently traversed paragraph is the last paragraph of the document to be identified.
4. The method according to claim 2, characterized in that, The process of determining the initial value of the current sequence number to be added based on the first paragraph of each attachment description includes: If the first paragraph of each attachment description does not have a number, the initial value of the current serial number to be added is determined to be 1; if the first paragraph of each attachment description contains a number, the initial value of the current serial number to be added is determined to be the serial number contained in the first paragraph of each attachment description + 1.
5. The method according to claim 2, characterized in that, The process of determining the initial value of the current sequence number to be added based on the first paragraph of each attachment description includes: Determine whether the first paragraph of each attachment description has a number. If the first paragraph of each attachment description does not have a number, determine that the initial value of the current serial number to be added is 1. If the first paragraph of each attachment description has a number, determine whether the number contained in the first paragraph of each attachment description is a numeric type; if the first paragraph of each attachment description contains a numeric type number, determine that the initial value of the current serial number to be added is the serial number contained in the first paragraph of each attachment description + 1.
6. The method according to claim 1, characterized in that, The paragraphs between the first paragraph of each attachment description and the first paragraph of the corresponding attachment description content are not numbered.
7. The method according to claim 1, characterized in that, The step of defining the attachment description content corresponding to the first paragraph of each attachment description and the first paragraph of each attachment description as a whole attachment description includes: The entire paragraphs between the first paragraph of each attachment description and the last paragraph of the attachment description content corresponding to the first paragraph of each attachment description are defined as a whole attachment description.
8. A device for identifying accessory descriptions, characterized in that, include: The acquisition module is used to acquire the document to be recognized; The traversal module is used to traverse each paragraph in the document to be identified, and to determine the paragraph containing key characters as the first paragraph of the attachment description. Here, key characters are used to characterize the character features of the attachment description, and the paragraph whose first few characters are key characters is determined as the first paragraph of the attachment description. A determination module is used to determine the attachment description content corresponding to the first paragraph of each attachment description in the paragraphs following the first paragraph of each attachment description. The determination module includes: an initialization submodule, used to determine the initial value of the current to-be-added sequence number based on the first paragraph of each attachment description; and an addition submodule, used to traverse the paragraphs following the first paragraph of each attachment description and perform the following steps: if the currently traversed paragraph has a numeric number and the number is the same as the current to-be-added sequence number, add the currently traversed paragraph to the attachment description content corresponding to the first paragraph of each attachment description; increment the current to-be-added sequence number by 1; stop traversing if the currently traversed paragraph meets a preset condition; the attachment description content corresponding to the first paragraph of each attachment description has a consecutive numeric number. The merging module is used to combine the attachment description content corresponding to each attachment description's first paragraph and each attachment description's first paragraph into a single attachment description.
9. The apparatus according to claim 8, characterized in that, The current number to be added represents the number of the paragraph to be added to the content of the attachment description corresponding to the first paragraph of each attachment description.
10. The apparatus according to claim 8, characterized in that, The merging module includes: The overall determination submodule is used to determine all paragraphs between the first paragraph of each attachment description and the last paragraph of the attachment description content corresponding to the first paragraph of each attachment description as a whole attachment description.
11. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-7.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-7.
Citation Information
Patent Citations
Typesetting method and device for text alignment in paragraph
CN101452445A
Paper document processing method and device, electronic equipment and storage medium
CN112651217A