Content retrieval method combining PDF search mode with OCR recognition

By identifying and classifying the content format of the imaged PDF file and building a targeted content recognition model in combination with OCR technology, the problem of inability to effectively identify the relationships and differences between different PDF formats in the existing technology is solved, and efficient and accurate PDF content retrieval is achieved.

CN119128192BActive Publication Date: 2025-03-04BEIJING GUANGLIANDA YUNTU DREAM TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411628999.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-04
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

When existing PDF file content retrieval methods process complex documents containing multiple formats, they cannot effectively identify the relationships and differences between different formats, resulting in identification errors and omissions, affecting the efficiency and accuracy of information acquisition.

Method used

By identifying the content format of the imaged PDF file, multiple content formats are obtained, OCR recognition similarities and similarities are analyzed based on these content formats, obtaining similarities and similarities indicators, classifying, building targeted content recognition models, and calling these models for keyword search and positioning display.

Benefits of technology

It significantly improves the accuracy and efficiency of PDF content retrieval, enhances the ability to adapt to diverse content, improves the comprehensiveness and accuracy of information acquisition, helps users quickly obtain the required information, and optimizes the information retrieval experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128192B_ABST
    Figure CN119128192B_ABST
Patent Text Reader

Abstract

The present application provides a content retrieval method combining PDF search mode with OCR recognition, which relates to the field of information retrieval technology. It obtains multiple content formats by identifying the content format of the current imaged PDF file; performs OCR recognition similarities and differences analysis between multiple content formats to obtain corresponding multiple similarities and differences indicators; classifies according to multiple similarities and differences indicators and outputs N types of content formats; builds N content recognition models according to the text features of the content formats; obtains user search keywords, calls N content recognition models to perform keyword search in the file, outputs corresponding multiple content search return results, and locates and displays them in the file. The present application solves the technical problem that the existing retrieval method cannot effectively identify the relationship and differences between different formats, which leads to the easy occurrence of recognition errors and omissions, and achieves the technical effect of improving the efficiency and accuracy of imaged PDF file content retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information retrieval technology, and in particular to a content retrieval method combining a PDF search mode with OCR recognition. Background Art

[0002] With the acceleration of the informationization process, PDF files have become the mainstream choice for storing and sharing documents due to their good portability and cross-platform compatibility. However, with the widespread use of PDF files, how to efficiently and accurately retrieve required information from these files has become an increasingly prominent challenge.

[0003] Existing PDF file content retrieval methods usually rely on extracting text information and identifying static text through OCR (optical character recognition) technology. This process can often only operate on standard text formats. When faced with imaged PDFs, especially those documents in non-standard text formats that contain various annotations and multiple fonts and text colors, these methods cannot effectively identify the relationship and differences between different formats, resulting in a significant reduction in the accuracy of information retrieval. Secondly, existing retrieval methods often use a single OCR model to process all content. The retrieval process lacks specificity and ignores the differences between different content formats, resulting in limited classification and recognition capabilities for complex content, further increasing the risk of false detection and missed detection. These problems cause users to spend more time and energy when looking for specific information, reducing retrieval efficiency and affecting the experience of information acquisition. Summary of the invention

[0004] The present application provides a content retrieval method combining PDF search mode with OCR recognition, which solves the technical problem that the existing PDF file content retrieval method cannot effectively identify the relationship and differences between different formats when processing complex documents containing multiple formats, resulting in recognition errors and omissions, which affects the efficiency and accuracy of information acquisition, and achieves the technical effect of improving the efficiency and accuracy of image PDF file content retrieval.

[0005] In view of the above problems, the present application provides a content retrieval method combining a PDF search mode with OCR recognition, the method comprising: identifying the content format of a current imaged PDF file to obtain multiple content formats; performing OCR recognition similarities and differences analysis between the multiple content formats to obtain multiple similarities and differences indicators corresponding to the multiple content formats; classifying according to the multiple similarities and differences indicators to output N types of content formats; constructing N content recognition models according to text features of the N types of content formats; obtaining user search keywords, performing keyword search in the imaged PDF file by calling the N content recognition models, and outputting multiple content search return results corresponding to the N content recognition models; and positioning and displaying in the imaged PDF file according to the multiple content search return results.

[0006] One or more technical solutions provided in this application have at least the following technical effects or advantages:

[0007] By identifying the content format of the current imaged PDF file and obtaining multiple content formats, the understanding of the document structure is improved, so that the subsequent steps can be processed based on accurate format information, laying the foundation for content retrieval. Based on the OCR recognition similarities and differences analysis between the multiple content formats, multiple similarities and differences indicators corresponding to the multiple content formats are obtained, the characteristics of different contents are more accurately identified, and the effectiveness of subsequent classification and retrieval is improved. According to the multiple similarities and differences indicators, classification is performed, N types of content formats are output, and different types of content are systematically sorted, which enhances the pertinence of the retrieval model and reduces information loss and misunderstanding caused by format differences. Based on the classification results, according to the text features of the N types of content formats, a special recognition model is established for each type of content format, and N content recognition models are determined, which greatly improves the recognition accuracy when processing specific formats, and improves the accuracy and efficiency of the overall retrieval. Obtain user search keywords, and perform keyword retrieval in the imaged PDF file by calling the N content recognition models. Different models perform retrieval for different content features to maximize coverage, and output multiple content retrieval return results corresponding to the N content recognition models to improve retrieval accuracy and comprehensiveness. According to the multiple content search return results, the positioning is displayed in the image PDF file, so that the user can quickly find the required information and improve the efficiency of information acquisition.

[0008] In summary, this application significantly improves the accuracy and efficiency of PDF content retrieval by identifying and analyzing the content format of imaged PDF files, combining OCR technology to conduct similarities and differences research, systematically classifying and building targeted content recognition models. By flexibly calling different models to perform user keyword retrieval and accurately locating results in documents, the ability to adapt to diverse content is enhanced, the overall comprehensiveness and accuracy of information acquisition is improved, helping users quickly obtain the required information, and significantly optimizing the information retrieval experience.

[0009] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 A flowchart of a content retrieval method combining a PDF search mode with OCR recognition provided in an embodiment of the present application;

[0011] Figure 2 A schematic diagram of a process for obtaining multiple content formats in a content retrieval method combining a PDF search mode with OCR recognition provided in an embodiment of the present application;

[0012] Figure 3 A flowchart of constructing N content recognition models in a content retrieval method combining a PDF search mode with OCR recognition provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] The embodiment of the present application provides a content retrieval method combining PDF search mode with OCR recognition, which identifies the content format of an imaged PDF file, builds a corresponding content recognition model for each content format, calls multiple content recognition models to perform keyword searches in the imaged PDF file, and outputs multiple corresponding content search results. This solves the technical problem that the existing PDF file content retrieval method cannot effectively identify the relationship and difference between different formats when processing complex documents containing multiple formats, resulting in easy recognition errors and omissions, affecting the efficiency and accuracy of information acquisition, and achieves the technical effect of improving the efficiency and accuracy of imaged PDF file content retrieval.

[0014] like Figure 1 As shown, the embodiment of the present application provides a content retrieval method combining a PDF search mode with OCR recognition, the method comprising:

[0015] Step S1: Identify the content format of the current image PDF file and obtain multiple content formats.

[0016] Specifically, an image PDF file refers to a PDF document whose contents are stored in the form of images. It can be a scanned document or a PDF file containing complex formats. Content formats refer to different types of text fonts, text colors, and annotations in the document.

[0017] First, the input image PDF file is analyzed and various content formats in the file are identified using OCR technology. For example, fonts of different colors, different font styles (such as bold, italic), and the layout and style of annotations. The identified content formats are recorded to provide basic data for subsequent processing.

[0018] Step S2: performing OCR recognition similarities and differences analysis between the multiple content formats to obtain multiple similarity and difference indicators corresponding to the multiple content formats.

[0019] Specifically, OCR (Optical Character Recognition) technology is a technology that converts text in an image into an editable text format. The similarity and dissimilarity index is used to evaluate the feature differences and similarities between different content formats.

[0020] Apply OCR technology to the multiple content formats identified in step S1 to extract various types of text content. Perform similarities and differences analysis by comparing the features of these texts (such as font style, text size, and text color). For example, you can use OCR tools such as Tesseract to extract text, and record the recognition accuracy, speed, and specific patterns of recognition errors. Quantify the recognition performance of each format through statistical methods, such as mean value, standard deviation, etc., and calculate the similarities and differences between different formats. These indicators can help determine the similarities and differences between different content formats.

[0021] Step S3: Classify according to the multiple similarities and differences indicators and output N types of content formats.

[0022] Specifically, using the similarity and difference indicators generated in the previous step, unsupervised learning algorithms such as K-means clustering, DBSCAN or hierarchical clustering are used to classify content formats, group similar content formats into one category, and output N types of content formats, such as "black font", "red font", "annotated text", etc., for subsequent processing.

[0023] Step S4: constructing N content recognition models according to the text features of the N types of content formats.

[0024] Specifically, text features are attributes that describe text, such as font, layout, clarity, etc., and are used to build content recognition models. Content recognition models refer to algorithmic models built for specific content formats, aiming to improve the recognition accuracy of content in that format.

[0025] According to the characteristics of each type of content format, N specialized content recognition models are built using machine learning algorithms, each of which can focus on the recognition of a specific format to improve the accuracy of subsequent retrieval. For example, a convolutional neural network (CNN) can be trained and optimized for different formats using a deep learning framework (such as TensorFlow or PyTorch) to generate N content recognition models.

[0026] Step S5: Obtain user search keywords, perform keyword search in the imaged PDF file by calling the N content recognition models, and output a plurality of content search return results corresponding to the N content recognition models.

[0027] Specifically, a user search keyword is a text string entered by the user to find specific information. A keyword can be a word, phrase, or sentence. Content search returns results that are text snippets or regions found in the PDF file that match the user's keyword. These results usually include the context in which the keyword appears and its location information in the PDF file.

[0028] Get the search keyword entered by the user, and call N content recognition models to search respectively. Each model matches the keyword according to its specific content format, and outputs multiple search results related to the user's keyword. For example, if the user enters the keyword "annual report", the corresponding text content is searched in the body text model, and the corresponding content is searched in the annotation text model.

[0029] Step S6: According to the plurality of content search results, the results are located and displayed in the imaged PDF file.

[0030] Specifically, multiple content search return results outputted in step S5 are obtained, and the corresponding area of ​​the original PDF file is marked according to the position information of each return result. The graphic rendering technology in the PDF reader or editor can be used to display these marked results to the user in a visually obvious manner (such as highlighting, underlining, borders, etc.). For example, if a keyword is in a specific page number and position in a PDF file, the text or content block is highlighted to facilitate the user to quickly locate the required information, thereby improving the efficiency and convenience of the user in finding information in a large PDF file.

[0031] Further, such as Figure 2 As shown, step S1 of the embodiment of the present application also includes:

[0032] Perform image layer extraction on the imaged PDF file to obtain multiple image layers; input the multiple image layers into an image optimization module, wherein the image optimization module includes clarity standardization, image denoising, and contrast synchronization; output multiple optimized image layers according to the image optimization module; identify the multiple optimized image layers to obtain multiple content formats.

[0033] Specifically, first, extract multiple image layers from the image PDF file. You can use PDF processing tools (such as PyMuPDF or PDF.js) to convert the PDF content into separate image files. Each image layer contains different information, such as black fonts, red fonts, text annotations, etc.

[0034] Next, the extracted multiple image layers are input into the image optimization module. The image optimization module is a set of processing tools for improving image quality, including techniques such as clarity normalization, image denoising, and contrast synchronization. In this module, the clarity normalization is performed through the image enhancement algorithm in the image processing library (such as OpenCV), and the clarity of the image in each image layer is adjusted to make the different image layers consistent in resolution and details; the noise in the image is removed through filters (such as Gaussian filtering or median filtering) to improve the image quality. Contrast synchronization is used to ensure that the contrast of all image layers is relatively consistent so that the content is easier to recognize during subsequent processing. After processing by the image optimization module, multiple optimized image layers are output. The quality of these optimized image layers is significantly improved, suitable for more accurate content format recognition.

[0035] Finally, these optimized image layers are identified, and multiple content formats are extracted using OCR technology and image recognition algorithms. For example, Tesseract is used for text extraction, and deep learning models are used to classify images to ensure that different types of content can be accurately identified.

[0036] The above steps improve the image quality by extracting and optimizing the image layer, so as to facilitate the clear recognition of content in different formats, thereby greatly improving the recognition accuracy of the content in the PDF file.

[0037] Furthermore, after extracting the image layer of the imaged PDF file, the method further includes:

[0038] After extracting the image layer of the imaged PDF file, determine whether the imaged PDF file has any remaining digital text layer; if the imaged PDF file has any remaining digital text layer, identify the multiple optimized image layers and the digital text layer to obtain multiple content formats.

[0039] Specifically, after extracting the image layer of the imaged PDF file, check whether there is any remaining digital text layer. The digital text layer refers to the editable text content directly contained in the PDF file, rather than the text that only exists in the form of an image. PDF processing libraries (such as PyMuPDF or PDFMiner) can be used to read the text information in the PDF and determine its existence. If a digital text layer is found in the file, record this information and prepare for subsequent processing.

[0040] At the same time, multiple optimized image layers and digital text layers are recognized, and text is extracted from the optimized image layer using OCR technology, while the content of the digital text layer is directly read. For the image layer, OCR tools such as Tesseract can be used; for the digital text layer, the text extraction function of the PDF processing library can be directly called to obtain its content.

[0041] By simultaneously identifying and optimizing the image layer and the digital text layer, it is possible to integrate information from these two sources and ultimately obtain multiple content formats, ensuring the comprehensiveness of the identification, extracting as much information as possible from the document, and forming a complete content structure.

[0042] For example, there is an imaged PDF file that contains a scanned document (as an image layer) and some directly generated editable text (as a digital text layer). First, the image layer is extracted and optimized, and then it is determined whether there is any editable digital text in the file. If so, both the optimized image content (such as scanned text) and the direct text in the PDF (such as titles, paragraphs) are extracted, ultimately ensuring that all possible information is recognized.

[0043] Furthermore, step S2 of the embodiment of the present application further includes:

[0044] Acquire characteristic indicators corresponding to each of the multiple content formats, including recognition accuracy, recognition speed, recognition ambiguity, and character spacing; perform analysis based on the characteristic indicators corresponding to each content format, and output multiple OCR recognition feature vectors corresponding to the multiple content formats; quantify the similarities between the multiple OCR recognition feature vectors, and output multiple similarity and difference indicators corresponding to the multiple content formats.

[0045] Specifically, feature indicators are quantitative indicators used to describe and quantify the effect of content format recognition. In OCR recognition, feature indicators include recognition accuracy (the degree of match between the recognition result and the actual content), recognition speed (the time required for the recognition process), recognition ambiguity (the uncertainty or ambiguity of the recognition result), and character spacing (the spatial distance between characters in the text).

[0046] Use OCR tools to analyze multiple recognized content formats and extract characteristic indicators corresponding to each content format. These indicators include recognition accuracy, recognition speed, recognition ambiguity, and character spacing. For example, the recognition accuracy can be determined by comparing the recognition results with the manually annotated content. By recording the time required for processing each content format, the average processing speed is calculated as the recognition speed. The clarity of the recognized text is evaluated through image processing technology (such as edge detection) to determine the recognition ambiguity. Analyze the space between characters in the recognized text to determine the character spacing.

[0047] The characteristic indicators of each content format are combined into a multidimensional vector to represent the OCR recognition characteristics of the content format, and multiple OCR recognition feature vectors are generated. The similarity between multiple OCR recognition feature vectors is quantified, and the distance between feature vectors is calculated using cosine similarity or Euclidean distance, so as to judge the similarity and difference of different content formats, and output multiple similarity and difference indicators corresponding to each content format. If the feature vectors of two content formats are similar, it means that they are similar in recognition effect, otherwise they are quite different.

[0048] The above steps analyze the characteristic indicators of each content format and convert them into feature vectors. Through similarity quantification, we can deeply understand the similarities and differences between different content formats and provide basic data for subsequent classification and recognition models.

[0049] Further, such as Figure 3 As shown, step S4 of the embodiment of the present application also includes:

[0050] According to the text features of the N types of content formats, N types of training data sets are collected; the convolutional neural network is initialized to train the N types of training data sets separately, and N initial content recognition models are output; the N initial content recognition models are integrated and fused to learn, and an integrated content recognition model is generated; the learning parameters of the N initial content recognition models are optimized according to the learning parameters of the integrated content recognition model, and N content recognition models are constructed.

[0051] Specifically, corresponding training data sets are collected according to the text features of N types of content formats. Each type of content format requires sufficient example data for the model to learn effectively. These data can come from existing annotated data sets, or be generated through manual annotation and synthetic data. Exemplarily, the content formats have been divided into three categories: black font, red font, and text with annotations. For each type of content format, a corresponding training data set is collected. The black font training data set contains samples of various black fonts, such as document content, newspaper articles, etc. of different font types. The label of each sample is "black font". The red font training data set contains red font texts of different styles, including marks of important information, warning prompts, etc. The label of each sample is "red font". The annotated text data set contains text samples with annotations, which may be boxes, underlines, or marginal notes of different colors. The label of each sample is "text with annotations".

[0052] Using a deep learning framework such as TensorFlow or PyTorch, a convolutional neural network is initialized for each content format, and these initialized convolutional neural networks are trained separately with the corresponding training data set. These models learn the characteristics of each type of content through the process of forward propagation and back propagation, and continuously optimize the parameters. After training, N initial content recognition models are output. Each model focuses on the recognition of its corresponding content format.

[0053] Exemplarily, different convolutional neural network models are initialized according to the above three types of content formats to identify each type of content format. First, a convolutional neural network model is initialized, denoted as the black font model, which is optimized for the black font features, and the appropriate structure of the convolution layer, pooling layer, and fully connected layer is selected, and the learning rate and loss function are set. Another convolutional neural network model is initialized, denoted as the red font model, which focuses on the recognition of red fonts. According to the characteristics of the red font, the model parameters are adjusted to cope with different colors and clarity. The third convolutional neural network model is initialized and trained for text with annotations, denoted as the annotated text model. This model focuses on the spatial relationship between the annotation border, color, and text.

[0054] The black font training dataset is used to train the black font model. The model learns how to identify the features of black text through the back propagation algorithm. During the training process, the model parameters are continuously adjusted to improve the recognition accuracy. The same training process is performed using the red font training dataset to train the red font model. The model will focus on identifying the features of red text, including its appearance and clarity in the image. The annotated text training dataset is used to train the annotated text model. The model learns the various styles and relative positions of annotations to ensure that the annotated content can be accurately recognized.

[0055] After training, the following three initial content recognition models are output: Black font recognition model, which can efficiently recognize black text, including black content of different fonts and sizes. Red font recognition model, which focuses on recognizing red fonts and is suitable for extracting warning information or important marks. Annotation text recognition model, which is optimized for content with annotations and can recognize various types of annotation styles.

[0056] The N initial content recognition models are integrated and fused to learn, and the prediction results of the N initial models are merged to train a more powerful integrated content recognition model through the integrated learning method. Integrated fusion can adopt strategies such as weighted voting and averaging to conduct a comprehensive evaluation based on the performance contribution of different models. Based on the learning parameters of the integrated content recognition model, the learning parameters of the N initial models are optimized. Algorithms (such as gradient descent) are usually used to adjust the model parameters so that each model performs better when facing new data, thereby building a more mature N content recognition model.

[0057] The above steps build efficient content recognition models by systematically collecting training data, initializing and training convolutional neural networks, and integrating fusion learning. These models can be optimized for different content formats, improving the effectiveness and accuracy of recognizing complex documents.

[0058] Furthermore, optimizing the learning parameters of the N initial content recognition models according to the learning parameters of the integrated content recognition model further includes:

[0059] Tests are performed according to the learning parameters of each initial content recognition model, and N recognition errors are output; a marked-initial content recognition model whose recognition error is greater than a preset recognition error is obtained; updated model parameters are obtained according to the learning parameters of the integrated content recognition model; the learning parameters of the marked-initial content recognition model are iteratively adjusted according to the updated model parameters until a content recognition model whose recognition error is less than or equal to the preset recognition error is obtained, and N content recognition models are constructed.

[0060] Specifically, learning parameters refer to the parameters adjusted by the model during the training process, mainly including weights and biases, which determine the model's predictive ability. Recognition error refers to the difference between the model's prediction result and the true label, usually expressed in the form of error rate or loss value. The preset recognition error is a model performance threshold set in advance. Label-initial content recognition models refer to those initial models whose recognition errors exceed the preset recognition error, and these models need to be further optimized.

[0061] First, test each initial content recognition model, compare the model's prediction results with the true label, calculate its recognition error on the validation set, and output N recognition errors. For example, if a model has an error rate of 5% in text recognition and another model has an error rate of 10%, then the recognition errors of the two models are 5% and 10% respectively.

[0062] Compare the N recognition errors with the preset recognition errors, find out the initial content recognition model whose recognition error is higher than the preset recognition error, mark it, and determine it as the marked-initial content recognition model. Extract the learning parameters of the integrated content recognition model as the updated model parameters. Adopt the gradient descent algorithm, iteratively adjust the learning parameters of each marked-initial content recognition model according to the updated model parameters, and gradually reduce the recognition error by continuously calculating the loss and adjusting the parameters. After each adjustment, retest the model to check whether the recognition error is less than or equal to the preset recognition error. After multiple iterative adjustments, until the model recognition error is less than or equal to the preset recognition error, the optimized N content recognition models will be output. These models can show good recognition ability within the given error range.

[0063] For example, in the recognition model optimization stage, if the recognition error of the text model exceeds the preset recognition error, we obtain better parameters such as learning rate and regularization coefficient from the integrated model and apply them to the training of the text model. Through multiple iterations, the recognition error of the text model is reduced to below the preset value, and the final text model is constructed.

[0064] Furthermore, the learning parameters of the tag-initial content recognition model are iteratively adjusted according to the update model parameters, and the expression is:

[0065] ;

[0066] in, is the learning parameter of the label-initial content recognition model after the t+1th iteration, is the learning parameter of the label-initial content recognition model after the tth iteration, is the learning rate, which is used to control the speed of parameter update. Represents the loss function L for the parameter The gradient of Represents the input sample and corresponding labels , the loss function L is used to measure the recognition error between the model prediction value and the true value.

[0067] Specifically, the gradient descent algorithm is used to iteratively adjust the learning parameters of the label-initial content recognition model. The specific process includes: for each label-initial content recognition model, obtaining its initial learning parameters .

[0068] For a given training sample , using the current learning parameters Predict the sample and use the loss function L to calculate the model prediction value and the corresponding true value (label ), and calculate the loss function for the parameter Gradient , the gradient points to the direction where the loss function grows fastest. Set the learning rate , determines the magnitude of parameter update. Use the formula Update the parameters, that is, move the parameters in the opposite direction of the gradient (that is, the direction in which the loss function decreases).

[0069] Use the updated parameters to re-predict the training samples, repeat the above steps, and continuously iterate the learning parameters of the label-initial content recognition model. After each iteration, the validation set can be used to evaluate the performance of the model until the model recognition error is less than or equal to the preset recognition error, and the final parameters are determined. and a content recognition model constructed using the learned parameters.

[0070] Furthermore, after outputting the multiple content search return results corresponding to the N content recognition models in step S5 of the embodiment of the present application, the method further includes:

[0071] The multiple content search return results are evaluated and a credibility score of each search result is output; the content search return results with a credibility score lower than a preset threshold are subjected to secondary OCR recognition and the multiple content search return results are updated.

[0072] Specifically, the confidence score is an indicator used to evaluate the reliability and accuracy of the search results, usually expressed as a percentage or score. The preset threshold is the minimum requirement for the confidence score, and results below this value will be considered unreliable.

[0073] After outputting multiple content retrieval return results corresponding to N content recognition models, these results need to be evaluated to verify the credibility of the retrieval results. A credibility score is generated for each result by analyzing the characteristic indicators of each result (such as recognition accuracy, character spacing, etc.). For example, if the content of a result is clear and highly relevant to the user's search keywords, the credibility score may be high (such as 90%), while the score of an ambiguous result may be low (such as 60%). Compare the credibility score of each retrieval result with the preset threshold. If the score of a result is lower than the preset threshold (for example, set to 75%), the result will be marked as an object that needs further processing.

[0074] For the content retrieval results that are marked and have a low credibility score, a secondary OCR recognition is performed to perform additional optimization on the image to improve the accuracy of recognition. For example, if the initially recognized text contains blurred characters or recognition errors, the OCR technology can be applied again by adjusting the image contrast and clarity to extract more accurate text. After the secondary OCR recognition is completed, the original content retrieval results are replaced and updated with the secondary recognition results, thereby improving the reliability of the overall retrieval. This not only ensures that the information obtained by the user is more accurate, but also enhances the ability to handle complex text.

[0075] In summary, the content retrieval method combining the PDF search mode with OCR recognition provided in the embodiment of the present application has the following technical effects:

[0076] By identifying the content format of the current imaged PDF file and obtaining multiple content formats, the understanding of the document structure is improved, so that the subsequent steps can be processed based on accurate format information, laying the foundation for content retrieval. Based on the OCR recognition similarities and differences analysis between the multiple content formats, multiple similarities and differences indicators corresponding to the multiple content formats are obtained, and the characteristics of different contents are more accurately identified, which improves the effectiveness of subsequent classification and retrieval. According to the multiple similarities and differences indicators, classification is performed, N types of content formats are output, and different types of content are systematically sorted, which enhances the pertinence of the retrieval model and reduces information loss and misunderstanding caused by format differences. Based on the classification results, different content formats are trained using convolutional neural networks to build multiple initial content recognition models, and the overall performance of the model is improved through integrated fusion learning. N content recognition models are constructed, which greatly improves the recognition accuracy when processing specific formats and improves the accuracy and efficiency of the overall retrieval. The user's search keywords are obtained, and the N content recognition models are called to perform keyword retrieval in the imaged PDF file. Different models are retrieved for different content features to maximize the coverage rate, and multiple content retrieval return results corresponding to the N content recognition models are output to improve the retrieval accuracy and comprehensiveness. Furthermore, by evaluating the recognition results and performing secondary OCR recognition, the accuracy and credibility of the content retrieval results are effectively improved. According to the multiple content retrieval return results, the positioning display is performed in the imaged PDF file, so that the user can quickly find the required information and improve the efficiency of information acquisition.

[0077] Overall, the embodiment of the present application significantly improves the accuracy and efficiency of PDF content retrieval by identifying and analyzing the content format of imaged PDF files, combining OCR technology to conduct similarities and differences research, systematically classifying and building targeted content recognition models. By flexibly calling different models to perform user keyword retrieval and accurately locating results in documents, the adaptability to diversified content is enhanced, the overall comprehensiveness and accuracy of information acquisition is improved, helping users quickly obtain the required information, and significantly optimizing the information retrieval experience.

[0078] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A content retrieval method combining PDF search mode with OCR recognition, characterized in that: The method comprises: Identify the content format of the current imaged PDF file and obtain multiple content formats; Based on performing OCR recognition similarities and differences analysis between the multiple content formats, obtaining multiple similarity and difference indicators corresponding to the multiple content formats; Classify according to the multiple similarities and differences indicators, and output N types of content formats; Constructing N content recognition models according to the text features of the N types of content formats; Obtaining a user search keyword, performing a keyword search in the imaged PDF file by calling the N content recognition models, and outputting a plurality of content search return results corresponding to the N content recognition models; Positioning and displaying the imaged PDF file according to the plurality of content search return results; Based on performing OCR recognition similarities and differences analysis between the multiple content formats, obtaining multiple similarity and difference indicators corresponding to the multiple content formats, the method also includes: Acquire characteristic indicators corresponding to each content format of the plurality of content formats, including recognition accuracy, recognition speed, recognition ambiguity, and character spacing; Analyze according to the characteristic index corresponding to each content format, and output multiple OCR recognition feature vectors corresponding to the multiple content formats; Similarity quantification is performed between the multiple OCR recognition feature vectors, and multiple similarity and difference indicators corresponding to the multiple content formats are output.

2. The method according to claim 1, characterized in that Identifying the content format of the current imaged PDF file to obtain multiple content formats; the method also includes: Extracting image layers from the imaged PDF file to obtain multiple image layers; Inputting the plurality of image layers into an image optimization module, wherein the image optimization module includes clarity normalization, image denoising, and contrast synchronization; Outputting a plurality of optimized image layers according to the image optimization module; The multiple optimized image layers are identified to obtain multiple content formats.

3. The method according to claim 2, characterized in that After extracting the image layer of the imaged PDF file, the method further includes: After extracting the image layer of the imaged PDF file, determining whether there is a remaining digital text layer in the imaged PDF file; If there are remaining digital text layers in the imaged PDF file, the multiple optimized image layers and the digital text layers are identified to obtain multiple content formats.

4. The method according to claim 1, characterized in that According to the text features of the N types of content formats, N content recognition models are constructed, the method comprising: Collecting N types of training data sets according to the text features of the N types of content formats; Initialize the convolutional neural network to perform separate training on the N types of training data sets, and output N initial content recognition models; Performing integrated fusion learning on the N initial content recognition models to generate an integrated content recognition model; The learning parameters of the N initial content recognition models are optimized according to the learning parameters of the integrated content recognition model to construct N content recognition models.

5. The method according to claim 4, characterized in that The learning parameters of the N initial content recognition models are optimized according to the learning parameters of the integrated content recognition model, the method comprising: Test each initial content recognition model based on its learning parameters and output N recognition errors; Obtaining a marker-initial content recognition model whose recognition error is greater than a preset recognition error; According to the learning parameters of the integrated content recognition model, obtaining update model parameters; The learning parameters of the marked-initial content recognition model are iteratively adjusted according to the updated model parameters until a content recognition model with a recognition error less than or equal to the preset recognition error is obtained, and N content recognition models are constructed.

6. The method according to claim 5, characterized in that The learning parameters of the tag-initial content recognition model are iteratively adjusted according to the updating model parameters, and the expression is: ; in, is the learning parameter of the label-initial content recognition model after the t+1th iteration, is the learning parameter of the label-initial content recognition model after the tth iteration, is the learning rate, which is used to control the speed of parameter update. Represents the loss function L for the parameter The gradient of Represents the input sample And the corresponding label , the loss function L is used to measure the recognition error between the model prediction value and the true value.

7. The method according to claim 1, characterized in that After outputting a plurality of content search return results corresponding to the N content recognition models, the method further includes: Evaluate the multiple content search results and output a credibility score for each search result; The content search return results with a credibility score lower than a preset threshold are subjected to secondary OCR recognition, and the plurality of content search return results are updated.

Citation Information

Patent Citations

  • Method and device for identifying and extracting content of PDF architectural drawing

    CN114241506A

  • Methods and systems for enhancing image quality for documents with highlighted content

    US20200028987A1

  • Extracting data from documents using multiple deep learning models

    US20220121821A1