PDF document title identification method

By identifying the header footer, sidebar and watermark text, dividing text fields and determining the title level, the problem of low accuracy in title recognition in the existing technology is solved, and efficient and accurate PDF document title recognition is achieved, which enhances users Experience and save maintenance costs.

CN119227677AInactive Publication Date: 2024-12-31赛博爱思(上海)软件科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411296984.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing PDF document title recognition technology is difficult to accurately identify titles, especially texts starting with numbers are easily misidentified. The template library is not comprehensive enough to lead to incomplete recognition, resulting in low recognition accuracy.

Method used

通过获取PDF文档的文字列表,识别页眉页脚、侧边栏和水印文字,划分文字段落,筛选出候选标题组,并根据字号确定标题等级,排除页眉页脚、侧边栏和水印文字,基于特征和关联性识别标题。

Benefits of technology

It improves the performance and efficiency of title recognition, reduces the error recognition rate, reduces the calculation amount and running time, saves development and maintenance costs, and improves user experience and satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227677A_ABST
    Figure CN119227677A_ABST
Patent Text Reader

Abstract

The invention discloses a PDF (Portable Document Format) document title identification method, which comprises the following steps of: acquiring a character list of a PDF document, and identifying page headers, page footers, sidebar characters and watermark characters in the character list; dividing characters in the PDF document into character paragraphs to obtain a character paragraph list; dividing the character paragraphs into a plurality of character paragraph groups with the same characteristics, and screening out candidate title groups according to the character paragraph groups; and determining a title level of the candidate title group based on the candidate title group. According to the method, the PDF document title recognition efficiency and accuracy are improved, and meanwhile, the satisfaction degree of a user on title recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer technology, and in particular relates to a PDF document title recognition method. Background Art

[0002] PDF is a common electronic document format with the characteristics of cross-platform, reliability, editability and security. It is widely used in document exchange, file archiving, e-books, forms and reports, printing and publishing. In study and work, we often need to extract titles at all levels in PDF documents. Titles can be used to generate directories, make bookmarks, generate mind maps, build AI learning samples, etc. Although humans can easily distinguish paragraphs from titles and understand the semantics when reading, it is difficult for computer programs to understand the structural characteristics of such documents, making it even more difficult to recognize the titles. Existing title recognition technology often matches based on pre-set title templates. The recognition accuracy of this method is very low; specifically, it includes the following situations: (1) Text that is not a title is mistakenly recognized as a title, for example, text that starts with a number is easily mistakenly recognized as a title; (2) Some titles cannot be recognized. If the template library is not comprehensive enough, it cannot cover all possible titles. In fact, the template library cannot be comprehensive. Summary of the invention

[0003] In order to solve the above technical problems, the present invention proposes a PDF document title recognition method, which improves the efficiency and accuracy of PDF document title recognition and improves user satisfaction with title recognition.

[0004] To achieve the above object, the present invention provides a PDF document title recognition method, comprising: Obtain a text list of a PDF document, and identify header and footer text, sidebar text, and watermark text in the text list; Divide the text in the PDF document into text paragraphs to obtain a text paragraph list; Dividing the text paragraphs into a number of text paragraph groups with the same characteristics, and screening out candidate title groups according to the text paragraph groups; Based on the candidate title groups, a title rank of the candidate title groups is determined.

[0005] According to the PDF document title recognition method provided by the present invention, recognizing the header and footer in the text list includes: Identify the same or similar text that appears on consecutive pages or alternate pages and is located at the top and bottom of the page as headers and footers.

[0006] According to the PDF document title recognition method provided by the present invention, recognizing the sidebar text in the text list includes: The text on the left and right sides of the page that is rotated 90 degrees is recognized as sidebar text.

[0007] According to the PDF document title recognition method provided by the present invention, recognizing the watermark text in the text list includes: Semi-transparent text that appears in the same position on consecutive pages is recognized as watermark text.

[0008] According to the PDF document title recognition method provided by the present invention, obtaining a text paragraph list includes: For text on the same page, text adjacent to each other in the horizontal direction is divided into text lines, and text lines that are close in position and have the same main features are divided into text paragraphs, where the main features include font and font size.

[0009] According to the PDF document title recognition method provided by the present invention, dividing the text paragraphs into a plurality of text paragraph groups with the same characteristics comprises: The text paragraphs are divided into the same text paragraph group according to the same main features, so as to obtain a plurality of text paragraph groups with the same features.

[0010] According to the PDF document title recognition method provided by the present invention, the candidate title group does not include the following two situations: The first case is: the paragraph group with the most text is the normal text; The second situation is that the paragraph groups that are smaller than the normal text size are all annotations and quotations.

[0011] According to the PDF document title recognition method provided by the present invention, based on the candidate title group, determining the title level of the candidate title group includes: The group with the largest font size and only one paragraph in the candidate title groups is the main title. If there is no title group that meets the requirements, the PDF document does not include the main title; the remaining candidate title groups are arranged in order of different levels of titles from large to small according to the font size.

[0012] Technical effects of the present invention: (1) The present invention can improve the performance and efficiency of title recognition. The traditional template matching method consumes a lot of time due to the huge template library and one-to-one comparison. The present invention does not require template matching, and can quickly classify and recognize by extracting features. Before actually recognizing the title, the text in the header, footer, sidebar, and watermark is excluded, which greatly reduces the computational complexity and running time of title recognition.

[0013] (2) The present invention can improve the accuracy of title recognition. Excluding headers, footers, sidebars, and watermarks effectively reduces the error recognition rate, and distinguishing titles based on features and relevance further improves the accuracy rate.

[0014] In summary, the present invention improves the user experience and satisfaction, and also saves development and maintenance costs. The template library of the existing solution needs to be continuously expanded and maintained, while the present invention does not require a lot of time to configure the template library, nor does it require subsequent maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 The present invention is a flowchart of a PDF document title recognition method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0016] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0017] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0018] like Figure 1 As shown, this embodiment provides a PDF document title recognition method, including: Get the text list of the PDF document and identify the header, footer, sidebar text and watermark text in the text list; each item in the text list contains information such as text, font, font size, style, color, coordinates, etc. Divide the text in the PDF document into text paragraphs and obtain a list of text paragraphs; Divide the text paragraphs into a number of text paragraph groups with the same characteristics, and select candidate title groups according to the text paragraph groups; Based on the candidate title groups, the title ranks of the candidate title groups are determined.

[0019] Furthermore, the headers and footers in the recognized text list include: Identify the same or similar text that appears on consecutive pages or alternate pages and is located at the top and bottom of the page as headers and footers.

[0020] Furthermore, the sidebar text in the recognized text list includes: The text on the left and right sides of the page that is rotated 90 degrees is recognized as sidebar text.

[0021] Furthermore, the watermark text in the recognition text list includes: Semi-transparent text that appears in the same position on consecutive pages is recognized as watermark text.

[0022] Furthermore, obtaining a list of text paragraphs includes: For text on the same page, text adjacent to each other in the horizontal direction is divided into text lines, and text lines that are close in position and have the same main features are divided into text paragraphs, where the main features include font and font size.

[0023] Furthermore, dividing the text paragraphs into a number of text paragraph groups with the same characteristics includes: The text paragraphs are divided into the same text paragraph group according to the same main features, so as to obtain several text paragraph groups with the same features.

[0024] Furthermore, the candidate title group does not include two cases: The first case is: the paragraph group with the most text is the normal text; The second situation is that the paragraph groups that are smaller than the normal text size are all annotations and quotations.

[0025] Further, based on the candidate title group, determining the title level of the candidate title group includes: The group with the largest font size and only one paragraph among the candidate title groups is the main title. If there is no title group that meets the requirements, the PDF document does not include the main title. The remaining candidate title groups are ranked from large to small in font size as first-level title, second-level title, third-level title, and so on.

[0026] Find the missing titles. It is common that the styles of individual titles are inconsistent with the statistical titles due to the carelessness of the document author and lax proofreading. This will cause them to be missed in the above steps, so it is necessary to check for omissions after the above steps. For example, when the second-level titles "1.1 xxxxx" and "1.3 xxxxx" have been identified, it is found that there is a paragraph with the content "1.2 xxxxx". Based on the similar structure of the content and the continuity of the text, this paragraph should be modified to a second-level title. Continuous text includes but is not limited to the following examples: Numbers: 1, 2, 3, 4, 5, ... Capital letters: A, B, C, D, E, ... Lowercase letters: a, b, c, d, e, ... Roman numerals: I, II, III, IV, V, ... Chinese numbers: one, two, three, four, five, ... The present invention can improve the performance and efficiency of title recognition. The traditional template matching method consumes a lot of time for one-to-one comparison due to the huge template library. However, the present invention does not require template matching, and can quickly classify and identify by extracting features. Before actually identifying the title, the text in the header, footer, sidebar, and watermark is excluded first, which greatly reduces the calculation amount and running time of title recognition. The present invention can improve the accuracy of title recognition. The exclusion of headers, footers, sidebars, and watermarks effectively reduces the error recognition rate, and distinguishing titles based on features and relevance further improves the accuracy. In summary, the present invention improves the user experience and satisfaction, and the present invention also saves development and maintenance costs. The template library of the existing solution needs to be continuously expanded and maintained, while the present invention does not require a lot of time to configure the template library, and does not require subsequent maintenance.

[0027] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A PDF document title recognition method, characterized in that: include: Obtain a text list of a PDF document, and identify header and footer text, sidebar text, and watermark text in the text list; Divide the text in the PDF document into text paragraphs to obtain a text paragraph list; Dividing the text paragraphs into a number of text paragraph groups with the same characteristics, and screening out candidate title groups according to the text paragraph groups; Based on the candidate title groups, a title rank of the candidate title groups is determined.

2. The PDF document title recognition method according to claim 1, characterized in that: Identifying the header and footer in the text list includes: Identify the same or similar text that appears on consecutive pages or alternate pages and is located at the top and bottom of the page as headers and footers.

3. The PDF document title recognition method according to claim 1, characterized in that: Identifying the sidebar text in the text list includes: The text on the left and right sides of the page that is rotated 90 degrees is recognized as sidebar text.

4. The PDF document title recognition method according to claim 1, characterized in that: Identifying the watermark text in the text list includes: Semi-transparent text that appears in the same position on consecutive pages is recognized as watermark text.

5. The PDF document title recognition method according to claim 1, characterized in that: Get the text paragraph list including: For text on the same page, text adjacent to each other in the horizontal direction is divided into text lines, and text lines that are close in position and have the same main features are divided into text paragraphs, where the main features include font and font size.

6. The PDF document title recognition method according to claim 5, characterized in that: Dividing the text paragraphs into a number of text paragraph groups with the same characteristics comprises: The text paragraphs are divided into the same text paragraph group according to the same main features, so as to obtain a plurality of text paragraph groups with the same features.

7. The PDF document title recognition method according to claim 1, characterized in that: The candidate title group does not include two situations: The first case is: the paragraph group with the most text is the normal text; The second situation is that the paragraph groups that are smaller than the normal text size are all annotations and quotations.

8. The PDF document title recognition method according to claim 1, characterized in that: Based on the candidate title group, determining the title level of the candidate title group includes: The group with the largest font size and only one paragraph in the candidate title groups is the main title. If there is no title group that meets the requirements, the PDF document does not include the main title; the remaining candidate title groups are arranged in order of different levels of titles from large to small according to the font size.