Document induction method and device and electronic equipment

Through natural language processing technology, text extraction and key statement calculation of PDF documents is solved, and the problem of difficult to understand and efficient retrieval of traditional PDF reading methods is achieved quickly to obtain core points and automatically generate bookmark directories, improving information acquisition and browsing efficiency .

CN118964293APending Publication Date: 2024-11-15WONDERSHARE TECHNOLOGY (HUNAN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411154412.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Traditional PDF document reading methods are difficult to achieve in-depth understanding and efficient retrieval of document content. They are limited to static text and image display, and cannot quickly obtain the core points of the document.

Method used

Through natural language processing technology, the text content of PDF documents is extracted, sentence-breaking and key statement calculations are calculated, and the text vector weighted summing and cosine similarity sorting are used to automatically generate bookmark catalogs to improve the speed and accuracy of information acquisition.

Benefits of technology

It realizes the core points of quickly and accurately obtaining PDF documents, saves reading and understanding time, and automatically generates accurate bookmarks, improving user browsing and searching efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964293A_ABST
    Figure CN118964293A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a document induction method. The document induction method comprises the following steps: extracting text contents of a PDF (Portable Document Format) document; key statements of text content of the PDF document are obtained; and summarizing and concluding the key statements through a natural language processing technology. According to the document induction method provided by the embodiment of the invention, the PDF document can be inducted and summarized through a natural language processing technology, so that the speed and accuracy of PDF document information acquisition are improved. The embodiment of the invention further provides a document summarization device and electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of document processing technology, and more specifically, to a document summarization method, device, and electronic device. Background Art

[0002] PDF (Portable Document Format) is a commonly used electronic document format with the advantages of being cross-platform, easy to spread and protecting content. PDF files can encapsulate text, fonts, formats, colors, and graphics and images that are independent of equipment and resolution in one file. This format file can also contain electronic information such as hypertext links, sounds and dynamic images, and this format supports special-length files, with high integration and security reliability.

[0003] With the rapid development of the digital age, PDF documents, as a cross-platform document format, are widely used in various fields, such as academic research, business documents, legal documents, etc. However, traditional PDF reading methods are often limited to static text and image display, making it difficult to achieve in-depth understanding and efficient retrieval of document content. Summary of the invention

[0004] In response to the problems existing in the above-mentioned prior art, the embodiments of the present application provide a document summarization method, device, and electronic device, which can summarize PDF documents through natural language processing technology, thereby improving the speed and accuracy of PDF document information acquisition.

[0005] In a first aspect, an embodiment of the present application provides a document summarization method, comprising:

[0006] Extract text content from PDF documents;

[0007] Obtaining key sentences of the text content of the PDF document; and

[0008] The key sentences are summarized and generalized through natural language processing technology.

[0009] Furthermore, the obtaining of key sentences of the text content of the PDF document includes:

[0010] Calculate a text vector for each sentence of the PDF document;

[0011] Performing weighted summation on the text vectors of each sentence to obtain a weighted vector; and

[0012] According to the cosine similarity between the text vector of each sentence in the PDF document and the weighted vector, key sentences of the text content of the PDF document are obtained.

[0013] Furthermore, before calculating the text vector of each sentence of the PDF document, the method further includes:

[0014] Sentence segmentation is performed on the text content of the PDF document.

[0015] Furthermore, the sentence segmentation processing of the text content of the PDF document includes:

[0016] The text content of the PDF document is segmented according to punctuation marks.

[0017] Furthermore, obtaining key sentences of the text content of the PDF document according to the cosine similarity between the text vector of each sentence of the PDF document and the weighted vector includes:

[0018] comparing the cosine similarity of the text vector of each sentence of the PDF document with the weighted vector; and

[0019] The calculated cosine similarity values ​​are sorted to obtain key sentences of the text content of the PDF document.

[0020] Furthermore, the calculated cosine similarity values ​​are sorted to obtain key sentences of the text content of the PDF document, including:

[0021] sorting the calculated cosine similarity values ​​in descending order; and

[0022] Sentences corresponding to the first N cosine similarity values ​​are obtained, thereby obtaining key sentences of the text content of the PDF document, where N is an integer and N is greater than or equal to 1.

[0023] Furthermore, extracting the text content of the PDF document includes:

[0024] Extract text content from PDF documents using OCR technology.

[0025] In a second aspect, the embodiment of the present application further provides a document summarization device, including:

[0026] Text extraction module, used to extract text content from PDF documents;

[0027] A sentence acquisition module, used to acquire key sentences of the text content of the PDF document; and

[0028] The summarization module is used to summarize the key sentences through natural language processing technology.

[0029] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to implement the document summarization method according to the first aspect when executing the program.

[0030] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, wherein the computer program is used to implement the document summarization method according to the first aspect above.

[0031] The embodiments of the present application bring the following beneficial effects:

[0032] The document summarization method provided in the embodiment of the present application parses the structural information of a PDF document, identifies the title of the PDF document, and automatically generates a bookmark directory for the PDF document according to the identified title of the PDF document, and finally adds the generated bookmark directory to the PDF document. This method can solve the problem of being cumbersome and error-prone in manually adding a bookmark directory for a PDF document, thereby automatically generating a relatively accurate bookmark directory to improve the efficiency of users in browsing and searching for PDF document content. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0034] Figure 1 A flowchart of a document summarization method provided in an embodiment of the present application;

[0035] Figure 2 A structural block diagram of a document summarization device provided in an embodiment of the present application;

[0036] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0037] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments described in the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0039] In the specification and claims of this application and the above-mentioned drawings, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "multiple" means two or more. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to the specific circumstances.

[0040] Figure 1 FIG. 1 is a flowchart of a document summarization method according to an embodiment of the present application. Figure 1 As shown, the document summarization method of the embodiment of the present application includes the following steps:

[0041] S101: extracting text content of a PDF document;

[0042] Specifically, PDF document is a commonly used electronic document format, which has the advantages of cross-platform, easy dissemination and content protection. PDF file can encapsulate text, fonts, formats, colors and graphics images independent of equipment and resolution in one file. Traditional PDF documents are static.

[0043] Extract the text content of a PDF document, that is, automatically obtain the text part of the PDF document, so as to facilitate subsequent operations.

[0044] S102: Acquire key sentences of the text content of the PDF document;

[0045] Specifically, when processing and reading a large number of PDF documents, users usually need to quickly understand the main content, key information and author's point of view of the document. After automatically extracting the text content of the PDF document, it is necessary to obtain the key sentences of the text content of the PDF document.

[0046] S103: Summarize the key sentences using natural language processing technology.

[0047] That is, after obtaining the key sentences of the text content of the PDF document, they need to be summarized concisely and clearly. The document summarization method provided in the embodiment of the present application summarizes the key sentences through natural language processing technology to help users quickly grasp the core points of the PDF document and save time in reading and understanding.

[0048] Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods on how to achieve effective communication between humans and computers using natural language. NLP integrates knowledge from multiple disciplines such as linguistics, computer science, and mathematics, and aims to enable computers to understand and process the language used by humans in daily life.

[0049] Therefore, the document summarization method provided in the embodiment of the present application can improve the speed and accuracy of PDF document information acquisition by extracting the text content of the PDF document, obtaining the key sentences of the text content of the PDF document, and summarizing the key sentences through natural language processing technology, thereby helping users to quickly grasp the core points of the PDF document and save time in reading and understanding.

[0050] It is understandable that in some embodiments of the present application, the entire document content can be directly handed over to the NLP large model for processing without obtaining the key sentences of the text content of the PDF document, but a lot of model training is required, and factors such as the computing power and time consumption of the model must also be considered.

[0051] Furthermore, in some embodiments of the present application, the step of obtaining key sentences of the text content of the PDF document includes:

[0052] Calculate a text vector for each sentence of the PDF document;

[0053] Performing weighted summation on the text vectors of each sentence to obtain a weighted vector; and

[0054] According to the cosine similarity between the text vector of each sentence in the PDF document and the weighted vector, key sentences of the text content of the PDF document are obtained.

[0055] Specifically, a text vector is a digital representation of text, which is mainly used to help computers understand and process text information. This vectorization process converts text into a numerical vector, which can represent the semantics of the text. There are many types of text vectors, including word vectors, document vectors, and sentence vectors.

[0056] Weighted summation of vectors is a concept involving mathematics and linear algebra. In this process, a weight is first assigned to each vector, which can be a real number or a probability distribution, but the sum of the weights must be equal to 1 (for probability distribution). Then, the components of each vector in each dimension are multiplied by their corresponding weights, and these products are added together to obtain the weighted sum of each dimension. Finally, the weighted sums over all dimensions are combined into a new vector.

[0057] Cosine Similarity is a method to measure the similarity between two vectors. It evaluates their similarity by calculating the cosine value of the angle between the two vectors. In text processing and machine learning applications, cosine similarity is often used to compare the similarity between documents, sentences or words.

[0058] Therefore, when obtaining the key sentences of the text content of the PDF document, it is necessary to calculate the text vector of each sentence of the PDF document, and then perform weighted summation on the text vector of each sentence to obtain a weighted vector, and finally obtain the key sentences of the text content of the PDF document according to the cosine similarity between the text vector of each sentence of the PDF document and the weighted vector. The document summarization method provided in the embodiment of the present application can quickly and automatically obtain the key sentences of the text content of the PDF document through the above-mentioned setting, further improving the speed and accuracy of reading PDF documents.

[0059] Furthermore, in some embodiments of the present application, before calculating the text vector of each sentence of the PDF document, the method further includes:

[0060] The text content of the PDF document is segmented. The text content of the PDF document contains a large amount of text content, so before calculating the text vector of each sentence of the PDF document, the PDF document is segmented, so that the text content of the PDF document is segmented to improve the processing efficiency of the PDF document and facilitate subsequent operations.

[0061] Furthermore, in some embodiments of the present application, the segmentation of the text content of the PDF document includes:

[0062] The text content of the PDF document is segmented according to punctuation marks. That is, the text of the PDF document is segmented according to punctuation marks such as “:?。;!?:。;!”, so as to segment the text content of the PDF document, thereby improving the processing efficiency of the PDF document and facilitating subsequent operations.

[0063] Further, in some embodiments of the present application, obtaining key sentences of the text content of the PDF document according to the cosine similarity between the text vector of each sentence of the PDF document and the weighted vector includes:

[0064] comparing the cosine similarity of the text vector of each sentence of the PDF document with the weighted vector; and

[0065] The calculated cosine similarity values ​​are sorted to obtain key sentences of the text content of the PDF document.

[0066] That is, vector calculation is performed on each sentence of the PDF document to obtain a vector list, and then the cosine similarity between the text vector of each sentence of the PDF document and the weighted vector is compared, and the calculated cosine similarity values ​​are sorted to obtain the key sentences of the text content of the PDF document. The document summarization method provided in the embodiment of the present application can quickly and automatically obtain the key sentences of the text content of the PDF document through the above setting, further improving the speed and accuracy of reading PDF documents.

[0067] Further, in some embodiments of the present application, the step of sorting the calculated cosine similarity values ​​to obtain key sentences of the text content of the PDF document includes:

[0068] sorting the calculated cosine similarity values ​​in descending order; and

[0069] The sentences corresponding to the first N cosine similarity values ​​are obtained, thereby obtaining the key sentences of the text content of the PDF document.

[0070] Therefore, the document summarization method provided in the embodiment of the present application can quickly and automatically obtain key sentences of the text content of the PDF document through the above settings, further improving the speed and accuracy of reading the PDF document.

[0071] It should be noted that the above-mentioned N value is a preset value, N is an integer and is greater than or equal to 1. The specific data depends on actual needs and is not limited here.

[0072] Furthermore, in some embodiments of the present application, extracting text content of a PDF document includes:

[0073] Extract text content from PDF documents using OCR technology.

[0074] Specifically, OCR (Optical Character Recognition) is a technology that uses electronic devices (such as scanners or digital cameras) to check characters printed on paper. OCR determines the shape of characters by detecting dark and light patterns, and uses character recognition methods to translate these shapes into computer-readable text. When the text content of a PDF document is stored in the form of an image, it is necessary to extract the content through OCR technology to ensure that the text content of PDF documents saved in different forms can be extracted, so as to facilitate subsequent summary and induction processing.

[0075] Figure 2 2 is a structural block diagram of the document summarization device 200 provided in the embodiment of the present application. Figure 2 As shown, the document summarization device 200 of the embodiment of the present application includes: a text extraction module 210, a sentence acquisition module 220 and a summarization module 230, wherein:

[0076] A text extraction module 210, used to extract text content of a PDF document;

[0077] A sentence acquisition module 220, used to acquire key sentences of the text content of the PDF document; and

[0078] The summarizing module 230 is used to summarize the key sentences by using natural language processing technology.

[0079] The document summarization device provided in the embodiment of the present application can improve the speed and accuracy of PDF document information acquisition by extracting the text content of the PDF document, obtaining the key sentences of the text content of the PDF document, and summarizing the key sentences through natural language processing technology, thereby helping users to quickly grasp the core points of the PDF document and save time in reading and understanding.

[0080] It should be noted that the specific implementation of the document summarization device of the embodiment of the present application is similar to the specific implementation of the document summarization method of the embodiment of the present application. Please refer to the description of the method part for details, and no further details will be given here.

[0081] Figure 3 Schematic diagram of the structure of an electronic device 300 according to an embodiment of the present application.

[0082] like Figure 3As shown, the electronic device 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from the storage part 302 to a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0083] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.

[0084] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 309, and / or installed from a removable medium 311. When the computer program is executed by a central processing unit (CPU) 301, the above-mentioned functions defined in the electronic device of the present application are executed.

[0085] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electronic device, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, 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.

[0086] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction-executing electronic device, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals 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, which may send, propagate, or transmit a program for use by or in combination with an instruction-executing electronic device, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0087] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the processing receiving device, method and computer program product according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the aforementioned module, program segment, or a part of the 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 from the order 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 electronic device that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0088] The units or modules involved in the embodiments described in this application may be implemented by software or hardware. The units or modules described may also be set in a processor, and the processor is used to implement the document summarization method when executing the program:

[0089] Extract text content from PDF documents;

[0090] Obtaining key sentences of the text content of the PDF document; and

[0091] The key sentences are summarized and generalized through natural language processing technology.

[0092] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently and not be assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the document summarization method described in the present application:

[0093] Extract text content from PDF documents;

[0094] Obtaining key sentences of the text content of the PDF document; and

[0095] The key sentences are summarized and generalized through natural language processing technology.

[0096] As another aspect, the present application further provides a computer program product, which may be included in the electronic device described in the above embodiment; or may exist independently without being installed in the electronic device. The above computer program product stores one or more programs, and when the above programs are used by one or more processors to execute the document summarization method described in the present application:

[0097] Extract text content from PDF documents;

[0098] Obtaining key sentences of the text content of the PDF document; and

[0099] The key sentences are summarized and generalized through natural language processing technology.

[0100] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. All equivalent structural changes made by using the contents of the present application specification and drawings under the application concept of the present application, or directly / indirectly used in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A document summarization method, characterized in that: include: Extract text content from PDF documents; Obtain key sentences of the text content of the PDF document; and The key sentences are summarized and generalized through natural language processing technology.

2. The document summarization method according to claim 1, characterized in that: The step of obtaining the key sentences of the text content of the PDF document includes: Calculate the text vector of each sentence of the PDF document; Performing weighted summation on the text vectors of each sentence to obtain a weighted vector; and According to the cosine similarity between the text vector of each sentence of the PDF document and the weighted vector, key sentences of the text content of the PDF document are obtained.

3. The document summarization method according to claim 2, characterized in that: Before calculating the text vector of each sentence of the PDF document, the method further includes: Segment the text content of the PDF document.

4. The document summarization method according to claim 3, characterized in that: The sentence segmentation processing of the text content of the PDF document includes: The text content of the PDF document is segmented according to punctuation marks.

5. The document summarization method according to claim 2, characterized in that: The step of obtaining key sentences of the text content of the PDF document according to the cosine similarity between the text vector of each sentence of the PDF document and the weighted vector comprises: comparing the cosine similarity of the text vector of each sentence of the PDF document with the weighted vector; and The calculated cosine similarity values ​​are sorted to obtain key sentences of the text content of the PDF document.

6. The document summarization method according to claim 5, characterized in that: The step of sorting the calculated cosine similarity values ​​to obtain key sentences of the text content of the PDF document includes: Sorting the calculated cosine similarity values ​​in descending order; and Sentences corresponding to the first N cosine similarity values ​​are obtained, thereby obtaining key sentences of the text content of the PDF document, where N is an integer and N is greater than or equal to 1.

7. The document summarization method according to claim 1, characterized in that: The extracting of the text content of the PDF document comprises: Extract text content from PDF documents using OCR technology.

8. A document summarization device, characterized in that: include: Text extraction module, used to extract text content from PDF documents; A sentence acquisition module, used to acquire key sentences of the text content of the PDF document; and The summarization module is used to summarize the key sentences through natural language processing technology.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor is used to implement the document summarization method according to any one of claims 1 to 7 when executing the program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to implement the document summarization method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Text abstract model production method and device, equipment and medium

    CN115129819A

  • Abstract generation method and device, equipment, storage medium and product

    CN116894089A

  • Abstract generation method and system based on financial large model

    CN118467724A