Vector knowledge base construction method and device based on PDF fuzzy query, equipment and medium

By rotating the page and table directions of PDF documents, the problems of abnormal table directions, inverted text, and incomplete contents of merged cells are solved, improving the accuracy of text extraction and processing efficiency, and promoting the improvement of PDF documents. Efficient processing and information sharing.

CN118568196AInactive Publication Date: 2024-08-30BEIJING TECH & BUSINESS UNIV

Patent Information

Application Number
CN202410625458.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When processing PDF documents, the existing technology encounters problems such as abnormal table orientation, reversed text, garbled characters, and incomplete merged cell contents, resulting in inaccurate document processing and affecting user experience and information acquisition.

Method used

By rotating the page and table directions of the PDF document, ensure that the page and table directions are consistent with the set direction, and convert the text data into txt format to achieve text extraction and data saving.

Benefits of technology

It improves the accuracy and processing efficiency of text extraction, reduces the probability of text inversion and garbled characters, ensures the integrity and reliability of data, and improves the processing and use experience of PDF documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568196A
    Figure CN118568196A
Patent Text Reader

Abstract

The embodiment of the invention discloses a vector knowledge base construction method and device based on PDF fuzzy query, equipment and a medium. The method comprises the steps that an input PDF document is responded, the PDF document is retrieved, under the condition that a page direction or a table direction is abnormal, an abnormal page is subjected to rotation processing, and the page direction or the table direction is not abnormal; and extracting characters in the PDF document under the condition that page directions of all pages in the PDF document are in a set page direction and no table exists or character directions in the table are consistent with a set character direction, so as to obtain text data for constructing a vector knowledge base. According to the method, the PDF document can be processed more effectively, and the processing accuracy and efficiency are improved. Besides, by improving the processing method of the PDF document, the user experience of the PDF document is improved, communication, sharing and application of the digital document are further promoted, and the requirement of the user for efficient and convenient document processing is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a method, device, equipment and medium for constructing a vector knowledge base based on PDF fuzzy query, and belongs to the technical field of natural language processing. Background Art

[0002] PDF documents play an important role in today's life and are widely used in the exchange, sharing, storage and reading of electronic documents, covering various fields such as business, education, scientific research, technology, etc., ensuring the reliability and accuracy of information in applications.

[0003] There are currently a variety of PDF document processing tools that can be used to extract, parse and process text information in PDF documents, such as PyPDF2, PDFplumber, OCRmyPDF, etc. However, the inventors found in actual operation that when processing PDF documents, there will be problems with tables in the document and the direction of the table is not the normal reading direction, which may be arranged horizontally or in other non-traditional directions. This situation causes conventional tools to be unable to correctly identify and parse the table content, which in turn affects the correct reading and processing of the document. While reading, there will be phenomena such as text inversion and garbled characters. Users may not be able to correctly obtain the information in the document, resulting in reduced work efficiency or errors. At the same time, if there are merged cells in the table when reading the table, the cell content cannot be fully read, resulting in some information being lost or incomplete. This will cause trouble to users and reduce the availability and readability of the document. Not only does it affect the normal operation of the document processing tool, it also brings inconvenience and trouble to users.

[0004] These problems seriously affect the processing and usage experience of PDF documents, affect the user's normal interpretation and use of PDF documents when using the tools, and lose the original stability of PDF documents.

[0005] Furthermore, in the stage of constructing the vector knowledge base, the PDF document needs to be correctly interpreted for construction. If the processing tool is not properly selected, the correct vector knowledge base cannot be constructed. Summary of the invention

[0006] In order to solve the above technical problems, the embodiments of the present application respectively provide a method and device, equipment, and medium for constructing a vector knowledge base based on PDF fuzzy query. When facing the diversity of PDF documents, the present application aims to provide a reliable solution for the problems of abnormal reading direction of tables, inverted text, garbled characters, and incomplete content of merged cells in the prior art, so that users can process PDF documents more effectively, improve the accuracy and efficiency of processing, and correctly construct a vector knowledge base after reading the document. By improving the processing method of PDF documents, the present invention aims to improve the user experience of PDF documents, further promote the communication, sharing, and application of digital documents, and meet the user's needs for efficient and convenient document processing.

[0007] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0008] According to one aspect of an embodiment of the present application, a method for constructing a vector knowledge base based on PDF fuzzy query is provided, the method comprising:

[0009] In response to an input PDF document, searching the PDF document;

[0010] When it is found that the page direction in the retrieved PDF document is not in the set page direction, determining the page number of the page, and rotating the page corresponding to the page number so that the page direction of the page is consistent with the set page direction;

[0011] In the case where a table is found in the PDF document, a character direction in the table is determined, and if the character direction in the table is not in a set character direction, a page where the table is located is rotated so that the character direction in the table is consistent with the set character direction;

[0012] When the page directions of all pages in the PDF document are in the set page direction and there is no table or the character direction in the table is consistent with the set character direction, the characters in the PDF document are extracted to obtain text data for constructing a vector knowledge base.

[0013] Furthermore, the set page direction is the direction from left to right for the characters in the page.

[0014] Furthermore, the set character direction is the direction from left to right that the characters in the table follow.

[0015] Furthermore, after obtaining the text data for constructing the vector knowledge base, the method further includes:

[0016] The text data is converted into txt document format data and saved.

[0017] Furthermore, the method further comprises:

[0018] The input PDF document is stored in a first folder, the processed PDF document is stored in a second folder, and the txt document format data is stored in a third folder, wherein the processed PDF document is a PDF document that has been processed with page rotation and table rotation.

[0019] Furthermore, the method further comprises:

[0020] In response to an input PDF document, if the first folder does not exist locally, automatically generate a first folder to store the input PDF document;

[0021] If the second folder does not exist locally, automatically generate a second folder to store the processed PDF document;

[0022] If the third folder does not exist locally, the third folder is automatically generated to store data in txt document format.

[0023] Furthermore, after rotating the page where the table is located so that the direction of characters in the table is consistent with the set character direction, the method further includes: identifying the table after the page rotation.

[0024] According to one aspect of an embodiment of the present application, a device for constructing a vector knowledge base based on PDF fuzzy query is provided, comprising:

[0025] a document acquisition unit, configured to retrieve the PDF document in response to an input PDF document;

[0026] A first rotation unit is configured to, when it is found that the page direction in the retrieved PDF document is not in the set page direction, determine the page number of the page, and rotate the page corresponding to the page number so that the page direction of the page is consistent with the set page direction;

[0027] a second rotation unit configured to, when a table is found in the PDF document, determine a direction of characters in the table, and if the direction of characters in the table is not in a set direction, rotate the page where the table is located so that the direction of characters in the table is consistent with the set direction;

[0028] The data conversion unit is configured to extract characters in the PDF document to obtain text data for constructing a vector knowledge base when the page directions of all pages in the PDF document are in the set page direction and there is no table or the character direction in the table is consistent with the set character direction.

[0029] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the controller implements the above-mentioned method for constructing a vector knowledge base based on PDF fuzzy query.

[0030] According to one aspect of an embodiment of the present application, a computer-readable storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned vector knowledge base construction method based on PDF fuzzy query.

[0031] According to one aspect of the embodiments of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned vector knowledge base construction method based on PDF fuzzy query.

[0032] The technical solution provided in the embodiments of the present application has at least the following advantages:

[0033] 1. Improved text extraction accuracy: By performing reasonable rotation processing on PDF documents and splitting operations on merged cells, this application improves the accuracy of text extraction, reduces the probability of occurrence of text inversion, garbled characters, etc., and makes the extracted text data more accurate and reliable.

[0034] 2. Improved processing efficiency: This application realizes the processing and text extraction process of PDF documents through code automation, which greatly improves processing efficiency and reduces the time and cost of manual intervention.

[0035] 3. Convenient data conversion: The extracted text data is converted into txt document format to facilitate the subsequent construction of the vector knowledge base. This data format is universal and extensible, which facilitates further data processing and application.

[0036] 4. Improve document processing efficiency: This application can effectively improve the processing efficiency of PDF documents, provide more efficient document processing solutions for enterprises, scientific research institutions, etc., and save a lot of time and labor costs.

[0037] 5. Promote information sharing and application: By improving the processing accuracy and readability of PDF documents, this application promotes the exchange, sharing and application of digital documents, provides convenient conditions for information sharing and knowledge dissemination, and promotes the development of digital transformation and informatization construction.

[0038] 6. Technological innovation and industrial promotion: This application represents technological innovation in the field of PDF document processing, has high technical content and application value, and is expected to promote the development of related industries and promote technological innovation and industrial upgrading.

[0039] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0041] Figure 1 It is a flowchart of a method for constructing a vector knowledge base based on PDF fuzzy query according to an exemplary embodiment of the present application;

[0042] Figure 2 It is a schematic diagram of an exemplary embodiment of the present application showing a table that cannot be read normally;

[0043] Figure 3 is a diagram of a page for normal reading after rotation shown in an exemplary embodiment of the present application;

[0044] Figure 4 It is a software html page diagram shown in an exemplary embodiment of the present application;

[0045] Figure 5 is a schematic diagram of successful uploading and saving shown in an exemplary embodiment of the present application;

[0046] Figure 6 This is a schematic diagram of reading a PDF document and saving it as a txt document shown in an exemplary embodiment of the present application;

[0047] Figure 7 It is a diagram showing a fuzzy query and output result for a constructed vector knowledge base according to an exemplary embodiment of the present application;

[0048] Figure 8It is a schematic diagram of the structure of a vector knowledge base construction device based on PDF fuzzy query shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0049] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0050] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0051] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0052] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0053] See also Figure 1 , Figure 1 FIG. 1 is a flowchart of a method for constructing a vector knowledge base based on PDF fuzzy query, shown in an exemplary embodiment of the present application. Figure 1 As shown, the method at least includes steps S100 to S400, which are described in detail as follows:

[0054] Step S100: in response to an input PDF document, searching the PDF document.

[0055] Step S200, when it is found that the page direction in the retrieved PDF document is not in the set page direction, the page number of the page is determined, and the page corresponding to the page number is rotated so that the page direction of the page is consistent with the set page direction.

[0056] Exemplarily, when processing a PDF document, this embodiment uses Python code to implement a series of operations. For example, when searching a PDF document through code, if it is found that the text in the PDF page is not directly readable at an angle, this embodiment will record the page number of the relevant page, and can well identify the page direction in the PDF document. If the text in the document is rotated clockwise or counterclockwise, the Python code is used to reasonably rotate these pages based on the recorded document page number. For the rotated PDF document, the present invention implements a text extraction function to accurately extract the text content in the PDF document.

[0057] It can be understood that the set page direction can be the direction in which the characters in the page follow from left to right.

[0058] Step S300, when it is retrieved that there is a table in the PDF document, the character direction in the table is determined. If the character direction in the table is not in the set character direction, the page where the table is located is rotated so that the character direction in the table is consistent with the set character direction.

[0059] For example, a table extracted from a document such as Figure 2 As shown, the table is rotated 90 degrees clockwise so that the text is converted to a normal reading direction from left to right, such as Figure 3 As shown, the text in the table is accurately presented to ensure that the page content can be correctly parsed and extracted. Through this step, the problem of abnormal table direction in the PDF document is effectively solved.

[0060] It can be understood that the set character direction may be a direction from left to right for the characters in the table.

[0061] Step S400, when the page directions of all pages in the PDF document are in the set page direction and there is no table or the character direction in the table is consistent with the set character direction, the characters in the PDF document are extracted to obtain text data for constructing a vector knowledge base.

[0062] Finally, in step S400, for the rotated PDF document, the present invention implements a text extraction function to accurately extract the text content in the PDF document. In particular, for a table with merged cells, the present invention also implements a split operation of the merged cells to ensure that all cell contents can be completely read and processed. This step further solves the problem of incomplete content caused by merged cells in a PDF document.

[0063] In another embodiment, the present application converts the acquired text data into a txt document format and saves it. Such a processing process not only retains the original content of the document, but also provides basic data for the subsequent vector knowledge base construction. Through this series of operations, the present application realizes efficient processing and data extraction of PDF documents, and provides a reliable data source for building a vector knowledge base.

[0064] In another embodiment, the present application proposes a method for constructing a vector knowledge base based on PDF fuzzy query, which is presented in the form of a web page based on built-in Python files and HTML files. Figure 4 As shown, it includes a select file button, an Upload button, and a Generate Data button.

[0065] Specifically, the method has the following functions and characteristics:

[0066] Step 1. Select file button: The user can select the desired PDF document on the computer by clicking the select file button. The present invention does not limit the number of selected files, but can only select PDF type documents to ensure the accuracy and reliability of subsequent processing.

[0067] Step 2.Upload button: After the user selects the required PDF document, click the Upload button to upload it. After the upload is successful, the Python file will display the corresponding information, such as Figure 5 As shown. If there are no folders named "uploads" and "output" locally, the present invention will automatically create these two folders. Among them, the "uploads" folder retains the original PDF documents uploaded by the user, and the "output" folder retains the processed PDF documents, ensuring the separation and preservation of the original data and the processing results.

[0068] Step 3. Generate Data button: If the user needs to perform further operations, click the Generate Data button after the upload is completed. After clicking, if the processing is completed, the Python file will display the corresponding information, such as Figure 6 As shown. If there is no folder named "data" locally, the present invention will automatically generate the folder. The generated txt document will be saved in the folder for the subsequent construction of the vector knowledge base.

[0069] For the constructed vector knowledge base, fuzzy query can be performed and the results can be output, such as Figure 7 shown.

[0070] Through the above functions, this application realizes efficient processing and data extraction of PDF documents, providing users with a simple, intuitive and efficient PDF document processing solution. At the same time, it is presented in the form of a web page, allowing users to easily access and use it through common web browsers, improving the user's operational convenience and experience.

[0071] Another aspect of the present application also provides a vector knowledge base construction device based on PDF fuzzy query, such as Figure 8 As shown, the device 800 includes:

[0072] The document acquisition unit 801 is configured to retrieve the PDF document in response to the input PDF document;

[0073] The first rotation unit 802 is configured to, when it is found that the page direction in the retrieved PDF document is not in the set page direction, determine the page number of the page, and rotate the page corresponding to the page number so that the page direction of the page is consistent with the set page direction;

[0074] The second rotation unit 803 is configured to, when a table is found in the PDF document, determine the direction of characters in the table, and if the direction of characters in the table is not in a set direction, rotate the page where the table is located so that the direction of characters in the table is consistent with the set direction;

[0075] The data conversion unit 804 is configured to extract characters in the PDF document to obtain text data for constructing a vector knowledge base when the page directions of all pages in the PDF document are in the set page direction and there is no table or the character direction in the table is consistent with the set character direction.

[0076] In another embodiment, the set page direction is a direction from left to right for characters in the page.

[0077] In another embodiment, the set character direction is the direction from left to right for the characters in the table.

[0078] In another embodiment, the data conversion unit is further configured to:

[0079] The text data is converted into txt document format data and saved.

[0080] In another embodiment, the apparatus further comprises a data storage unit, wherein the data storage unit is configured to:

[0081] The input PDF document is stored in a first folder, the processed PDF document is stored in a second folder, and the txt document format data is stored in a third folder, wherein the processed PDF document is a PDF document that has been processed with page rotation and table rotation.

[0082] In another embodiment, the data storage unit is further configured to:

[0083] In response to an input PDF document, if the first folder does not exist locally, automatically generate a first folder to store the input PDF document;

[0084] If the second folder does not exist locally, automatically generate a second folder to store the processed PDF document;

[0085] If the third folder does not exist locally, the third folder is automatically generated to store data in txt document format.

[0086] In another embodiment, the second rotation unit is further configured to identify a table after page rotation.

[0087] It should be noted that the vector knowledge base construction device based on PDF fuzzy query provided in the above embodiment and the vector knowledge base construction method based on PDF fuzzy query provided in the above embodiment belong to the same concept, and the specific way in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.

[0088] Another aspect of the present application provides an electronic device, including: a controller; a memory for storing one or more programs, which, when executed by the controller, executes the vector knowledge base construction based on PDF fuzzy query in the above-mentioned embodiments.

[0089] 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 computer-readable medium, and the computer program includes a computer program 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 part, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.

[0090] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, 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 can 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), a 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 the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. 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. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0091] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned 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 than 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 or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0092] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0093] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the vector knowledge base construction method based on PDF fuzzy query as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0094] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the vector knowledge base construction method based on PDF fuzzy query provided in each of the above embodiments.

[0095] According to one aspect of an embodiment of the present application, a computer system is also provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. In RAM, various programs and data required for system operation are also stored. CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0096] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.

[0097] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A method for constructing a vector knowledge base based on PDF fuzzy query, characterized in that: The method comprises: In response to an input PDF document, searching the PDF document; When it is found that the page direction in the retrieved PDF document is not in the set page direction, determining the page number of the page, and rotating the page corresponding to the page number so that the page direction of the page is consistent with the set page direction; In the case where a table is found in the PDF document, a character direction in the table is determined, and if the character direction in the table is not in a set character direction, a page where the table is located is rotated so that the character direction in the table is consistent with the set character direction; When the page directions of all pages in the PDF document are in the set page direction and there is no table or the character direction in the table is consistent with the set character direction, the characters in the PDF document are extracted to obtain text data for constructing a vector knowledge base.

2. The method for constructing a vector knowledge base based on PDF fuzzy query according to claim 1 is characterized in that: The set page direction is the direction from left to right for the characters on the page.

3. The method for constructing a vector knowledge base based on PDF fuzzy query according to claim 1 is characterized in that: The set character direction is the direction from left to right for the characters in the table.

4. The method for constructing a vector knowledge base based on PDF fuzzy query according to claim 1 is characterized in that: After obtaining the text data for constructing the vector knowledge base, the method further includes: The text data is converted into txt document format data and saved.

5. The method for constructing a vector knowledge base based on PDF fuzzy query according to claim 4 is characterized in that: The method further comprises: The input PDF document is stored in a first folder, the processed PDF document is stored in a second folder, and the txt document format data is stored in a third folder, wherein the processed PDF document is a PDF document that has been processed with page rotation and table rotation.

6. The method for constructing a vector knowledge base based on PDF fuzzy query according to claim 5 is characterized in that: The method further comprises: In response to an input PDF document, if the first folder does not exist locally, automatically generate a first folder to store the input PDF document; If the second folder does not exist locally, automatically generate a second folder to store the processed PDF document; If the third folder does not exist locally, the third folder is automatically generated to store data in txt document format.

7. The method for constructing a vector knowledge base based on PDF fuzzy query according to claim 4 is characterized in that: After rotating the page where the table is located so that the direction of the characters in the table is consistent with the set character direction, the method further includes: identifying the table after the page rotation.

8. A device for constructing a vector knowledge base based on PDF fuzzy query, characterized in that: include: a document acquisition unit, configured to retrieve the PDF document in response to an input PDF document; A first rotation unit is configured to, when it is found that the page direction in the retrieved PDF document is not in the set page direction, determine the page number of the page, and rotate the page corresponding to the page number so that the page direction of the page is consistent with the set page direction; a second rotation unit configured to, when a table is found in the PDF document, determine a direction of characters in the table, and if the direction of characters in the table is not in a set direction, rotate the page where the table is located so that the direction of characters in the table is consistent with the set direction; The data conversion unit is configured to extract characters in the PDF document to obtain text data for constructing a vector knowledge base when the page directions of all pages in the PDF document are in the set page direction and there is no table or the character direction in the table is consistent with the set character direction.

9. An electronic device, characterized in that: include: Controller; A memory is used to store one or more programs. When the one or more programs are executed by the controller, the controller implements the method for constructing a vector knowledge base based on PDF fuzzy query according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the method for constructing a vector knowledge base based on PDF fuzzy query according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Element information extraction method and device based on text recognition, equipment and medium

    CN113536771A

  • Intelligent question and answer model construction method and device, computer equipment and storage medium

    CN113918686A

  • Insurance knowledge base establishment method and device, question query method and device and storage medium

    CN115186075A

  • Retrieval method for information in table picture, electronic equipment and storage medium

    CN115408497A

  • Table data extraction method and device, terminal equipment and storage medium

    CN117437651A

Cited By

  • Method and device for viewing PDF reference document in intelligent knowledge base and medium

    CN118897890A