Research report generation method, device, electronic device and computer-readable medium
By using the method of segmentation and chart feature extraction, the problems of large computing resource usage and document errors in research report form generation are solved, and efficient and accurate document generation and printing are achieved.
Patent Information
- Application Number
- CN202510144886.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-02-10
AI Technical Summary
In the existing technology, when generating research reports, the large amount of document content leads to excessive computing resources being occupied, and the formatting extraction of cross-page text and charts easily leads to document semantic errors and typesetting errors, resulting in a waste of printing resources.
By splitting the document into sections, extracting chart feature information, performing chart capture and document cross-page verification, integrating cross-page text, and building document forms, computing resource usage can be reduced and data loss can be avoided.
It reduces the usage of computing resources, improves the accuracy of document generation, and avoids document semantic errors and waste of printing resources.
Smart Images

Figure CN120106028B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of document recognition technology, and in particular to a method, device, electronic device, and computer-readable medium for generating a research report. Background Art
[0002] Generating research reports often requires more accurate document recognition technology. Currently, when generating forms, the common approach is to parse the entire document, identify document semantics and image semantics, and extract the document content.
[0003] However, in practice, it is found that when using the above method to generate research reports, the following technical problems often occur:
[0004] The document contains a lot of content. If all the text and image parsing are performed, a lot of computing resources will be required.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the Invention
[0006] The content of this disclosure is used to briefly introduce concepts that will be described in detail in the detailed description section below. The content of this disclosure is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0007] Some embodiments of the present disclosure propose research report generation methods, devices, electronic devices, and computer-readable media to solve one or more of the technical problems mentioned in the above background technology section.
[0008] In a first aspect, some embodiments of the present disclosure provide a method for generating a research report, the method comprising: obtaining a fixed document from a database; splitting the fixed document into sections according to the page number sequence of the fixed document to generate a set of split document data sequences, wherein each split document data in the split document data sequence set corresponds to a section of content in the fixed document; extracting chart features from the fixed document to obtain a chart feature information sequence, wherein each chart feature information in the chart feature information sequence includes a chart coordinate group; performing chart interception on the fixed document according to the chart feature information sequence to obtain a document chart sequence; performing document cross-page verification on each split document data sequence in the split document data sequence set to generate a document cross-page identification sequence, and performing document content cross-page integration on the split document data sequence corresponding to the document cross-page identification representing the document content cross-page in the document cross-page identification sequence to obtain an integrated document data sequence; constructing a document form corresponding to the fixed document based on the document chart sequence and each integrated document data sequence for storage.
[0009] In a second aspect, some embodiments of the present disclosure provide a research report generating device, which includes: an acquisition unit, configured to acquire a fixed document from a database; a splitting processing unit, configured to split the fixed document into sections according to the page number sequence of the fixed document to generate a split document data sequence set, wherein each split document data in the split document data sequence set corresponds to a section of content in the fixed document; a feature extraction unit, configured to extract chart features from the fixed document to obtain a chart feature information sequence, wherein each chart feature information in the chart feature information sequence includes a chart coordinate group; a chart interception unit, configured The fixed document is subjected to chart interception according to the chart feature information sequence to obtain a document chart sequence; the document cross-page verification and integration unit is configured to perform document cross-page verification on each split document data sequence in the split document data sequence set to generate a document cross-page identification sequence, and for the split document data sequence corresponding to the document cross-page identification representing the document content cross-page in the document cross-page identification sequence, perform document content cross-page integration on the split document data sequence to obtain an integrated document data sequence; the construction unit is configured to construct a document form corresponding to the fixed document based on the document chart sequence and each integrated document data sequence for storage.
[0010] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.
[0011] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation of the first aspect is implemented.
[0012] The above-described various embodiments of the present disclosure have the following beneficial effects: The research report generation method of some embodiments of the present disclosure can reduce computing resource usage. Specifically, the reason for the large amount of computing resources required is that the document contains a large amount of content, and performing text parsing and image parsing on all of it would require a large amount of computing resources. Based on this, the research report generation method of some embodiments of the present disclosure, first, considers that splitting a document into lines for recognition or semantic recognition consumes a lot of computing resources. Therefore, a fixed document is split into smaller paragraphs through a segment-by-segment splitting process. This reduces computing resource usage compared to splitting into finer lines. Secondly, by extracting chart coordinates, they can be used to locate the position of charts in the document. This can be used for chart capture. In addition, considering that the text of a document may span multiple pages, the text of the same paragraph may be divided into different paragraphs. Therefore, through document span verification, it is possible to identify whether text spans multiple pages. Next, through document content span integration, the same paragraph of text spanning multiple pages can be integrated into the same paragraph. This not only avoids data loss but also reduces computing resource usage. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0014] Figure 1 is a flow chart of some embodiments of the method for generating a research report form according to the present disclosure;
[0015] Figure 2 is a schematic diagram of a document content extraction process according to some embodiments of the research report form generation method disclosed herein;
[0016] Figure 3 It is a structural schematic diagram of some embodiments of the research report generating device according to the present disclosure;
[0017] Figure 4 is a schematic structural diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0018] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0019] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.
[0020] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0021] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0022] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0023] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0024] Figure 1 The process 100 of some embodiments of the method for generating a research report according to the present disclosure is shown. The method for generating a research report includes the following steps:
[0025] Step 101: Obtain a fixed document from a database.
[0026] In some embodiments, the execution entity of the research report generation method can obtain a fixed document from a database via a wired or wireless method. The database can be a pre-configured unit for storing user-uploaded documents. Furthermore, the fixed document can be a document with a fixed structure and format, such as a PDF (Powder Diffraction File) document.
[0027] It should be noted that the above-mentioned wireless connection methods may include but are not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0028] Step 102 : split the fixed document into sections according to the page number sequence of the fixed document to generate a set of split document data sequences.
[0029] In some embodiments, the execution entity may split the fixed document segment by segment according to the page number sequence of the fixed document to generate a set of split document data sequences, wherein each split document data in the set of split document data sequences may correspond to a segment of content in the fixed document.
[0030] In some optional implementations of some embodiments, the execution entity splits the fixed document segment by segment according to the page number sequence of the fixed document to generate a split document data sequence set, which may include the following steps:
[0031] The first step is to identify the page numbers of each page in the fixed document. Here, a pre-set PDF page number recognition function can be used to identify the page numbers of each page in the fixed document.
[0032] As an example, you can use a VBA (Visual Basic for Applications) algorithm to read the binary content of a PDF file to identify the page number. The specific steps are as follows: First, open the PDF file in binary mode. Then, read the file content and use a regular expression to match the number after " / Count". Finally, extract the last matching item and remove " / Count" to obtain the page number.
[0033] The second step is to split the fixed document page by page according to the order of the page numbers to obtain a document split page sequence.
[0034] The third step is to identify the paragraph information in each document split page in the above-mentioned document split page sequence, and to perform paragraph splitting on the document split page according to the paragraph information to generate a set of split document data sequences. Among them, the indentation value of the first word in each line can be identified. If the indentation amount is 2 characters, the line is determined to be the starting line of a paragraph. Secondly, the text content from one starting line to the next starting line can be determined as a paragraph of text. Finally, the paragraph of text can be determined as paragraph information according to the paragraph order. Thus, the position of each paragraph can be determined. Afterwards, the paragraph splitting can be performed according to the paragraph position in the paragraph information, that is, the text of each paragraph is determined as the split document data. Here, each split document data sequence can correspond to a page of text in the above-mentioned fixed document.
[0035] As an example, you can use libraries such as pdfplumber and fitz to extract the text of each paragraph in a document split.
[0036] In practice, PyMuPDF is comprehensive, capable of not only extracting PDF content but also editing, deleting, and adding content. However, the extracted content only supports text and inserted images. The PDFMiner3k algorithm offers extremely high extraction efficiency, utilizing a specific delayed parsing mechanism to maximize parsing efficiency and effectiveness. However, it lacks the ability to parse images and tables. Furthermore, handling content and tables that span multiple pages within a PDF is a common problem in extraction.
[0037] While employing technical solutions to address the issues mentioned in the background, a second technical problem often arises: documents often contain a large amount of text and graphics that span multiple pages. Performing a formatted, one-to-one extraction easily results in the same paragraph of text or the same graphic being split into multiple parts, leading not only to semantic errors but also to document layout errors. Consequently, when printing forms, incorrect forms are printed, wasting printing resources. To address this second technical problem, the inventors have decided to adopt the following solution.
[0038] Step 103: extract chart features from the fixed document to obtain a chart feature information sequence.
[0039] In some embodiments, the execution entity may extract chart features from the fixed document to obtain a chart feature information sequence.
[0040] In some optional implementations of some embodiments, the execution entity extracts chart features from the fixed document to obtain a chart feature information sequence, which may include the following steps:
[0041] The first step is to extract chart labels from each of the split document data in the above-mentioned split document data sequence set to generate a picture label sequence and a table label sequence. Each picture label in the above-mentioned picture label sequence may include: picture sequence label coordinates and picture source label coordinates. Each table label in the above-mentioned table label sequence may include: table sequence label coordinates and table source coordinates. Here, a PDF parsing algorithm can be used to extract chart labels from each of the split document data in the above-mentioned split document data sequence set to generate a picture label sequence and a table label sequence.
[0042] As an example, the PDF parsing algorithm may include but is not limited to at least one of the following: PDFPageInterpreter interpreter, PDFParser parsing library.
[0043] In the second step, for each image tag in the above image tag sequence, perform the following image extraction steps:
[0044] Step 1: perform label matching on the above image label with other image labels in the above image label sequence to generate an image matching label. Label matching is performed by the following steps:
[0045] First, determine the coordinate interval between the coordinates of the image sequence number tag and the coordinates of the image source tag in the above-mentioned image tag. The coordinate interval can be the interval between the minimum vertical coordinate and the maximum vertical coordinate between the coordinates of the image sequence number tag and the coordinates of the image source tag. Here, the vertical coordinate can be the vertical coordinate of the document.
[0046] Then, in response to the existence of image sequence tag coordinates and / or image source tag coordinates in the other image tags being within the above coordinate interval, a match is determined with the above image tag. The existence of image sequence tag coordinates and / or image source tag coordinates being within the above coordinate interval indicates that the image corresponding to the image sequence tag coordinates and / or image source tag coordinates and the image corresponding to the above image tags are in the same section in the document.
[0047] Step 2: In response to the absence of other image tags matching the image tag, the image position is located based on the image sequence tag coordinates and the image source tag coordinates included in the image tag to obtain an image position coordinate set. The image position coordinate set can be obtained by using the PDF parsing algorithm to locate the image coordinates in the area between the image sequence tag coordinates and the image source tag coordinates.
[0048] Step 3, in response to the existence of other picture tags that match the above picture tag, determine that the pictures corresponding to the above picture tag and the above other picture tags are in the same paragraph, and locate the picture position according to the picture sequence number tag coordinates and the picture source tag coordinates included in the above picture tag and the above other picture tags, and obtain a picture position coordinate group. Among them, the minimum horizontal coordinate and the minimum vertical coordinate of the picture sequence number tag coordinates and the picture source tag coordinates can be used as the coordinates of the upper left corner of the picture, and the maximum horizontal coordinate and the maximum vertical coordinate can be used as the coordinates of the lower right corner of the picture. Secondly, the coordinates of the upper left corner of the picture and the coordinates of the lower right corner of the picture can be determined as the picture position coordinate group.
[0049] Step 4: Cropping the fixed-type document according to the positions of the image coordinates in the image coordinate group to generate a document image. A cropping function can be used to crop the fixed-type document according to the positions of the image coordinates in the image coordinate group to generate a document image. Here, a proportional processing can be performed based on the size of the PDF-to-image and the size of the PDF page itself. Furthermore, during the image cropping process, an offset can be added to the image coordinates to avoid cropping to the document boundary.
[0050] The third step is to determine the table tags in the above table tag sequence that lack table number tag coordinates or table source coordinates as cross-page table tags. Here, since the document is identified by page, the lack of tag coordinates can indicate that the table spans pages.
[0051] In the fourth step, for each spread table tag, according to the preset tag source order, the spread table tag corresponding to the spread table tag is determined as the table tag to be spliced.
[0052] In a fifth step, the fixed document table area is cropped based on the table sequence tag coordinates and the table source coordinates included in each table tag in the table tag sequence to generate a cropped document table sequence. Specifically, the fixed document table area can be cropped based on the upper left corner coordinates and lower right corner coordinates of the table sequence tag coordinates and the table source coordinates to generate the cropped document table sequence.
[0053] In the sixth step, based on each cross-page table tag and the corresponding table tag to be spliced, the cropped document tables corresponding to the same cross-page table in the above-mentioned cropped document table sequence are spliced to obtain a spliced document table. Among them, each cross-page table tag and the corresponding cropped document table with the spliced table tag can be spliced to obtain a spliced document table. Here, the splicing can be top-to-bottom splicing, that is, the cropped document table with the table sequence number tag is on the top, and the cropped document table with the table source coordinates is spliced at the bottom.
[0054] In the seventh step, each document image and its corresponding image label, as well as each spliced document table and its corresponding table label, are respectively determined as chart feature information to obtain a chart feature information sequence. Each document image and its corresponding image label can be determined as chart feature information. Alternatively, the spliced document table and its corresponding table label can be determined as chart feature labels, and the chart feature information sequence is formed by combining the document page numbers corresponding to the image document and the spliced document table.
[0055] Step 104 , performing chart interception on the fixed document according to the chart feature information sequence to obtain a document chart sequence.
[0056] In some embodiments, the execution entity may perform chart interception on the fixed document according to the chart feature information sequence to obtain a document chart sequence.
[0057] In some optional implementations of some embodiments, the execution subject intercepts the chart of the fixed document according to the chart feature information sequence to obtain the document chart sequence, which may include the following steps: for each chart feature information in the chart feature information sequence, executing the following steps:
[0058] The first step is to determine the document page corresponding to the chart feature information in the fixed document as the target document page, wherein the target document page can be identified by a page number.
[0059] In the second step, the target document page is captured according to the chart coordinates of the chart coordinate group included in the chart feature information to obtain a document chart. The minimum horizontal coordinate and the minimum vertical coordinate in the chart coordinates can be used as the coordinates of the upper left corner of the chart, and the maximum horizontal coordinate and the maximum vertical coordinate can be used as the coordinates of the lower right corner of the chart. Furthermore, the coordinates of the upper left corner and the coordinates of the lower right corner of the chart can be determined as a chart position coordinate group. Finally, the chart is captured according to the chart position coordinates to obtain a document chart.
[0060] Step 105: Perform document cross-page verification on each split document data sequence in the above-mentioned split document data sequence set to generate a document cross-page identification sequence, and for the split document data sequences corresponding to the document cross-page identification representing the document content cross-page in the above-mentioned document cross-page identification sequence, perform document content cross-page integration on the above-mentioned split document data sequences to obtain an integrated document data sequence.
[0061] In some embodiments, the above-mentioned execution entity can perform document cross-page verification on each split document data sequence in the above-mentioned split document data sequence set to generate a document cross-page identification sequence, and for the split document data sequence corresponding to the document cross-page identification representing the document content cross-page in the above-mentioned document cross-page identification sequence, perform document content cross-page integration on the above-mentioned split document data sequence to obtain an integrated document data sequence.
[0062] In some optional implementations of some embodiments, the execution entity performs a document cross-page check on each split document data sequence in the split document data sequence set to generate a document cross-page identification sequence, and performs document content cross-page integration on the split document data sequences corresponding to the document cross-page identification representing the document content cross-page in the document cross-page identification sequence to obtain an integrated document data sequence, which may include the following steps:
[0063] For each split document data sequence in the above split document data sequence set, perform the following steps:
[0064] The first step is to perform text segment recognition on the last split document data in the above split document data sequence to determine whether the last split document data is a cross-page text. In this case, the above PDF parsing algorithm can be used to identify whether the last split document data ends with a period.
[0065] In the second step, in response to the above, a document spread identifier corresponding to the last split document data is generated. If there is no period, a document spread identifier corresponding to the last split document data is generated. Here, the page number of the split document data sequence can be used as the document spread identifier.
[0066] For the split document data sequence corresponding to the document page span identifier representing the document content page span in the above document page span identifier sequence, the following steps are performed:
[0067] In the first step, data fusion is performed on the last split document data in the split document data sequence and the first split document data in the next page of the split document data sequence adjacent to the split document data sequence to obtain fused document data. The data fusion may be performed by sequentially concatenating the text of the last split document data and the first split document data in the next page of the split document data sequence adjacent to the split document data sequence to form new text data to obtain fused document data.
[0068] The second step is to perform title text deduplication processing on the fused document data to obtain deduplicated document data, wherein the split document data corresponding to the fused document data is removed.
[0069] In the third step, the duplicate-free document data and other split document data in the split document data sequence are determined as an integrated document data sequence.
[0070] As an example, the document content extraction process for a fixed document can be as follows: Figure 2 As shown, the current PDF parsing method is mainly used to parse the research report file page by page, and each page of the research report file is divided into blocks. Each block contains many lines, and the lines are divided into different small fragments. Although this method obtains the details of every text in the research report, it is still too cumbersome for paragraph extraction. After the text extraction optimization operation specialized for the research report, the above details can be shielded, and when used, the paragraph corresponding to the block can be directly obtained. The rules include blank lines between paragraphs and paragraphs next to the title, and the positioning and cropping of charts.
[0071] Step 106 : constructing a document form corresponding to the fixed document based on the document chart sequence and each integrated document data sequence for storage.
[0072] In some embodiments, the execution entity may construct a document form corresponding to the fixed document based on the document chart sequence and each integrated document data sequence for storage.
[0073] In some optional implementations of some embodiments, the execution entity constructs a document form corresponding to the fixed document based on the document chart sequence and each integrated document data sequence, which may include the following steps:
[0074] The document charts in the document chart sequence and the integrated document data in the integrated document data sequence are laid out according to a preset document layout model to generate a document form. The document layout model may be a preset template. Document layout may involve rearranging the document to generate a non-fixed document, i.e., a document form.
[0075] Optionally, in response to receiving a print instruction for the document form, the execution entity sends the document form to a printing device for printing the form file. The print instruction is used to instruct the printing device to print target content in the document form, and the target content may include but is not limited to at least one of the following: a document image, a document table, and a document structure diagram.
[0076] Steps 103-106 and their related content, as an inventive feature of an embodiment of the present disclosure, address the second technical problem mentioned in the background art: "Documents often contain a large amount of text and charts that span multiple pages. If a formatted one-to-one extraction is performed, the same paragraph of text or the same chart is easily segmented into multiple pieces, resulting in not only incorrect document semantics but also document layout errors. Consequently, when printing a form, the wrong form is printed, wasting printing resources." Factors that often lead to this waste of printing resources are as follows: Documents often contain a large amount of text and charts that span multiple pages. If a formatted one-to-one extraction is performed, the same paragraph of text or the same chart is easily segmented into multiple pieces, resulting in not only incorrect document semantics but also document layout errors. Consequently, when printing a form, the wrong form is printed. To achieve this, first, by performing front-to-back comparison and recognition on the paginated document, it can be used to determine whether text segmentation exists. This can then be used to merge the segmented text to avoid separating the same paragraph of text. Next, consider the fact that image or chart recognition requires a large amount of computing resources. Therefore, by identifying the coordinates of the serial number label in the upper left corner of the picture and table and the coordinates of the source label in the lower left corner, the position of the picture and table can be used to locate the position. Here, the situation where multiple pictures or forms are in the same row is also taken into account. Therefore, by distinguishing the positions of different coordinates, it is possible to determine whether the picture and table are in the same section. In this way, the complete picture and table can be accurately captured. Avoid the problem of missing. Thus, the accuracy of the generated document form can be ensured. Furthermore, the waste of printing resources is avoided.
[0077] The above-described various embodiments of the present disclosure have the following beneficial effects: The research report generation method of some embodiments of the present disclosure can reduce computing resource usage. Specifically, the reason for the large amount of computing resources required is that the document contains a large amount of content, and performing text parsing and image parsing on all of it would require a large amount of computing resources. Based on this, the research report generation method of some embodiments of the present disclosure, first, considers that splitting a document into lines for recognition or semantic recognition consumes a lot of computing resources. Therefore, a fixed document is split into smaller paragraphs through a segment-by-segment splitting process. This reduces computing resource usage compared to splitting into finer lines. Secondly, by extracting chart coordinates, they can be used to locate the position of charts in the document. This can be used for chart capture. In addition, considering that the text of a document may span multiple pages, the text of the same paragraph may be divided into different paragraphs. Therefore, through document span verification, it is possible to identify whether text spans multiple pages. Next, through document content span integration, the same paragraph of text spanning multiple pages can be integrated into the same paragraph. This not only avoids data loss but also reduces computing resource usage.
[0078] Further references Figure 3 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of the apparatus of some embodiments of the research report form generation method. These apparatus embodiments are similar to Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0079] like Figure 3As shown, the apparatus 300 of some embodiments of the research report form generation method of some embodiments includes: an acquisition unit 301, a splitting processing unit 302, a feature extraction unit 303, a chart interception unit 304, a document cross-page verification and integration unit 305 and a construction unit 306. Among them, the acquisition unit 301 is configured to acquire a fixed document from a database; the splitting processing unit 302 is configured to split the fixed document segment by segment according to the page number sequence of the fixed document to generate a split document data sequence set, wherein each split document data in the split document data sequence set corresponds to a section of content in the fixed document; the feature extraction unit 303 is configured to extract chart features from the fixed document to obtain a chart feature information sequence, wherein each chart feature information in the chart feature information sequence includes a chart coordinate group; the chart interception unit 304 is configured to extract chart features from the fixed document to obtain a chart feature information sequence, wherein each chart feature information in the chart feature information sequence includes a chart coordinate group; the chart interception unit 304 is configured to extract chart features from the fixed document to obtain a chart feature information sequence according to the chart feature information sequence. The fixed-type document is subjected to chart interception to obtain a document chart sequence; the document cross-page verification and integration unit 305 is configured to perform document cross-page verification on each split document data sequence in the split document data sequence set to generate a document cross-page identification sequence, and for the split document data sequence corresponding to the document cross-page identification representing the document content cross-page in the document cross-page identification sequence, perform document content cross-page integration on the split document data sequence to obtain an integrated document data sequence; the construction unit 306 is configured to construct a document form corresponding to the fixed-type document based on the document chart sequence and each integrated document data sequence for storage.
[0080] It is understood that the units described in the device 300 are similar to those in the reference Figure 1 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 300 and the units included therein, and will not be repeated here.
[0081] Reference below Figure 4 , which shows a structural schematic diagram of an electronic device (eg, a computing device) 400 suitable for implementing some embodiments of the present disclosure. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0082] like Figure 4As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory 402 or a program loaded from a storage device 408 into a random access memory 403. Various programs and data required for the operation of the electronic device 400 are also stored in the random access memory 403. The processing device 401, the read-only memory 402, and the random access memory 403 are connected to each other via a bus 404. An input / output interface 405 is also connected to the bus 404.
[0083] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 4 Each block shown in the figure may represent one device, or may represent multiple devices as needed.
[0084] In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from a network via the communication device 409, or installed from the storage device 408, or installed from the read-only memory 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of some embodiments of the present disclosure are performed.
[0085] It should be noted that the computer-readable medium described in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0086] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0087] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a fixed document from a database; splits the fixed document into sections according to the page number sequence of the fixed document to generate a set of split document data sequences, wherein each split document data in the split document data sequence set corresponds to a section of content in the fixed document; extracts chart features from the fixed document to obtain a chart feature information sequence, wherein each chart feature information in the chart feature information sequence includes a chart coordinate group; performs chart interception on the fixed document according to the chart feature information sequence to obtain a document chart sequence; performs document cross-page verification on each split document data sequence in the split document data sequence set to generate a document cross-page identification sequence, and performs document content cross-page integration on the split document data sequence corresponding to the document cross-page identification representing the document content cross-page in the document cross-page identification sequence to obtain an integrated document data sequence; constructs a document form corresponding to the fixed document based on the document chart sequence and each integrated document data sequence for storage.
[0088] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0089] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0090] The units described in some embodiments of the present disclosure may be implemented in software or hardware. The units described may also be provided in a processor. For example, they may be described as follows: a processor including an acquisition unit, a splitting processing unit, a feature extraction unit, a chart interception unit, a document cross-page verification unit, an integration unit, and a construction unit. The names of these units do not, in some cases, constitute limitations on the units themselves. For example, the acquisition unit may also be described as a "unit for acquiring fixed documents from a database."
[0091] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0092] The above description is only an illustration of some preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.
Claims
1. A method for generating a research report form, comprising: Get fixed documents from the database; According to the page number sequence of the fixed document, the fixed document is segmented to generate a split document data sequence set, wherein each split document data in the split document data sequence set corresponds to a section of content in the fixed document; Extracting chart features from the fixed document to obtain a chart feature information sequence, wherein each chart feature information in the chart feature information sequence includes a chart coordinate group; Performing chart interception on the fixed document according to the chart feature information sequence to obtain a document chart sequence; Performing a document span check on each split document data sequence in the split document data sequence set to generate a document span identification sequence, and performing document content span integration on the split document data sequences corresponding to the document span identification representing the document content span in the document span identification sequence to obtain an integrated document data sequence, including: For each split document data sequence in the split document data sequence set, perform the following steps: Performing text segment recognition on the last split document data in the split document data sequence to determine whether the last split document data is a cross-page text; In response to this, a document cross-page identifier corresponding to the last split document data is generated: For the split document data sequence corresponding to the document page span identifier representing the document content page span in the document page span identifier sequence, the following steps are performed: fusing the last split document data in the split document data sequence with the first split document data in the next page of the split document data sequence adjacent to the split document data sequence to obtain fused document data; Deduplication of title texts on the fused document data to obtain deduplication document data; Determining the deduplicated document data and other split document data in the split document data sequence as an integrated document data sequence; Based on the document chart sequence and each integrated document data sequence, a document form corresponding to the fixed document is constructed for storage.
2. The method according to claim 1, wherein The method further comprises: In response to receiving a print instruction for the document form, the document form is sent to a printing device to print the form file, wherein the print instruction is used to instruct the printing device to print the target content in the document form, and the target content includes at least one of the following: a document picture, a document table, and a document structure diagram.
3. The method according to claim 1, wherein The step of splitting the fixed document into sections according to the page number sequence of the fixed document to generate a set of split document data sequences includes: Identifying page numbers of each page in the fixed document; Splitting the fixed document page by page according to the order of the page numbers to obtain a document split page sequence; The paragraph information in each document split page in the document split page sequence is identified, and the document split page is split into paragraphs according to the paragraph information to generate a split document data sequence set.
4. The method according to claim 1, wherein The step of intercepting a chart of the fixed document according to the chart feature information sequence to obtain a document chart sequence includes: for each chart feature information in the chart feature information sequence, performing the following steps: Determining a document page corresponding to the chart feature information in the fixed document as a target document page; According to each chart coordinate of the chart coordinate group included in the chart feature information, the target document page is subjected to chart interception to obtain a document chart.
5. The method according to claim 4, wherein The step of constructing a document form corresponding to the fixed document based on the document chart sequence and each integrated document data sequence includes: According to a preset document layout model, document layout is performed on each document chart in the document chart sequence and each integrated document data in the integrated document data sequence to generate a document form.
6. A research report form generating device, comprising: an acquisition unit configured to acquire a fixed document from a database; a splitting processing unit configured to split the fixed-type document segment by segment according to the page number sequence of the fixed-type document to generate a split document data sequence set, wherein each split document data in the split document data sequence set corresponds to a segment of content in the fixed-type document; a feature extraction unit configured to extract chart features from the fixed document to obtain a chart feature information sequence, wherein each chart feature information in the chart feature information sequence includes a chart coordinate group; a chart interception unit configured to intercept the chart of the fixed document according to the chart feature information sequence to obtain a document chart sequence; The document cross-page verification and integration unit is configured to perform document cross-page verification on each split document data sequence in the split document data sequence set to generate a document cross-page identification sequence, and for the split document data sequence corresponding to the document cross-page identification representing the document content cross-page in the document cross-page identification sequence, perform document content cross-page integration on the split document data sequence to obtain an integrated document data sequence, including: for each split document data sequence in the split document data sequence set, performing the following steps: performing text segment recognition on the last split document data in the split document data sequence to determine whether the last split document data is a cross-page text ; In response, a document spread identifier corresponding to the last split document data is generated: for the split document data sequence corresponding to the document spread identifier representing the document content spread in the document spread identifier sequence, the following steps are performed: the last split document data in the split document data sequence is data-fused with the first split document data in the next page split document data sequence adjacent to the split document data sequence to obtain fused document data; the fused document data is subjected to title text deduplication processing to obtain deduplicated document data; the deduplicated document data and other split document data in the split document data sequence are determined as an integrated document data sequence; The construction unit is configured to construct a document form corresponding to the fixed document based on the document chart sequence and each integrated document data sequence for storage.
7. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer-readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Text processing method and device
CN113362026A
Digital delivery system based on digital twinborn body
CN115496452A