Document quality determination method and apparatus, electronic device, and storage medium
By structurally decomposing and feature-fusioning documents, and using deep learning models to process document quality, the problem of efficiently screening high-quality documents in the context of information overload is solved, achieving accuracy and comprehensiveness in document quality evaluation and meeting the needs of enterprise knowledge management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BAIDU INT TECH (SHENZHEN) CO LTD
- Filing Date
- 2022-11-24
- Publication Date
- 2026-07-14
AI Technical Summary
In the context of information overload, how can we efficiently filter out high-quality document resources, ensure the accuracy and comprehensiveness of document quality evaluation, and avoid evaluation bias caused by cluttered structure and layout?
By breaking down the document into structural layouts, extracting structural data and text features from text blocks, fusing image features using a deep learning model, determining document quality results, and combining the relationships and logic between text blocks, OCR technology is used to process documents with non-predefined formats.
It enables refined analysis of document quality, improves the accuracy and comprehensiveness of document quality evaluation, effectively filters out high-quality documents, builds a high-quality resource library, and meets the knowledge management needs of enterprises.
Smart Images

Figure CN115718734B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of deep learning, computer vision, and image processing, and can be applied to OCR application scenarios. Specifically, it relates to document quality determination methods, devices, electronic devices, storage media, and program products. Background Technology
[0002] With the rapid development of information and network technologies, information overload and redundancy have brought confusion to people's social and entertainment activities regarding information selection. Finding the information needed from a vast amount of resources is extremely challenging. Summary of the Invention
[0003] This disclosure provides a method, apparatus, electronic device, storage medium, and program product for determining document quality.
[0004] According to one aspect of this disclosure, a method for determining document quality is provided, comprising: splitting the text in a document into multiple text blocks according to the document structure layout; obtaining document structure features based on the structural data of each of the multiple text blocks; and determining the document quality result of the document based on the document structure features and the text features of the document.
[0005] According to another aspect of this disclosure, a document quality determination apparatus is provided, comprising: a splitting module for splitting text in a document according to the document structure layout to obtain multiple text blocks; a first extraction module for obtaining document structure features based on the structural data of each of the multiple text blocks; and a result determination module for determining the document quality result of the document based on the document structure features and the text features of the document.
[0006] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as disclosed herein.
[0007] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the methods as disclosed herein.
[0008] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method as disclosed herein.
[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0010] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0011] Figure 1 This illustration schematically shows an exemplary system architecture to which the document quality determination method and apparatus can be applied according to embodiments of the present disclosure;
[0012] Figure 2 A flowchart illustrating a document quality determination method according to an embodiment of the present disclosure is shown schematically.
[0013] Figure 3 A network structure diagram of a document quality identification model according to an embodiment of the present disclosure is illustrated schematically.
[0014] Figure 4A A schematic diagram of a document in a predetermined format according to an embodiment of the present disclosure is shown.
[0015] Figure 4B The illustration shows a document in a non-predetermined format according to an embodiment of the present disclosure;
[0016] Figure 5 A block diagram of a document quality determination apparatus according to an embodiment of the present disclosure is schematically shown; and
[0017] Figure 6 A block diagram of an electronic device suitable for implementing a document quality determination method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0018] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0019] This disclosure provides a method, apparatus, electronic device, storage medium, and program product for determining document quality.
[0020] According to embodiments of this disclosure, a document quality determination method is provided, comprising: splitting the text in a document into multiple text blocks according to the document structure layout; obtaining document structure features based on the structural data of each of the multiple text blocks; and determining the document quality result based on the document structure features and the document's text features.
[0021] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.
[0022] In the technical solution disclosed herein, the user's authorization or consent is obtained before acquiring or collecting the user's personal information.
[0023] Figure 1 The illustration schematically depicts an exemplary system architecture to which a document quality determination method and apparatus can be applied according to embodiments of the present disclosure.
[0024] It is important to note that Figure 1 The examples shown are merely examples of system architectures applicable to embodiments of this disclosure, intended to help those skilled in the art understand the technical content of this disclosure. They do not imply that embodiments of this disclosure cannot be used in other devices, systems, environments, or scenarios. For instance, in another embodiment, an exemplary system architecture for applying the document quality determination method and apparatus may include a terminal device. However, the terminal device can implement the document quality determination method and apparatus provided by embodiments of this disclosure without interacting with a server.
[0025] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the terminal devices 101, 102, and 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0026] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (for example only).
[0027] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0028] Server 105 can be a server that provides various services, such as a backend management server that supports the content browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0029] It should be noted that the document quality determination method provided in this embodiment can generally be executed by terminal devices 101, 102, or 103. Correspondingly, the document quality determination device provided in this embodiment can also be disposed in terminal devices 101, 102, or 103.
[0030] Alternatively, the document quality determination method provided in this embodiment can generally be executed by server 105. Correspondingly, the document quality determination device provided in this embodiment can generally be located in server 105. The document quality determination method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the document quality determination device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.
[0031] For example, a user sends a document to server 105 via terminal devices 101, 102, and 103. Server 105 then breaks down the text in the document into multiple text blocks based on the document's structure and layout. Based on the structural data of each text block, the document's structural features are obtained. Based on these structural features and the document's text features, the document's quality is determined. Alternatively, a server or server cluster capable of communicating with terminal devices 101, 102, and 103 and / or server 105 can analyze the document and ultimately determine its quality.
[0032] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0033] It should be noted that the sequence numbers of the operations in the following methods are for descriptive purposes only and should not be considered as indicating the execution order of the operations. Unless explicitly stated otherwise, the method does not need to be executed in the exact order shown.
[0034] Figure 2 A flowchart illustrating a document quality determination method according to an embodiment of the present disclosure is shown schematically.
[0035] like Figure 2 As shown, the method 200 includes operations S210 to S230.
[0036] In operation S210, the text in the document is split into multiple text blocks according to the document structure layout.
[0037] In operation S220, the document structure features are obtained based on the structural data of each of the multiple text blocks.
[0038] In operation S230, the document quality result is determined based on the document's structural features and textual features.
[0039] According to embodiments of this disclosure, a document can refer to a knowledge resource that includes textual content. The format of the document is not limited; for example, it can be an image, a webpage, or editable text. It can be any resource that can be recognized and processed by a computer.
[0040] According to embodiments of this disclosure, prior to operation S210, the document quality determination method may further include the operation of: identifying the type of the initial document. If the type of the initial document is determined to be a predetermined type, the initial document is converted to generate a document.
[0041] According to embodiments of this disclosure, the predetermined type may refer to types such as images and PDF files. When the type of the initial document is determined to be the predetermined type, converting the initial document to generate a new document may include: using OCR (Optical Character Recognition) technology to perform text recognition on the initial document to generate the new document. This preprocessing operation can improve the application scope of the document quality determination method provided in embodiments of this disclosure.
[0042] According to embodiments of this disclosure, document structure layout refers to the arrangement of a document. The document structure layout can be determined by headings; for example, the document includes two main headings, and the text corresponding to each main heading includes three subheadings, each subheading containing corresponding text content. However, this is not a limitation. The document structure layout can also be determined by paragraphs; for example, the document is a three-paragraph document, including a first paragraph, a second paragraph, and a third paragraph. The text in the document can be split into multiple text blocks based on the document structure layout. The granularity of text block splitting is not limited. For example, text can be split based on main headings to obtain two text blocks. It can also be split based on subheadings to obtain six text blocks. When determining the document structure layout by paragraphs, the number of text blocks can be determined based on the number of paragraphs. Any multiple text blocks that reflect the document structure layout are acceptable.
[0043] According to embodiments of this disclosure, structural data can refer to data related to the structure of text blocks. For example, structural data may include at least one of the following: the number of characters in the text block, the number of paragraphs in the text block, the number of lines in the text block, and the keywords in the text block. Any data capable of characterizing the structure of text blocks in a document is acceptable.
[0044] According to embodiments of this disclosure, document structure features can be extracted from the structure data of each of the multiple text blocks.
[0045] According to embodiments of this disclosure, text features can be semantic features extracted from a document, but are not limited to this; any feature that can reflect the emotion, central idea, intent, etc., of the document is acceptable.
[0046] According to embodiments of this disclosure, determining a document quality result based on document structure features and document text features may include: fusing the document structure features and document text features to obtain fused features; and classifying the fused features to obtain the document quality result.
[0047] According to embodiments of this disclosure, document quality results are determined based on document structural features and document text features. The document structural features are obtained from the structural data of multiple text blocks, thus the granularity of document quality analysis is refined to the text block level. Analyzing a document by breaking it down into text blocks not only allows for the determination of the document's central idea, overall semantics, sentiment, and intent through text features, but also enables the determination of content relevance and logic among multiple text blocks by utilizing their interrelationships and structural layout. This, in turn, improves the accuracy of document quality determination from multiple perspectives and within multiple scopes.
[0048] According to embodiments of this disclosure, after operation S230, the document quality determination method may further include the operation of: storing the document in a resource library if the document quality result indicates that the document quality meets a predetermined document quality; and deleting the document if the document quality result indicates that the document quality does not meet the predetermined document quality.
[0049] According to embodiments of this disclosure, the predetermined document quality is a pre-set document quality standard. Documents whose quality meets the predetermined document quality standard can be considered high-quality documents. Using the document quality determination method provided in embodiments of this disclosure, high-quality documents can be selected from multiple documents and stored in a resource library for subsequent user access.
[0050] Taking knowledge resource management in an enterprise as an example, the document quality determination method provided in this disclosure can be used to assess the quality of documents within the knowledge resources and filter out high-quality documents. Then, a high-quality resource database, or resource library, is constructed using these high-quality documents. This allows employees within the enterprise to access high-quality documents from the resource library in recommendation or retrieval scenarios, enabling more employees to circulate and access these high-quality documents and obtain more information, such as work experience.
[0051] In relevant examples, document quality results can be determined by the text content and overall structure data of the document.
[0052] Compared to methods that determine document quality based on text content and overall structural data, the document quality determination method provided in this disclosure can break down the text in a document into multiple text blocks and determine structural data based on these text blocks. This allows for finer-grained analysis of the structural data, considering both the text's structural layout and the relationships between multiple text blocks within the document. Consequently, the document quality determination method fully considers factors such as the document's logic and readability, avoiding the evaluation of documents with cluttered structures as high-quality documents.
[0053] According to embodiments of this disclosure, for example, Figure 2 The illustrated operation S230, when it is determined that the document does not contain images, can directly determine the document quality result based on document structure features and text features. When it is determined that the document contains images, image features can be extracted to obtain image features. The document quality result is then determined based on the document structure features, text features, and image features.
[0054] According to embodiments of this disclosure, images may include images and video frames acquired using an information acquisition device, and may also include images generated from slides, tables, etc. Images can be combined with text to generate documents.
[0055] According to embodiments of this disclosure, determining the document quality result based on document structure features, text features, and image features may include: concatenating document structure features, text features, and image features to obtain document features. The document quality result is then determined based on these document features.
[0056] According to embodiments of this disclosure, concatenating document structure features, text features, and image features may include: utilizing a module in a deep learning model that performs feature fusion to concatenate document structure features, text features, and image features. The module performing feature fusion may include, for example, an Add module, a Concaten module, etc.
[0057] According to embodiments of this disclosure, document structure features, text features, and image features extracted from images are combined to jointly determine the document quality result, making the reference factors for determining the document quality result more comprehensive and effective.
[0058] According to exemplary embodiments of this disclosure, when a document is converted from an initial document, such as an image or PDF, using OCR technology, features can be extracted from the initial document to obtain original image features. These original image features are then combined with document structure features and text features to obtain document features. Based on these document features, which combine the original image features, the document quality result is determined. This approach utilizes original image features to reduce information bias introduced by OCR technology, better combines document structure features and text features, and improves the accuracy of the document quality result.
[0059] According to embodiments of this disclosure, for example, Figure 2 The operation S220 shown, which obtains document structure features based on the structural data of each of the multiple text blocks, may include the following operations.
[0060] For example, based on the structural data of multiple text blocks, a structural data sequence is obtained. Based on the structural data sequence, block structure features are obtained. Global layout analysis is performed on multiple text blocks to obtain global structural features. Based on the block structure features and global structural features, document structure features are obtained.
[0061] According to embodiments of this disclosure, the structural data sequence includes multiple structural data corresponding one-to-one with multiple text blocks, and the multiple structural data are ordered according to the structural layout relationships between the multiple text blocks. Block structural features are extracted from the structural data sequence. Therefore, the block structural features contain features that can reflect the structural layout relationships between the multiple text blocks.
[0062] According to embodiments of this disclosure, performing global layout analysis on multiple text blocks to obtain global structural features may include: performing global layout analysis on multiple text blocks to obtain global layout data; and obtaining global structural features based on the global layout data. However, it is not limited to this. It may also include: extracting global layout features from each of the multiple text blocks to obtain multiple text block layout features; and concatenating the multiple text block layout features to obtain global structural features.
[0063] According to embodiments of this disclosure, global structural data may include overall structural data. For example, it may include one or more of the following: the number of characters in the text of a document, the number of paragraphs in a document, the number of titles in a document, the number of languages in a document, and the number of characters in each language. Features can be extracted from the global layout data to obtain global structural features. Deep learning models such as convolutional neural networks and recurrent neural networks can be used to process the global structural data to obtain global structural features.
[0064] According to embodiments of this disclosure, obtaining block structure features based on a structured data sequence may include: extracting features from the structured data sequence to obtain block structure features. Deep learning models such as convolutional neural networks and recurrent neural networks can be used to process the structured data sequence to obtain block structure features. However, this is not a limitation. As long as the structured data sequence can be used as input data, and the contextual structure data within the structured data sequence can be combined during processing, it is acceptable. Ultimately, the block structure features should reflect the structural layout relationships between multiple text blocks.
[0065] According to embodiments of this disclosure, obtaining document structure features based on block structure features and global structure features may include: using a module with feature fusion capabilities in a deep learning model to concatenate the block structure features and global structure features to obtain the document structure features. The module with feature fusion capabilities may include, for example, an Add module, a Concaten module, etc.
[0066] It should be noted that multiple features can be concatenated using modules that have feature fusion capabilities, such as the Add (summation) module and the Concate (fusion) module. These will not be elaborated further below.
[0067] According to embodiments of this disclosure, document structure features include not only block structure features but also global structure features. This allows for evaluation from multiple structural layout factors, both overall and local, while also incorporating factors related to the structural layout relationships between multiple text blocks. Consequently, the logical coherence between text blocks can be evaluated, thereby fully utilizing the structural layout information in the document and avoiding deviations in document quality results.
[0068] According to embodiments of this disclosure, when performing such Figure 2 Before determining the document quality result based on the document structure features and the document text features, the document quality determination method may further include the following operations in operation S230 shown.
[0069] For example, full-text feature extraction is performed on the document's text to obtain the first text feature. Layout text is determined from the document's text to obtain a layout text sequence. Based on the layout text sequence, the second text feature is obtained. The first and second text features are then concatenated to obtain the final text feature.
[0070] According to embodiments of this disclosure, the layout text sequence includes multiple layout texts, which are texts used to represent the structural layout of a document. The multiple layout texts in the layout text sequence are ordered according to the structural layout relationship between the multiple layout texts.
[0071] According to embodiments of this disclosure, the layout text not only reflects the structural layout of the document but also its semantic information. For example, the layout text can be directly extracted from the document, but it is not limited to this; it can also be a revised summary based on the text in the document. Any text that can reflect the structure and semantics of the document is acceptable.
[0072] According to an exemplary embodiment of the present disclosure, determining layout text from the text of a document to obtain a layout text sequence includes: extracting the layout text of each text block among a plurality of text blocks to obtain a layout text sequence.
[0073] According to embodiments of this disclosure, layout text is extracted from multiple text blocks to obtain multiple layout texts. The multiple layout texts are then sorted according to the structural layout relationships between the multiple text blocks to obtain a layout text sequence. A second text feature is extracted using the layout text sequence obtained from the multiple text blocks, making the second text feature representative and able to highlight the semantic relationships and logical connections between the various text blocks of the document.
[0074] According to embodiments of this disclosure, the first text feature is obtained by extracting full-text features from the document's text. The second text feature is obtained by processing the layout text sequence. Obtaining the second text feature based on the layout text sequence may include: extracting features from the layout text sequence to obtain the second text feature. However, it is not limited to this. It may also include: extracting features from multiple layout texts in the layout text sequence separately to obtain multiple layout text features; concatenating the multiple layout text features to obtain the second text feature. As long as the layout text sequence can be used as input data, contextual data within the layout text sequence can be incorporated during the processing of the layout text sequence.
[0075] According to embodiments of this disclosure, the text features include not only first text features extracted from the full-text features of the document, but also second text features obtained based on the layout text sequence. This allows for evaluation from both overall and local semantic content perspectives, while also incorporating the semantic relationships between multiple layout texts. Furthermore, it enables the evaluation of the logical coherence between layout text sequences, thereby fully utilizing the text layout information in the document and avoiding deviations in document quality results.
[0076] According to exemplary embodiments of this disclosure, a document quality recognition model can be used to process documents to obtain document recognition results.
[0077] Figure 3 A network structure diagram of a document quality identification model according to an embodiment of the present disclosure is illustrated.
[0078] like Figure 3 As shown, the document quality recognition model M300 can include three branches: a structure layout module M310, an image module M320, and a text module M330. The structure layout module M310 processes the structure data sequence 311 and the global layout data 313 to obtain document structure features 315. The image module M320 processes the image 321 to obtain image features 323. The text module M330 processes the document's text 331 and the layout text sequence 332 to obtain text features 336.
[0079] like Figure 3 As shown, the structure layout module M310 may include a block structure extraction unit M311 and a global structure extraction unit M312. The structure data sequence 311 can be input into the block structure extraction unit M311 to obtain block structure features 312. Global layout analysis can be performed based on multiple text blocks to obtain global layout data 313. The global layout data 313 is then input into the global structure extraction unit M312 to obtain global structure features 314.
[0080] According to embodiments of this disclosure, the block structure extraction unit may include a recurrent neural network (RNN), but is not limited to this. It may also be other network structures with feature extraction functions, as long as it is a network structure that can make full use of the correlation in the structure data sequence and combine the context data.
[0081] According to embodiments of this disclosure, the global structure extraction unit may include a feedforward neural network. However, it is not limited to this. Any network structure with feature extraction capabilities is acceptable.
[0082] like Figure 3As shown, the structure layout module M310 also includes a first splicing unit M313. The global structure feature 314 and the block structure feature 312 can be input into the first splicing unit M313 to obtain the document structure feature 315.
[0083] According to embodiments of this disclosure, the first splicing unit may include an Add layer and a fully connected layer (FC) connected in sequence. However, it is not limited to this. It may also include a Concat layer or other layer structures with a fusion function. The network structures of the second splicing unit, the third splicing unit, and the fusion module described below are similar to the network structure of the first splicing unit and will not be described again.
[0084] like Figure 3 As shown, the image module M320 may include an image feature extraction unit M321 and a second stitching unit M322 connected in sequence. Image 321 in the document is input to the image feature extraction unit M321 to obtain image sub-features 322. If the document contains multiple images, multiple image sub-features corresponding one-to-one with the multiple images are input to the second stitching unit M322 to obtain image features 323. If the document contains only one image, the image sub-features are the image features themselves. If the document contains no images, the input data for the image module is empty.
[0085] According to embodiments of this disclosure, the image feature extraction unit may include a convolutional neural network. However, it is not limited to this. Any network structure capable of extracting features from an image is acceptable.
[0086] According to embodiments of this disclosure, image features can be extracted using the image feature extraction unit and the second stitching unit in the image module, thereby obtaining overall image content quality information.
[0087] like Figure 3 As shown, the text module M330 may include a text encoding unit M331, a global feature extraction unit M332, a layout feature extraction unit M333, and a third concatenation unit M334. The layout text sequence 331 is input to the text encoding unit M331 to obtain the layout text encoding sequence 332. The layout text encoding sequence 332 is input to the layout feature extraction unit M333 to obtain the second text feature 333. The text 334 is input to the global feature extraction unit M332 to obtain the first text feature 335. The first text feature 335 and the second text feature 333 are input to the third concatenation unit M334 to obtain the text feature 336.
[0088] According to embodiments of this disclosure, the layout feature extraction unit may include a recurrent neural network, but is not limited to this; it may also be other network structures with feature extraction capabilities, as long as they can fully utilize the relationships in the layout text sequence and combine contextual data. The global feature extraction unit may include Ernie or Bert, but is not limited to this; it may be any feature extraction network structure capable of encoding text. The text encoding unit may include an embedding (encoding) layer.
[0089] like Figure 3 As shown, the document quality recognition model M300 also includes a fusion module M340, which is used to fuse image features 323, document structure features 315 and text features to obtain document features 340.
[0090] like Figure 3 As shown, the document quality recognition model M300 also includes a classification module M350, which is used to obtain document quality results based on document features. The classification module may include a binary classification module, which obtains document quality results that characterize the quality of a document based on its features.
[0091] According to embodiments of this disclosure, the classification module may include a fully connected layer and an activation function. The activation function may include one of Softmax and Sigmoid.
[0092] According to embodiments of this disclosure, document features are input into a classification module to obtain document quality results. The document quality results can be labels used to characterize whether a document is of high or low quality.
[0093] According to embodiments of this disclosure, a document quality recognition model is used to identify documents, resulting in high recognition efficiency and fast processing speed.
[0094] According to embodiments of this disclosure, when it is determined that a document includes an image, obtaining block structure features based on a structure data sequence may include the following operations: determining image-related structure data; and obtaining block structure features based on the image-related structure data and the structure data sequence.
[0095] According to embodiments of this disclosure, image-related structural data, such as image type data, image quantity data, image sharpness, image noise content, and image size data, can also be combined with text block structural data as reference factors for evaluating the structural layout of a document. Based on image format, image type data can refer to whether the image is an animated image; based on image source, image type data can refer to data used to characterize the image source, such as data characterizing images captured by an acquisition device like a camera, or data characterizing images converted from PowerPoint or tables. Image size data can refer to the data of a single image, but is not limited to this; it can also refer to the percentage of the total image area to the total document area.
[0096] According to embodiments of this disclosure, obtaining block structure features based on image-related structural data and a structural data sequence may include: extracting features from the image-related structural data to obtain image structural features; extracting features from the structural data sequence to obtain initial block structure features; and concatenating the image structural features and the initial block structure features to obtain block structure features. However, this is not limited to this. It may also include: adding image-related structural data to the structural data sequence according to the document structure layout to obtain an updated structural data sequence; and extracting features from the updated structural data sequence to obtain block structure features. The block structure features are simply structural features obtained based on image-related structural data and a structural data sequence; the processing procedure is not specifically limited.
[0097] According to embodiments of this disclosure, combining image-related data with structural data sequences as reference data for structural layout enables comprehensive reference factors for the block structure features of a document, thereby making the document quality structure based on comprehensive block structure feature evaluation accurate and effective.
[0098] According to embodiments of this disclosure, when it is determined that a document includes an image, obtaining a second text feature based on a layout text sequence may include: performing text recognition on the image to obtain a text recognition result; and obtaining the second text feature based on the text recognition result and the layout text sequence when it is determined that the text recognition result is used to characterize that the image includes text.
[0099] According to embodiments of this disclosure, OCR technology can be used to perform text recognition on images to obtain text recognition results. The text recognition results can characterize whether an image contains text, but are not limited to this; they can also characterize the text content within the image. When it is determined that the text recognition results are used to characterize that an image contains text, the text recognition results for the image can be combined with a layout text sequence to obtain a second text feature.
[0100] According to embodiments of this disclosure, obtaining a second text feature based on the text recognition result and the layout text sequence may include: extracting features from the text recognition result to obtain the features of the text recognition result; extracting features from the layout text sequence to obtain initial text features; and concatenating the features of the text recognition result and the initial text features to obtain the second text feature. However, it is not limited to this. It may also include: adding the text recognition result to the layout text sequence according to the document structure layout to obtain an updated layout text sequence; and extracting features from the updated layout text sequence to obtain the second text feature. The second text feature only needs to be a structural feature obtained based on the text recognition result and the layout text sequence, and its processing is not specifically limited.
[0101] According to embodiments of this disclosure, combining text recognition results with layout text sequences as reference data for document semantic features enables comprehensive reference factors for document semantic features, thereby making the document quality structure based on comprehensive second text feature evaluation accurate and effective.
[0102] According to embodiments of this disclosure, before splitting the text in a document into multiple text blocks based on the document structure layout, the document quality determination method may further include the following operations.
[0103] For example, determine the document type. Determine the target processing mode that matches the document type. Determine the document structure layout based on the target processing mode.
[0104] According to embodiments of this disclosure, document types are categorized by their source (web-based documents and non-web-based documents) and by their presentation format (images, PDFs, PPTs, Word documents, etc.). However, this is not a limitation. Documents can be classified and categorized into multiple document types based on actual circumstances.
[0105] According to embodiments of this disclosure, a mapping relationship between document types and processing modes can be pre-set, and a target processing mode matching the document type can be determined from the mapping relationship. The document structure layout is then determined according to the target processing mode. This ensures that the determination of the document structure layout is accurate, simple, and efficient.
[0106] According to embodiments of this disclosure, when the document type is determined to be a web-based document, determining the document structure layout based on the target processing mode may include: determining the document structure layout based on the document's rendering result.
[0107] According to embodiments of this disclosure, a web-based document is a document rendered using computer rendering technology and displayed on a web page. During the rendering process, the rendering result is recorded. This rendering result includes the document's structural layout. For example, the rendering result includes the document's subject name, title, corresponding text content, and images within the document.
[0108] According to embodiments of this disclosure, text blocks in a document can be determined based on the document's structure and layout. For web-based documents, information can be obtained by combining rendering results, thereby determining the document's structure and layout. This method is both accurate and convenient, improving processing efficiency.
[0109] According to embodiments of this disclosure, when the document type is a non-web page document type, determining the document structure layout based on the target processing mode may include: determining whether the document is a document of a predetermined format based on multiple predetermined field information. If the document is determined to be a document of a predetermined format, the predetermined document structure layout of the document of the predetermined format is used as the document structure layout of the document. If the document is determined to be a document of a non-predetermined format, the paragraph structure layout of the document is used as the document structure layout of the document.
[0110] According to embodiments of this disclosure, a document may include a title and corresponding text. The document's format conforms to a predetermined format, which may include the paragraph formatting of the titles, but is not limited to this; it may also include the number of titles and the content of the titles conforming to the predetermined format. A template document with the predetermined format can be matched with the document to obtain a matching result. If the matching result indicates a match between the document and the template document, the document's format is determined to be the predetermined format. If the matching result indicates a mismatch between the document and the template document, the document's format is determined to be a non-predetermined format. Matching the template document with the document may include matching format-related information in the template document with the content in the document. Format-related information may include one or more of the following: the font, font size, and keywords at predetermined positions of the predetermined text.
[0111] Figure 4A A schematic diagram of a document in a predetermined format according to an embodiment of the present disclosure is shown.
[0112] like Figure 4AAs shown, document 410 includes, from top to bottom, a topic name 411, a first heading 412, text content related to the first heading 413, a second heading 414, and text content related to the second heading 415. The document can be matched with format-related information in the template document, such as the paragraph format of the first heading, the paragraph format of the second heading, and the keywords of the first and second headings. If a match is found, the document's structure layout is determined based on the template document's document structure layout.
[0113] According to embodiments of this disclosure, multiple template documents with different formats can be pre-set. The document only needs to match the format of one of the multiple template documents. The document structure layout is determined based on the mapping relationship between the template documents and the document structure layout.
[0114] According to embodiments of this disclosure, by splitting the text in a document according to its document structure layout, a first text block formed by a first title and text content related to the first title, and a second text block formed by a second title and text content related to the second title, can be obtained. However, this is not the only possibility. By splitting the text in a document according to its document structure layout, a first text block formed by a first title, a second text block formed by text content related to the first title, a third text block formed by the second title, and a fourth text block formed by text content related to the second title can also be obtained.
[0115] Figure 4B A schematic diagram of a document in a non-predetermined format according to an embodiment of the present disclosure is shown.
[0116] like Figure 4B As shown, document 420 includes, from top to bottom, a topic name 421, a first paragraph text 422, a second paragraph text 423, and a third paragraph text 424. A document without a title can be directly identified as a non-predefined format document. However, this is not the only option. The document can also be matched against multiple template documents to obtain matching results. Based on the matching results, the document's format is determined to be non-predefined.
[0117] According to embodiments of this disclosure, by splitting the text in a document according to the document structure layout, a first text block formed by a first paragraph of text, a second text block formed by a second paragraph of text, and a third text block formed by a third paragraph of text can be obtained.
[0118] According to embodiments of this disclosure, text blocks are divided based on document structure and layout for texts of different formats. This approach is both targeted and scientific, resulting in accurate and scientifically sound document quality assessments.
[0119] Figure 5 A block diagram of a document quality determination apparatus according to an embodiment of the present disclosure is shown schematically.
[0120] like Figure 5 As shown, the document quality determination device 500 includes: a splitting module 510, a first extraction module 520, and a result determination module 530.
[0121] The splitting module 510 is used to split the text in the document into multiple text blocks according to the document structure layout.
[0122] The first extraction module 520 is used to obtain document structure features based on the structural data of each of the multiple text blocks.
[0123] The result determination module 530 is used to determine the document quality result of the document based on the document structure features and the document text features.
[0124] According to embodiments of this disclosure, the first extraction module includes: a structure acquisition submodule, a first extraction submodule, a second extraction submodule, and a fusion submodule.
[0125] The structure acquisition submodule is used to obtain a sequence of structure data based on the structure data of multiple text blocks. The sequence of structure data includes multiple structure data that correspond one-to-one with the multiple text blocks, and the multiple structure data are ordered according to the structural layout relationship between the multiple text blocks.
[0126] The first extraction submodule is used to obtain the block structure features based on the structured data sequence.
[0127] The second extraction submodule is used to perform global layout analysis on multiple text blocks to obtain global structural features.
[0128] The fusion submodule is used to obtain document structure features based on block structure features and global structure features.
[0129] According to embodiments of this disclosure, the document quality determination device further includes: a second extraction module, a layout text determination module, a third extraction module, and a first splicing module.
[0130] The second extraction module is used to extract full-text features from the document's text to obtain the first text features.
[0131] The layout text determination module is used to determine the layout text from the text of the document and obtain a layout text sequence. The layout text sequence includes multiple layout texts, which are texts used to represent the structural layout of the document. The multiple layout texts in the layout text sequence are ordered according to the structural layout relationship between the multiple layout texts.
[0132] The third extraction module is used to obtain the second text features based on the layout text sequence.
[0133] The first splicing module is used to splice the first text feature and the second text feature to obtain the text feature.
[0134] According to embodiments of this disclosure, the document quality determination apparatus further includes: a type determination module, a pattern determination module, and a layout determination module.
[0135] The type determination module is used to determine the document type of a document.
[0136] The pattern determination module is used to determine the target processing pattern that matches the document type.
[0137] The layout determination module is used to determine the document structure layout based on the target processing mode.
[0138] According to embodiments of this disclosure, the document type is a web-based document type.
[0139] According to an embodiment of this disclosure, the layout determination module includes: a first layout determination submodule.
[0140] The first layout determination submodule is used to determine the document structure layout based on the document's rendering results.
[0141] According to embodiments of this disclosure, the document type is a non-web page document type.
[0142] According to embodiments of this disclosure, the layout determination module includes: a format determination submodule, a second layout determination submodule, and a third layout determination submodule.
[0143] The format determination submodule is used to determine whether a document is a document in a predetermined format based on multiple predefined field information.
[0144] The second layout determination submodule is used to use the predetermined document structure layout of the document as the document structure layout of the document when the document is determined to be a document in a predetermined format.
[0145] The third layout determination submodule is used to determine the document's paragraph structure layout as the document's document structure layout when the document is determined to be a document without a predetermined format.
[0146] According to embodiments of this disclosure, the layout text determination module includes a layout text determination submodule.
[0147] The layout text determination submodule is used to extract the layout text of each text block from multiple text blocks to obtain a layout text sequence.
[0148] According to embodiments of this disclosure, the result determination module includes an image extraction submodule and a result determination submodule.
[0149] The image extraction submodule is used to extract features from images when it is determined that the document contains images, thereby obtaining image features.
[0150] The results determination submodule is used to determine the document quality result of a document based on its structural features, text features, and image features.
[0151] According to embodiments of this disclosure, the result determination submodule includes a splicing unit and a result determination unit.
[0152] The splicing unit is used to splice document structural features, text features, and image features to obtain document features.
[0153] The result determination unit is used to determine the document quality result of a document based on its characteristics.
[0154] According to embodiments of this disclosure, the first extraction submodule includes: an image data determination unit and a structural feature extraction unit.
[0155] The image data determination unit is used to determine the structural data associated with the image when it is determined that the document includes an image.
[0156] The structural feature extraction unit is used to obtain block structural features based on image-related structural data and structural data sequences.
[0157] According to embodiments of this disclosure, the third extraction module includes: an image text determination unit and a text feature extraction unit.
[0158] The image text determination unit is used to perform text recognition on the image when the document is determined to include an image, and to obtain the text recognition result.
[0159] The text feature extraction unit is used to obtain second text features based on the text recognition results and the layout text sequence, when it is determined that the text recognition results are used to characterize the text in the image.
[0160] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0161] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in the embodiments of the present disclosure.
[0162] According to embodiments of the present disclosure, a non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to cause a computer to perform methods as described in embodiments of the present disclosure.
[0163] According to embodiments of the present disclosure, a computer program product includes a computer program that, when executed by a processor, implements the methods as described in embodiments of the present disclosure.
[0164] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0165] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0166] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0167] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the document quality determination method. For example, in some embodiments, the document quality determination method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the document quality determination method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the document quality determination method by any other suitable means (e.g., by means of firmware).
[0168] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0169] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0170] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include, based on electrical connections of one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0171] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0172] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0173] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, distributed system servers, or servers incorporating blockchain technology.
[0174] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0175] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for determining document quality, comprising: Based on the document's structure and layout, the text in the document is split into multiple text blocks; Based on the structural data of each of the multiple text blocks, a structural data sequence is obtained. The structural data sequence includes multiple structural data that correspond one-to-one with the multiple text blocks. The multiple structural data are ordered according to the structural layout relationship between the multiple text blocks. The structural data of the text block indicates data related to the structure of the text block. If it is determined that the document includes an image, structural data related to the image is determined; Based on the document structure layout, the structural data related to the image is added to the structural data sequence to obtain the updated structural data sequence; Features are extracted from the updated structural data sequence to obtain block structure features; Perform global layout analysis on the multiple text blocks to obtain the global layout data of the document; Features are extracted from the global layout data to obtain global structural features; The document structure features are obtained based on the block structure features and the global structure features; and Based on the document's structural features and textual features, the document quality result is determined.
2. The method according to claim 1, further comprising: Full-text feature extraction is performed on the text of the document to obtain the first text feature; Layout text is determined from the text of the document to obtain a layout text sequence, wherein the layout text sequence includes multiple layout texts, which are texts used to reflect the structural layout of the document, and the multiple layout texts in the layout text sequence are ordered according to the structural layout relationship between the multiple layout texts. Based on the layout text sequence, the second text feature is obtained; and The first text feature and the second text feature are concatenated to obtain the text feature.
3. The method according to claim 1, further comprising: Determine the document type of the document; Determine the target processing mode that matches the document type; as well as The document structure layout of the document is determined according to the target processing mode.
4. The method according to claim 3, wherein, The document is a web-based document. Determining the document structure layout based on the target processing mode includes: The document structure layout is determined based on the document's rendering result.
5. The method according to claim 3, wherein, The document is a non-web page document. Determining the document structure layout based on the target processing mode includes: Based on multiple predefined field information, determine whether the document is a document in a predefined format; If the document is determined to be a document of a predetermined format, the predetermined document structure layout of the document of the predetermined format shall be used as the document structure layout of the document; and If it is determined that the document is not in a predetermined format, the paragraph structure layout of the document shall be used as the document structure layout of the document.
6. The method according to claim 2, wherein, The step of determining layout text from the text of the document to obtain a layout text sequence includes: For each of the multiple text blocks, extract the layout text of the text block to obtain the layout text sequence.
7. The method according to claim 1, wherein, The step of determining the document quality result based on the document structure features and the text features includes: If it is determined that the document includes an image, feature extraction is performed on the image to obtain image features; and The document quality result is determined based on the document structure features, the text features, and the image features.
8. The method according to claim 7, wherein, The step of determining the document quality result based on the document structure features, the text features, and the image features includes: By concatenating the document structure features, the text features, and the image features, document features are obtained; and Based on the document characteristics, the document quality result is determined.
9. The method according to claim 2, wherein, The step of obtaining the second text feature based on the layout text sequence includes: If it is determined that the document includes an image, text recognition is performed on the image to obtain a text recognition result; and If the text recognition result is determined to be used to characterize that the image includes text, the second text feature is obtained based on the text recognition result and the layout text sequence.
10. A document quality determination apparatus, comprising: The splitting module is used to split the text in a document into multiple text blocks according to the document's structure and layout. The first extraction module is used to obtain document structure features, including block structure features and global structure features, based on the structural data of each of the multiple text blocks. The structural data indicates data related to the text block structure, the block structure features characterize the structural layout relationships between the multiple text blocks, and the global structure features are obtained through global layout analysis of the multiple text blocks. The result determination module is used to determine the document quality result of the document based on the document structure features and the document text features; The first extraction module includes: The structure acquisition submodule is used to obtain a structure data sequence based on the structure data of each of the multiple text blocks. The structure data sequence includes multiple structure data that correspond one-to-one with the multiple text blocks. The multiple structure data are sorted according to the structural layout relationship between the multiple text blocks. The structure data of the text block indicates data related to the structure of the text block. The first extraction submodule is used to obtain block structure features based on the structured data sequence; The second extraction submodule is used to perform global layout analysis on the multiple text blocks to obtain the global layout data of the document; extract features from the global layout data to obtain the global structural features; and The fusion submodule is used to obtain the document structure features based on the block structure features and the global structure features; The first extraction submodule includes: An image data determination unit is configured to determine structural data related to the image when it is determined that the document includes an image; and The structural feature extraction unit is used to add structural data related to the image to the structural data sequence according to the document structure layout to obtain an updated structural data sequence; and extract features from the updated structural data sequence to obtain the block structure features.
11. The apparatus of claim 10, further comprising: The second extraction module is used to extract full-text features from the text of the document to obtain the first text features; The layout text determination module is used to determine layout text from the text of the document to obtain a layout text sequence, wherein the layout text sequence includes multiple layout texts, the layout texts being texts used to reflect the structural layout of the document, and the multiple layout texts in the layout text sequence are ordered according to the structural layout relationship between the multiple layout texts; The third extraction module is used to obtain the second text features based on the layout text sequence; and The first splicing module is used to splice the first text feature and the second text feature to obtain the text feature.
12. The apparatus of claim 10, further comprising: A type determination module is used to determine the document type of the document; A pattern determination module is used to determine a target processing pattern that matches the document type. as well as The layout determination module is used to determine the document structure layout of the document based on the target processing mode.
13. The apparatus according to claim 12, wherein, The document is a web-based document. The layout determination module includes: The first layout determination submodule is used to determine the document structure layout based on the document's rendering result.
14. The apparatus according to claim 12, wherein, The document is a non-web page document. The layout determination module includes: The format determination submodule is used to determine whether the document is a document of a predetermined format based on multiple predetermined field information. The second layout determination submodule is used to, when it is determined that the document is a document of a predetermined format, use the predetermined document structure layout of the document of the predetermined format as the document structure layout of the document; and The third layout determination submodule is used to determine the paragraph structure layout of the document as the document structure layout when it is determined that the document is a document with a non-predetermined format.
15. The apparatus according to claim 11, wherein, The layout text determination module includes: The layout text determination submodule is used to extract the layout text of each of the multiple text blocks to obtain the layout text sequence.
16. The apparatus according to claim 10, wherein, The result determination module includes: An image extraction submodule is configured to extract features from an image, provided that the document contains an image, to obtain image features; and The result determination submodule is used to determine the document quality result of the document based on the document structure features, the text features, and the image features.
17. The apparatus according to claim 16, wherein, The result determination submodule includes: The splicing unit is used to splice the document structure features, the text features, and the image features to obtain document features; and The result determination unit is used to determine the document quality result of the document based on the document features.
18. The apparatus according to claim 11, wherein, The third extraction module includes: An image-text determination unit is configured to perform text recognition on the image when it is determined that the document includes an image, and obtain a text recognition result; and The text feature extraction unit is used to obtain the second text feature based on the text recognition result and the layout text sequence when it is determined that the text recognition result is used to characterize that the image includes text.
19. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 9.
20. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 9.
21. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 9.