A digital processing method, device, equipment, medium and product for archives

By using a pre-trained arrangement language model to predict and adjust text-position-related information to the text blocks in the archive image, the problem of traditional OCR technology identifying errors in complex layout archives is solved, and the efficiency and accuracy of digitized archives are achieved.

CN120071376BActive Publication Date: 2025-08-19BEIJING BEIDA SOFTWARE ENG DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510511974.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-08-19
Estimated Expiration
2045-04-23

AI Technical Summary

Technical Problem

When dealing with paper archives, traditional OCR technology faces the problems of text direction deviation, row disorder and content misalignment caused by complex and changeable text layout, which affects the efficiency and accuracy of digital processing of archives.

Method used

The text-position-related information is predicted and adjusted by pre-trained arrangement language model (combined with BERT and BiLSTM) on text blocks, and the text-position-related information is accurately adjusted to generate digital archives.

Benefits of technology

It significantly improves the efficiency and accuracy of digital processing of archives, reduces the time of manual intervention and error investigation, and ensures that the content of the digital archive is highly consistent with the original archives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120071376B_ABST
    Figure CN120071376B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, device, medium and product for digital processing of archives, which relates to the field of image recognition technology. The method comprises determining a plurality of text blocks from a pre-collected archive image; inputting the plurality of text blocks into a pre-trained arrangement language model to obtain text-position related information of each text block output by the arrangement language model; wherein a text-position related information comprises the probability that each character contained in a text block is located at a different position in the text block; based on the text-position related information, adjusting the position of the characters in each text block to obtain the text content of each text block; and using each text content to generate a digital archive corresponding to the archive image. The present application can improve the efficiency and accuracy of archive digital processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to a method, device, equipment, medium and product for digital processing of archives. Background Art

[0002] Traditional archives are typically paper-based, which take up a lot of space, are easily damaged and lost, have low retrieval efficiency, are difficult to update and maintain, have poor security, and are not environmentally friendly. In contrast, electronic archives save space, are easy to retrieve and update, have high security, facilitate remote access, and are more environmentally friendly. Therefore, electronic archive systems are a growing trend in personnel archive management, contributing to the modernization of archive management and promoting the sharing and efficient use of information resources. To achieve this transformation, optical character recognition (OCR) technology plays a key role in efficiently converting paper archives to electronic archives.

[0003] However, in practice, it is found that the text layout in paper archives is complex and changeable, and there are often non-horizontal arrangements, multi-directional mixed layouts or special layouts. As a result, traditional OCR technology is prone to problems such as text direction deviation, row and column disorder, and content dislocation when recognizing. Manual verification is required, which seriously affects the efficiency and accuracy of archive digitization. Summary of the Invention

[0004] The purpose of this application is to provide a method, device, equipment, medium and product for digital processing of archives, which can improve the efficiency and accuracy of digital processing of archives.

[0005] To achieve the above objectives, this application provides the following solutions:

[0006] In a first aspect, the present application provides a method for digitally processing archives, comprising:

[0007] determining a plurality of text blocks from pre-captured archival images;

[0008] Inputting the plurality of text blocks into a pre-trained permutation language model to obtain character-position related information for each text block output by the permutation language model; wherein each character-position related information includes the probability of each character contained in a text block being at a different position in the text block;

[0009] Based on the text-position related information, the text position in each text block is adjusted to obtain the text content of each text block;

[0010] A digital archive corresponding to the archive image is generated using each text content.

[0011] Optionally, the digital processing method of the archive further includes:

[0012] Performing face target detection on the archive image to obtain a face area in the archive image;

[0013] Performing a face cutout operation on the face area to obtain a target face image;

[0014] fusing the target face image with a predetermined background image to obtain a fused face image;

[0015] determining a facial image location from the digital file;

[0016] The fused face image is fused to the face image position in the digital file to obtain a target digital file containing the fused face image.

[0017] Optionally, inputting a target text block from the plurality of text blocks into a pre-trained permutation language model to obtain the text-position related information of the target text block output by the permutation language model specifically includes:

[0018] determining each character contained in a target text block among the plurality of text blocks and an initial position of each character in the target text block;

[0019] Determining, based on each character and its initial position in the target text block, a word element encoding of each character and hidden state combination information of each character; wherein the hidden state combination information includes a forward hidden state and a backward hidden state of the character corresponding to the hidden state combination information;

[0020] Based on the word element encoding of each character and the hidden state combination information of each character, the character-position related information of the target text block is calculated.

[0021] Optionally, determining each character contained in a target text block among the multiple text blocks and an initial position of each character in the target text block specifically includes:

[0022] Performing an enlargement operation on an initial text block among the multiple text blocks to obtain a first text block;

[0023] Gray-scaling the first text block to obtain a second text block;

[0024] performing a denoising operation on the second text block to obtain a target text block;

[0025] Character recognition is performed on the target text block to obtain each character contained in the target text block and the initial position of each character in the target text block.

[0026] Optionally, the step of calculating the character-position related information of the target text block based on the word element encoding of each character and the hidden state combination information of each character specifically includes:

[0027] Transpose the hidden state combination information of each character to obtain the transposed hidden state combination information of each character;

[0028] Multiply the word unit encoding and transposed hidden state combination of each word to obtain the initial matrix;

[0029] Based on a preset bias, the initial matrix is calculated to obtain a target matrix;

[0030] The target matrix is normalized to obtain the text-position related information of the target text block.

[0031] Optionally, the step of using each text content to generate a digital archive corresponding to the archive image specifically includes:

[0032] Performing type identification on each text content to obtain the text type of each text content; wherein the text type includes a tag type and a content type;

[0033] Determining coordinate information of each text content in the archive image;

[0034] Associating text content of a content type with text content of a tag type according to coordinate information of each text content; wherein the distance between the text content of the content type and the text content of the tag type is the shortest;

[0035] Obtaining a pre-set digital file template; wherein the digital file template includes multiple target tags;

[0036] Repeat the filling operation until the blank areas corresponding to each target label in the digital archive template are filled with text content, and obtain the digital archive corresponding to the archive image:

[0037] The content to be filled in specifically includes:

[0038] Determine a current target label from multiple target labels;

[0039] Determine target text content that is the same as the current target tag from text content of the tag type;

[0040] Fill the text content of the content type corresponding to the target text content into the blank area corresponding to the current target tag.

[0041] In a second aspect, the present application provides a digital file processing device, comprising:

[0042] a determining unit, configured to determine a plurality of text blocks from a pre-collected archival image;

[0043] An input unit, configured to input the plurality of text blocks into a pre-trained permutation language model, and obtain character-position related information for each text block output by the permutation language model; wherein each character-position related information includes a probability of each character contained in a text block being located at a different position in the text block;

[0044] an adjusting unit, configured to adjust the position of the characters in each text block based on the character-position related information to obtain the text content of each text block;

[0045] A generating unit is configured to generate a digital archive corresponding to the archive image using each text content.

[0046] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for digitalizing archives described in any one of the above.

[0047] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-mentioned methods for digital processing of archives.

[0048] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the above-mentioned methods for digital processing of archives.

[0049] In a sixth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is configured to run a program or instruction. When the processor executes the program or instruction, the steps of the archive digital processing method described in any one of the above are implemented.

[0050] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0051] The present application provides a method, device, equipment, medium and product for digital processing of archives, which can accurately determine multiple text blocks from pre-collected archive images, laying a clear foundation for subsequent processing; and input these text blocks into a pre-trained arrangement language model. The text-position related information output by the model is extremely critical. The text-position related information represents the probability of each character in each text block being in a different position, providing an accurate basis for text position adjustment; based on this, text position adjustment can greatly correct text errors caused by problems such as the complex and irregular original arrangement of characters in the archive image, so that the text content of each generated text block is more consistent with its true semantics. Ultimately, using these high-quality text contents to generate digital archives effectively reduces manual intervention and error troubleshooting time compared to traditional methods, avoids duplication of work caused by text recognition errors, and thus comprehensively improves the efficiency of archive digitization processing. At the same time, precise text position adjustment ensures that the content of the digital archive is highly consistent with the original archive, greatly improving the accuracy of archive digitization processing. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0053] Figure 1 This is a flow chart of a file digitization processing method according to an embodiment of the present application;

[0054] Figure 2 A schematic diagram of the structure of an intelligent file processing model provided in one embodiment of the present application;

[0055] Figure 3 A schematic diagram of an archival image provided in one embodiment of the present application;

[0056] Figure 4 A schematic diagram of a digital file template provided in one embodiment of the present application;

[0057] Figure 5 A schematic diagram of a digital file provided in one embodiment of the present application;

[0058] Figure 6 This is a schematic diagram of the functional modules of a file digital processing device provided in another embodiment of the present application.

[0059] Figure 7 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

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

[0061] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0062] In an exemplary embodiment, Figure 1 As shown, a method for digital processing of archives is provided. The method is executed by a computer device, specifically, a computer device such as a terminal or a server, or a terminal and a server. In the embodiment of the present application, the method includes the following steps 101 to 104. Among them:

[0063] Step 101: determine a plurality of text blocks from pre-collected archive images.

[0064] In an embodiment of the present application, the text blocks can be segmented and determined based on the grids contained in the archival image; the spacing distance between the characters can also be obtained, and then multiple text blocks can be determined based on the spacing distance between the characters, and the distance between two adjacent characters in each text block is less than a preset distance threshold.

[0065] In the embodiment of the present application, archival images can be collected by collecting devices such as cameras, video cameras, and scanners.

[0066] Step 102: Input the plurality of text blocks into a pre-trained permutation language model to obtain text-position related information of each text block output by the permutation language model.

[0067] In the embodiment of the present application, a piece of character-position related information includes the probability that each character contained in a text block is located at a different position in the text block.

[0068] In this embodiment of the present application, the permutation language model may include BERT and BiLSTM. The permutation language model task is a natural language processing task that aims to rearrange scrambled text into the correct order. In this task, the combined BERT and BiLSTM model is used to predict the position of each word in the correct sequence, and then rearrange the words based on these positions to obtain the correct order.

[0069] First, in order to train this model, you need to prepare a dataset.

[0070] The construction of the dataset can be completed by following the steps below:

[0071] 1. Collect a large and orderly collection of texts related to the archives.

[0072] 2. Perform jieba word segmentation on the ordered text and randomly select the words that need to be shuffled. At this time, these words are called whole words.

[0073] 3. Based on the whole word, we further select consecutive n-grams. An n-gram is a sequence of n consecutive word units, where a word unit represents a single character.

[0074] 4. Randomly swap the selected whole words and word units within n-grams to disrupt the original order of the ordered text.

[0075] 5. While shuffling the ordered text, mark the position of each word in the original order. In this task, the maximum text length is limited to , so the predicted values that the model needs to output are these 50 positions.

[0076] The present invention adopts the bert-base-chinese version of the BERT model, which can effectively generate text encoding. In the BERT model, the word segmentation of Chinese text is performed with a single Chinese character as the basic unit. Each Chinese character will be converted into a word unit and given a word embedding, a position embedding, and a segment embedding. These three embeddings will be added and then sent to a network consisting of 12 layers of Transformer encoders. At the output of the last layer of Transformer encoders, the present invention obtains the word unit encoding of all input word units. These word unit encodings are enriched with the semantic information of each word unit in the current context, which reflects the model's comprehensive understanding of the input text.

[0077] The parameters of BiLSTM can be updated through gradient descent during training to adapt to specific task requirements.

[0078] BiLSTM is a recurrent neural network that can capture long-range dependencies in text. It is composed of two LSTMs. Its calculation process is shown in the following formula:

[0079]

[0080] in, Represents the input at time step t, that is, the vector of the corresponding word position output by BERT;

[0081] Indicates that the LSTM model processes the sequence from the beginning to the end, capturing the previous information;

[0082] is the forward hidden state of the forward LSTM at time step t;

[0083] Indicates that the LSTM model processes the sequence from the end to the beginning to capture the subsequent information;

[0084] is the backward hidden state of the backward LSTM at time step t;

[0085] Represents a connection operation;

[0086] is the output of BiLSTM at time step t (text-position related information), which is a combination of the forward and backward output results, so that the representation of each time step can contain both the previous and the next information.

[0087] The specific calculation formula of LSTM is as follows:

[0088]

[0089] in, represents the result of the input gate, and are the first and second weight parameters, is the first bias parameter, Represents the activation function sigmoid, is the current time step Input, is the hidden state of the previous time step;

[0090] represents the result of the forget gate, and are the third and fourth weight parameters, is the second bias parameter;

[0091] represents the result of the output gate, and are the fifth and sixth weight parameters, is the third bias parameter;

[0092] represents the candidate memory element, and are the seventh and eighth weight parameters, is the fourth bias parameter;

[0093] Represents the time step The memory element of time, is the memory element of the previous time step, Represents the Hadamard product, this step is calculated through the forget gate Determine how many memory features of the previous time step to retain, through the input gate Decide how many candidate memory cells to use characteristics;

[0094] Represents the forward / backward hidden state of the current time step t, tanh is the activation function hyperbolic tangent function, this step is calculated using the output gate Control the transfer of memory information.

[0095] It should be emphasized here that the output dimension of BERT is 768-dimensional, and the BiLSTM used in this invention has a hidden layer dimension of 384, which ensures that the result after bidirectional splicing is also 768-dimensional, thereby facilitating subsequent calculations.

[0096] In order to calculate the position of the original word unit, the present invention performs matrix multiplication on the output of BiLSTM and the output of BERT word embedding module, and calculates the position of the original word unit by combining all the hidden states of BiLSTM. and the encoding combination of all tokens of the BERT word embedding module The transpose of ) to perform matrix multiplication, we can get the correlation between each word and each position.

[0097] The dimension of the calculation result is k×k, and the bias b is added to this calculation result. Subsequently, the softmax operation is performed row by row, and the present invention obtains the probability of each word belonging to each position. The softmax function is used to convert the output of the model into a probability distribution.

[0098] Finally, based on these probabilities, we can predict the position of each token in the correct order and rearrange the words to get the correct order. The probability calculation formula is:

[0099]

[0100] The loss function uses cross entropy loss L, as shown in the following formula:

[0101]

[0102] Among them, y represents the true label, which is a one-hot encoding of length M; p is the predicted value, also of length M, which is the probability prediction value for each class; M represents the number of categories, where M=k, and 50 positions means 50 categories.

[0103] According to the loss function, BiLSTM can be trained to obtain a BiLSTM model with more accurate output prediction probability.

[0104] As an optional implementation, step 102 inputs a target text block from among the multiple text blocks into a pre-trained permutation language model, and a method for obtaining the text-position related information of the target text block output by the permutation language model may specifically include:

[0105] determining each character contained in a target text block among the plurality of text blocks and an initial position of each character in the target text block;

[0106] Determining, based on each character and its initial position in the target text block, a word element encoding of each character and hidden state combination information of each character; wherein the hidden state combination information includes a forward hidden state and a backward hidden state of the character corresponding to the hidden state combination information;

[0107] Based on the word element encoding of each character and the hidden state combination information of each character, the character-position related information of the target text block is calculated.

[0108] This implementation precisely captures the initial position of text, establishing a basic coordinate system for the model to analyze the spatial layout of text. It innovatively combines the semantic representation of word-unit encoding with bidirectional latent state combination information, preserving the semantic characteristics of the text itself while enabling the model to dynamically capture the logical order and spatial associations between text through interactive modeling of forward and backward latent states. Finally, probabilistic calculations are used to deduce text position relationships, enabling the system to understand the patterns of complex layout arrangements. This deep context-aware mechanism effectively overcomes the limitations of traditional OCR in recognizing artistic fonts, handwriting, and multi-directional mixed text, significantly enhancing its adaptability to files with special layouts.

[0109] Optionally, the method of determining each character contained in a target text block among the multiple text blocks and the initial position of each character in the target text block may specifically include:

[0110] Performing an enlargement operation on an initial text block among the multiple text blocks to obtain a first text block;

[0111] Gray-scaling the first text block to obtain a second text block;

[0112] performing a denoising operation on the second text block to obtain a target text block;

[0113] Character recognition is performed on the target text block to obtain each character contained in the target text block and the initial position of each character in the target text block.

[0114] Among them, the implementation of this method first uses an adaptive magnification strategy to enhance the detailed features of tiny text or blurred areas, providing a higher-definition text base for subsequent processing; then, grayscale processing is used to eliminate color interference, compressing the three-dimensional color space into a two-dimensional grayscale gradient, reducing computational complexity while retaining key information about the text outline; then, an intelligent denoising algorithm is used to accurately filter out interference factors such as image noise and scratches, creating a high signal-to-noise ratio text recognition environment; finally, refined text positioning technology is used to accurately obtain the initial coordinates of each character, providing a precise spatial layout basis for the subsequent arrangement model. This full-process automated optimization mechanism effectively solves common problems such as blur, noise, and color interference in low-quality archival images, and significantly enhances the reliability of text recognition in complex scenarios.

[0115] Optionally, the method of calculating the character-position related information of the target text block based on the word element encoding of each character and the hidden state combination information of each character may specifically include:

[0116] Transpose the hidden state combination information of each character to obtain the transposed hidden state combination information of each character;

[0117] Multiply the word unit encoding and transposed hidden state combination of each word to obtain the initial matrix;

[0118] Based on a preset bias, the initial matrix is calculated to obtain a target matrix;

[0119] The target matrix is normalized to obtain the text-position related information of the target text block.

[0120] Among them, the implementation of this method first adopts the hidden state transposition strategy to enable the forward and backward semantic information to form a complementary interaction in the matrix operation, enhancing the model's two-way perception of the spatial relationship of text; secondly, through the matrix fusion operation of word unit encoding and hidden state, while retaining the deep semantic features of the text, the context clues required for position distribution prediction are dynamically injected; then, a learnable bias parameter is introduced to calibrate the initial matrix, so that the model can adaptively adjust the position prediction weights in different layout scenarios; finally, the original prediction value is converted into a probability distribution through normalization operation to ensure that the text position inference result conforms to the laws of mathematical statistics. This multi-level joint optimization mechanism effectively solves the traditional OCR's recognition problem of special layouts such as multi-directional mixed typesetting and curved text, and significantly enhances the full process automation level of archive digitization.

[0121] Step 103 : Based on the text-position related information, the text position in each text block is adjusted to obtain the text content of each text block.

[0122] In the embodiment of the present application, each character can be placed at the position with the highest probability, thereby adjusting the position of the characters in each text block.

[0123] Step 104: Generate a digital archive corresponding to the archive image using each text content.

[0124] The embodiments of the present application can be applied to Figure 2 The intelligent archive processing model shown in the figure includes a template customization and management module and an OCR-based document structured storage module. Specifically:

[0125] A. The Template Customization and Management Module includes template information entry, region segmentation, data configuration, and document template management. This module utilizes a website interface as an interactive platform, integrating core Excel functionality. It is implemented through three primary steps: template information entry, region segmentation, and data configuration. This module is designed to provide a standardized framework for the digitization of cadre files, ensuring consistency and accuracy in subsequent content entry and presentation, laying a solid foundation for the digitization of cadre files.

[0126] To enhance the presentation of information extracted by the model, users can customize their templates using the Template Customization and Management module. This allows users to flexibly customize the presentation format and content of information based on their specific needs, improving readability and usability, and providing a better user experience. This module primarily consists of four parts: template information entry, region segmentation settings, data configuration settings, and document template management.

[0127] The template information filling interface provides users with convenient functions to enter and define relevant information of the template. On this interface, users are required to fill in three main parts: template name, template type and template description.

[0128] First, the template name is required. It provides a unique identifier for the template you create. This name should be concise and clear, reflecting the content or purpose of the template, making it easier for users to find and use it in the future.

[0129] Secondly, the template type is also required. It helps users categorize and identify the purpose of the template. For example, the template type can be full-text recognition or full-table recognition, depending on how the user wants to use the template. Selecting the correct template type ensures that the template is used correctly in the right situation.

[0130] Finally, the template description is optional. It provides a more detailed overview of the template, including its purpose, applicable scenarios, special features, etc. This not only helps users remember the details of the template themselves, but also helps other users who may use the template understand its background and purpose.

[0131] After entering the basic template information, users will enter the area segmentation setup section, which allows them to define the template's structure and layout. This page integrates Excel functionality, allowing users to flexibly plan the various sections of the template within a familiar interface, just as they would in Excel. This design approach greatly simplifies the template creation process, especially for users already familiar with Excel, making template design more intuitive and efficient. This customization capability allows each user to design a template that is both practical and aesthetically pleasing based on their needs and preferences.

[0132] After customizing the template format, users should configure data settings to ensure that each area of the template can correctly identify and process different types of data. This step involves categorizing each area in the template as a title area, atomic label area, composite label area, content area, or image area, and configuring the specific properties of each area in detail.

[0133] For the title area, users need to set the title name and corresponding title alias so that the system can accurately identify and classify the main parts of the document.

[0134] In the Atom Label area, users need to define the label name, label recognition rules, and text layout direction. These settings help the system accurately extract and classify basic data elements.

[0135] The configuration of the combined tag area is more complex, requiring users to specify the tag name, tag identification rules, tag level, parent tag, and text direction. These detailed settings help build the data hierarchy and ensure the correct parsing and extraction of complex information.

[0136] Setting up a content area requires the user to specify mapping fields, associated labels, and decide whether to extract the content of the area from the document.

[0137] The configuration of the image area is similar to that of the content area. Users need to specify the mapping fields, associate tags, and choose whether to extract image content. This is especially important when the document contains visual elements.

[0138] It is worth noting that the title area, atomic label area, and combined label area need to be filled with meaningful text content. These text contents will be stored in the locally built label library, and the subsequent OCR recognition results will be matched with the content in the label library.

[0139] A carefully designed tagging system provides a solid foundation for the structured warehousing portion of this invention and significantly improves search efficiency. Under this tagging system, data is categorized and stored according to established rules and hierarchical structures, enabling faster and more accurate location during subsequent searches.

[0140] For example, when managing a database with many documents, by indexing the title, basic tags, and compound tags of each document, the time required for searching can be greatly reduced. When a user searches, the system can immediately locate documents with relevant tags, avoiding the need to review the document library one by one. Tag-based search methods can reduce search time from minutes to milliseconds, achieving instant response. In addition, structured storage methods can also help improve search accuracy. Because the data has been pre-classified and tagged, the system can more accurately understand and interpret the user's query intent, thereby providing more accurate search results.

[0141] During the data configuration phase, the model provides an interactive preview mechanism, including configuration item preview, service parameter preview, and calibration page preview, to provide instant feedback on the design. This mechanism allows users to observe the layout and style of the template in real time during the configuration process, ensuring that the final template design meets the expected requirements. Once the template design is completed and meets the user's needs, the user can choose to publish the template to the system. The publishing process integrates the template into the system, making it available for users to reuse in future tasks, improving the template's reusability and work efficiency. If the settings are not completed, you can choose to save them, and they will appear in the list of the template management module after saving.

[0142] The Document Template Management module provides users with a centralized platform for configuring, deleting, previewing, and publishing their created templates. This module is designed to simplify the management and maintenance of template libraries, ensuring timely template updates and optimization. Through the Template Management module, users can easily browse and search their template collection, quickly finding the template they need for editing.

[0143] B. The OCR-based document structured storage module includes task creation, task management, accurate information extraction, structured storage, and intelligent content display. This module provides core functions for accurate information extraction, structured storage, and intelligent content display. At the information extraction level, the module integrates the PaddleOCR algorithm and innovatively proposes a permutation language model combining BERT and BiLSTM. This enables precise recognition and extraction of archival text, ensuring the accuracy and integrity of the information. Furthermore, the module leverages the advanced PaddleX library, face_recognition technology, and the PaddleSeg suite to perform refined segmentation of image content, further enriching the dimensionality and depth of information extraction. After completing information extraction, the module leverages the recognition results and the resulting rectangular coordinate arrangement rules to develop a table recognition mechanism that utilizes distance calculation and visual hierarchy analysis. This mechanism not only enables structured storage of table content but also intelligently displays content based on the table's specific format and layout, significantly improving readability and usability.

[0144] To efficiently extract text and image information from digital copies, users can utilize the OCR-based document structured storage module. This module not only recognizes and extracts information, but also intelligently displays the extracted data based on customized templates, ensuring accuracy and consistency. This module primarily consists of five components: task creation, task management, precise information extraction, structured storage, and intelligent content display.

[0145] First, you need to create a task. Task creation is the process of setting up a new task, including the task name, acquisition method, and file selection. The task name and acquisition method are required. For the acquisition method, you can choose local upload or file synchronization.

[0146] Once a task is created successfully, it will be displayed on the Task Management page, where you can edit, delete, view calibration, view unrecognized documents, and archive the task.

[0147] Steps 101 through 104 of this application can be implemented using a precise information extraction module. The system receives a digital copy uploaded by the user. Next, the system analyzes the document to extract information. Because OCR models cannot directly segment images, the information extraction process involves two main aspects: text information extraction and image segmentation extraction.

[0148] Text extraction involves using OCR technology to identify and convert text within documents into an editable and searchable format. This process involves precise detection, efficient recognition, and accurate conversion of text within a document, ensuring the extracted text is accurate and meets various application requirements.

[0149] In this paper, we use PaddleOCR, an OCR technology. PaddleOCR has high-precision recognition capabilities, supports multilingual recognition and multitasking, and is an open source OCR tool. It also provides annotation tools that can fine-tune and optimize models for application scenarios. Using PaddleOCR, this paper can more accurately and efficiently extract text information from documents, providing strong support for subsequent text processing and analysis.

[0150] PaddleOCR first performs text recognition and then performs preprocessing operations such as scaling, grayscale, and denoising to improve the accuracy of text recognition. These steps help improve image quality, especially for noisy or skewed images. The output includes text location information and text content recognition results. Since PaddleOCR tool has excellent recognition results for text location and text content, this paper focuses on using PaddleOCR's output and designs a deep learning model to restore non-horizontally arranged text.

[0151] Specifically, the present invention first uses the position information of the text output by PaddleOCR to splice the text fragments. This process helps to reassemble scattered text fragments into a complete text sequence, thereby restoring the original meaning of the text to the greatest extent. Subsequently, the spliced text is processed by combining the pre-trained permutation language model (BERT and BiLSTM) to restore the correct order and meaning of the text. The processed text will be further classified. If the identified text belongs to a title, atomic tag or combined tag area, the system will match it with the locally built tag library and associate similar tags to facilitate subsequent template filling. If the recognized part is content text, it will be associated and bound with the adjacent tag coordinates.

[0152] As an optional implementation, step 104 uses each text content to generate a digital archive corresponding to the archive image, specifically including:

[0153] Performing type identification on each text content to obtain the text type of each text content; wherein the text type includes a tag type and a content type;

[0154] Determining coordinate information of each text content in the archive image;

[0155] Associating text content of a content type with text content of a tag type according to coordinate information of each text content; wherein the distance between the text content of the content type and the text content of the tag type is the shortest;

[0156] Obtaining a pre-set digital file template; wherein the digital file template includes multiple target tags;

[0157] Repeat the filling operation until the blank areas corresponding to each target label in the digital archive template are filled with text content, and obtain the digital archive corresponding to the archive image:

[0158] The content to be filled in specifically includes:

[0159] Determine a current target label from multiple target labels;

[0160] Determine target text content that is the same as the current target tag from text content of the tag type;

[0161] Fill the text content of the content type corresponding to the target text content into the blank area corresponding to the current target tag.

[0162] This implementation method first uses type recognition technology to automatically distinguish between label-based and content-based text, building a structured information classification system. Secondly, it accurately calculates the spatial proximity between labels and content based on spatial coordinates to achieve intelligent matching of semantic associations. Then, it uses pre-set digital archive templates to standardize the archive data structure, ensuring information integrity and format consistency through a dynamic loop filling mechanism. Ultimately, it forms an end-to-end automated process from raw images to standardized digital archives. This multi-dimensional information fusion and rule-driven processing model effectively avoids the risk of mismatches in manual associations, eliminates information loss during format conversion, and significantly improves the processing efficiency and quality standardization of complex archives.

[0163] As an optional implementation, after step 104, the following steps may be further performed:

[0164] Performing face target detection on the archive image to obtain a face area in the archive image;

[0165] Performing a face cutout operation on the face area to obtain a target face image;

[0166] fusing the target face image with a predetermined background image to obtain a fused face image;

[0167] determining a facial image location from the digital file;

[0168] The fused face image is fused to the face image position in the digital file to obtain a target digital file containing the fused face image.

[0169] Among them, the implementation of this implementation method first adopts precise face detection and adaptive cutout algorithm to effectively extract facial features in archival images and remove complex backgrounds, solving quality problems such as facial blur and yellowing caused by storage years in traditional archives; secondly, through intelligent image fusion technology, the optimized face is seamlessly combined with the standardized background, which not only retains the historical characteristics of the original archive, but also gives it a modern visual presentation effect; then, the coordinate positioning technology is used to accurately map the enhanced face to the corresponding area of the digital archive, realizing non-destructive content upgrade; finally, a new type of archival carrier with both historical authenticity and digital readability is formed, which significantly improves the integrity and recognition of the archival content.

[0170] In this embodiment of the application, PaddleX can first be used for target detection to roughly identify and locate the face image area. After narrowing down the range of the face image, the advantages of the face_recognition library can be used to accurately locate and capture the face area in the ID photo.

[0171] In the embodiment of the present application, the target face image obtained by cutting out the image has a transparent background. This layered processing method not only ensures the accurate separation of the portrait and the background, but also provides high-quality image materials for subsequent background merging and image reconstruction.

[0172] Finally, the present invention merges the cutout result with the desired background and reshapes the background to form the final fused face image. This process not only preserves the clarity and detail of the portrait, but also makes the background more consistent with the overall effect. In this process, the present invention not only improves the accuracy of image segmentation but also provides more possibilities for subsequent image processing and application.

[0173] After completing the information extraction, the system will structure the extracted text and image content for easy storage and management.

[0174] Specifically, the present invention adopts the n-gram method for matching the text after sequence restoration with the locally constructed tag library. In natural language processing, shorter n-grams tend to capture the surface form of vocabulary, while longer n-grams can capture more contextual information. The present invention uses 1-gram, 2-gram, 3-gram and 4-gram to capture the features of text at different granularities for matching, and gives larger n-grams higher weights. This method can identify tag categories, and those that do not match the local tag library are marked as content. The present invention combines distance calculation and visual hierarchy analysis to optimize the binding relationship by calculating the distance between the center point of the text and the tag and considering its relative position in the visual layout.

[0175] First, the distance between the text block and the center point of each label is calculated, and the closest one is selected for preliminary binding.

[0176] Then, adjust the binding based on the visual hierarchy analysis to ensure it conforms to the visual logic.

[0177] Ultimately, accurate and reasonable binding of text and labels is achieved.

[0178] Categorizing and labeling the extracted information can facilitate retrieval and analysis.

[0179] During the structuring process, the system uses this information classification technology to more accurately organize the information in the document according to a specific data structure.

[0180] For example, for a resume document, the system might separately label and categorize different sections of information, such as personal information, educational background, and work experience, to facilitate subsequent query and application. The system then stores this structured information in a database, completing the document's information extraction and structured storage process. In this way, the present invention not only optimizes the accuracy of information extraction but also improves the overall efficiency of data processing.

[0181] After structuring, the present invention fills the stored content into a template designed by the user, presenting the information in a clear and orderly manner, thereby helping users to easily browse and understand the extracted data.

[0182] Please also refer to Figures 3 to 5 , Figure 3 A schematic diagram of an archival image provided in one embodiment of the present application; Figure 4 A schematic diagram of a digital file template provided in one embodiment of the present application; Figure 5 This is a schematic diagram of a digital file provided in one embodiment of the present application. Figure 5 The confirmation button in the file can be pressed when the user thinks the file generation is complete, Figure 5 The * indicates that the corresponding content in the "resume" tag is required. The experiments are based on Python 3.9 and PaddlePaddle, requiring CUDA 11.2 or higher and cudnn 8.2.4. Key packages include PaddleOCR, PaddleX, PaddleSeg, and face_recognition.

[0183] Implementing the above-mentioned steps 101 to 104 and using these high-quality text contents to generate digital archives effectively reduces manual intervention and error troubleshooting time compared to traditional methods, avoids duplication of work due to text recognition errors, and thus comprehensively improves the efficiency of digital archive processing. At the same time, precise text position adjustment ensures that the content of the digital archive is highly consistent with the original archive, greatly improving the accuracy of digital archive processing. In addition, the present application can also enhance the adaptability to special format archives. In addition, the present application can also enhance the reliability of text recognition in complex scenarios. In addition, the present application can also enhance the full process automation level of digital archive processing. In addition, the present application can also improve the processing efficiency and quality standardization level of complex archives. In addition, the present application can also improve the integrity and recognition of archive content.

[0184] Based on the same inventive concept, the present application also provides an apparatus for digitally processing archives for implementing the aforementioned method for digitally processing archives. The solution provided by this apparatus is similar to the solution described in the aforementioned method. Therefore, the specific limitations of the one or more apparatuses for digitally processing archives provided below can be found in the aforementioned definition of the method for digitally processing archives, and will not be further elaborated here.

[0185] In an exemplary embodiment, Figure 6 As shown, a digital processing device for archives is provided, comprising:

[0186] A determining unit 601 is configured to determine a plurality of text blocks from a pre-collected archive image;

[0187] Input unit 602 is configured to input the plurality of text blocks into a pre-trained permutation language model to obtain character-position related information for each text block output by the permutation language model; wherein each character-position related information includes the probability of each character contained in a text block being located at different positions in the text block;

[0188] An adjusting unit 603 is configured to adjust the position of the characters in each text block based on the character-position related information to obtain the text content of each text block;

[0189] The generating unit 604 is configured to generate a digital archive corresponding to the archive image using each text content.

[0190] As an optional implementation manner, the generating unit 604 is further configured to:

[0191] Performing face target detection on the archive image to obtain a face area in the archive image;

[0192] Performing a face cutout operation on the face area to obtain a target face image;

[0193] fusing the target face image with a predetermined background image to obtain a fused face image;

[0194] determining a facial image location from the digital file;

[0195] The fused face image is fused to the face image position in the digital file to obtain a target digital file containing the fused face image.

[0196] Among them, the implementation of this implementation method first adopts precise face detection and adaptive cutout algorithm to effectively extract facial features in archival images and remove complex backgrounds, solving quality problems such as facial blur and yellowing caused by storage years in traditional archives; secondly, through intelligent image fusion technology, the optimized face is seamlessly combined with the standardized background, which not only retains the historical characteristics of the original archive, but also gives it a modern visual presentation effect; then, the coordinate positioning technology is used to accurately map the enhanced face to the corresponding area of the digital archive, realizing non-destructive content upgrade; finally, a new type of archival carrier with both historical authenticity and digital readability is formed, which significantly improves the integrity and recognition of the archival content.

[0197] As an optional implementation, the input unit 602 inputs a target text block from among the multiple text blocks into a pre-trained permutation language model, and obtains the text-position related information of the target text block output by the permutation language model in a specific manner as follows:

[0198] determining each character contained in a target text block among the plurality of text blocks and an initial position of each character in the target text block;

[0199] Determining, based on each character and its initial position in the target text block, a word element encoding of each character and hidden state combination information of each character; wherein the hidden state combination information includes a forward hidden state and a backward hidden state of the character corresponding to the hidden state combination information;

[0200] Based on the word element encoding of each character and the hidden state combination information of each character, the character-position related information of the target text block is calculated.

[0201] This implementation precisely captures the initial position of text, establishing a basic coordinate system for the model to analyze the spatial layout of text. It innovatively combines the semantic representation of word-unit encoding with bidirectional latent state combination information, preserving the semantic characteristics of the text itself while enabling the model to dynamically capture the logical order and spatial associations between text through interactive modeling of forward and backward latent states. Finally, probabilistic calculations are used to deduce text position relationships, enabling the system to understand the patterns of complex layout arrangements. This deep context-aware mechanism effectively overcomes the limitations of traditional OCR in recognizing artistic fonts, handwriting, and multi-directional mixed text, significantly enhancing its adaptability to files with special layouts.

[0202] As an optional implementation, the input unit 602 may determine each character included in a target text block among the multiple text blocks and the initial position of each character in the target text block in the following manner:

[0203] Performing an enlargement operation on an initial text block among the multiple text blocks to obtain a first text block;

[0204] Gray-scaling the first text block to obtain a second text block;

[0205] performing a denoising operation on the second text block to obtain a target text block;

[0206] Character recognition is performed on the target text block to obtain each character contained in the target text block and the initial position of each character in the target text block.

[0207] Among them, the implementation of this method first uses an adaptive magnification strategy to enhance the detailed features of tiny text or blurred areas, providing a higher-definition text base for subsequent processing; then, grayscale processing is used to eliminate color interference, compressing the three-dimensional color space into a two-dimensional grayscale gradient, reducing computational complexity while retaining key information about the text outline; then, an intelligent denoising algorithm is used to accurately filter out interference factors such as image noise and scratches, creating a high signal-to-noise ratio text recognition environment; finally, refined text positioning technology is used to accurately obtain the initial coordinates of each character, providing a precise spatial layout basis for the subsequent arrangement model. This full-process automated optimization mechanism effectively solves common problems such as blur, noise, and color interference in low-quality archival images, and significantly enhances the reliability of text recognition in complex scenarios.

[0208] As an optional implementation, the input unit 602 calculates the character-position related information of the target text block based on the word-unit encoding of each character and the hidden state combination information of each character in a specific manner as follows:

[0209] Transpose the hidden state combination information of each character to obtain the transposed hidden state combination information of each character;

[0210] Multiply the word unit encoding and transposed hidden state combination of each word to obtain the initial matrix;

[0211] Based on a preset bias, the initial matrix is calculated to obtain a target matrix;

[0212] The target matrix is normalized to obtain the text-position related information of the target text block.

[0213] Among them, the implementation of this method first adopts the hidden state transposition strategy to enable the forward and backward semantic information to form a complementary interaction in the matrix operation, enhancing the model's two-way perception of the spatial relationship of text; secondly, through the matrix fusion operation of word unit encoding and hidden state, while retaining the deep semantic features of the text, the context clues required for position distribution prediction are dynamically injected; then, a learnable bias parameter is introduced to calibrate the initial matrix, so that the model can adaptively adjust the position prediction weights in different layout scenarios; finally, the original prediction value is converted into a probability distribution through normalization operation to ensure that the text position inference result conforms to the laws of mathematical statistics. This multi-level joint optimization mechanism effectively solves the traditional OCR's recognition problem of special layouts such as multi-directional mixed typesetting and curved text, and significantly enhances the full process automation level of archive digitization.

[0214] As an optional implementation, the generation unit 604 may generate a digital archive corresponding to the archive image using each text content in the following manner:

[0215] Performing type identification on each text content to obtain the text type of each text content; wherein the text type includes a tag type and a content type;

[0216] Determining coordinate information of each text content in the archive image;

[0217] Associating text content of a content type with text content of a tag type according to coordinate information of each text content; wherein the distance between the text content of the content type and the text content of the tag type is the shortest;

[0218] Obtaining a pre-set digital file template; wherein the digital file template includes multiple target tags;

[0219] Repeat the filling operation until the blank areas corresponding to each target label in the digital archive template are filled with text content, and obtain the digital archive corresponding to the archive image:

[0220] The content to be filled in specifically includes:

[0221] Determine a current target label from multiple target labels;

[0222] Determine target text content that is the same as the current target tag from text content of the tag type;

[0223] Fill the text content of the content type corresponding to the target text content into the blank area corresponding to the current target tag.

[0224] This implementation method first uses type recognition technology to automatically distinguish between label-based and content-based text, building a structured information classification system. Secondly, it accurately calculates the spatial proximity between labels and content based on spatial coordinates to achieve intelligent matching of semantic associations. Then, it uses pre-set digital archive templates to standardize the archive data structure, ensuring information integrity and format consistency through a dynamic loop filling mechanism. Ultimately, it forms an end-to-end automated process from raw images to standardized digital archives. This multi-dimensional information fusion and rule-driven processing model effectively avoids the risk of mismatches in manual associations, eliminates information loss during format conversion, and significantly improves the processing efficiency and quality standardization of complex archives.

[0225] By implementing the above-mentioned implementation method and using these high-quality text contents to generate digital archives, compared with traditional methods, it effectively reduces manual intervention and error troubleshooting time, avoids duplication of work caused by text recognition errors, and thus comprehensively improves the efficiency of archive digitization processing. At the same time, precise text position adjustment ensures that the content of the digital archive is highly consistent with the original archive, greatly improving the accuracy of archive digitization processing. In addition, the present application can also enhance the adaptability to special format archives. In addition, the present application can also enhance the reliability of text recognition in complex scenarios. In addition, the present application can also enhance the full process automation level of archive digitization processing. In addition, the present application can also improve the processing efficiency and quality standardization level of complex archives. In addition, the present application can also improve the integrity and recognition of archive content.

[0226] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 7As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store digital processing data of archives. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for digital processing of archives is implemented.

[0227] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0228] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0229] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0230] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0231] In an exemplary embodiment, a chip is provided, which includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps in the above-mentioned method embodiments and achieve the same technical effects. To avoid repetition, they are not described here.

[0232] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0233] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0234] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0235] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.

[0236] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0237] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for digital processing of archives, characterized in that: The digital processing method of the archives includes: determining a plurality of text blocks from pre-captured archival images; Inputting the plurality of text blocks into a pre-trained permutation language model to obtain character-position related information for each text block output by the permutation language model; wherein each character-position related information includes the probability of each character contained in a text block being at a different position in the text block; Based on the text-position related information, the text position in each text block is adjusted to obtain the text content of each text block; generating a digital archive corresponding to the archive image using each text content; Furthermore, the digital processing method of the archive further comprises: Performing face target detection on the archive image to obtain a face area in the archive image; Performing a face cutout operation on the face area to obtain a target face image; fusing the target face image with a predetermined background image to obtain a fused face image; determining a facial image location from the digital file; Fusing the fused facial image to the facial image position in the digital file to obtain a target digital file containing the fused facial image; The step of inputting a target text block from the plurality of text blocks into a pre-trained permutation language model and obtaining the text-position related information of the target text block output by the permutation language model specifically includes: determining each character contained in a target text block among the plurality of text blocks and an initial position of each character in the target text block; Determining, based on each character and its initial position in the target text block, a word element encoding of each character and hidden state combination information of each character; wherein the hidden state combination information includes a forward hidden state and a backward hidden state of the character corresponding to the hidden state combination information; Calculating the character-position related information of the target text block based on the word element encoding of each character and the hidden state combination information of each character; Furthermore, the step of using each text content to generate a digital archive corresponding to the archive image specifically includes: Performing type identification on each text content to obtain the text type of each text content; wherein the text type includes a tag type and a content type; Determining coordinate information of each text content in the archive image; Associating text content of a content type with text content of a tag type according to coordinate information of each text content; wherein the distance between the text content of the content type and the text content of the tag type is the shortest; Obtaining a pre-set digital file template; wherein the digital file template includes multiple target tags; Repeat the filling operation until the blank areas corresponding to each target label in the digital archive template are filled with text content, and obtain the digital archive corresponding to the archive image: The filling operation specifically includes: Determine a current target label from multiple target labels; Determine target text content that is the same as the current target tag from text content of the tag type; Fill the text content of the content type corresponding to the target text content into the blank area corresponding to the current target tag.

2. The method for digitalizing archives according to claim 1, characterized in that: The step of determining each character contained in a target text block among the plurality of text blocks and the initial position of each character in the target text block specifically includes: Performing an enlargement operation on an initial text block among the multiple text blocks to obtain a first text block; Gray-scaling the first text block to obtain a second text block; performing a denoising operation on the second text block to obtain a target text block; Character recognition is performed on the target text block to obtain each character contained in the target text block and the initial position of each character in the target text block.

3. The method for digitalizing archives according to claim 1 or 2, characterized in that: The character-position related information of the target text block is calculated based on the word element encoding of each character and the hidden state combination information of each character, specifically including: Transpose the hidden state combination information of each character to obtain the transposed hidden state combination information of each character; Multiply the word unit encoding and transposed hidden state combination of each word to obtain the initial matrix; Based on a preset bias, the initial matrix is calculated to obtain a target matrix; The target matrix is normalized to obtain the text-position related information of the target text block.

4. A digital file processing device, characterized in that: The digital processing device of the archives includes: a determining unit, configured to determine a plurality of text blocks from a pre-collected archival image; An input unit, configured to input the plurality of text blocks into a pre-trained permutation language model, and obtain character-position related information for each text block output by the permutation language model; wherein each character-position related information includes a probability of each character contained in a text block being located at a different position in the text block; an adjusting unit, configured to adjust the position of the characters in each text block based on the character-position related information to obtain the text content of each text block; a generating unit, configured to generate a digital archive corresponding to the archive image using each text content; And, the generating unit is further configured to: Performing face target detection on the archive image to obtain a face area in the archive image; Performing a face cutout operation on the face area to obtain a target face image; fusing the target face image with a predetermined background image to obtain a fused face image; determining a facial image location from the digital file; Fusing the fused facial image to the facial image position in the digital file to obtain a target digital file containing the fused facial image; The input unit inputs a target text block from among the multiple text blocks into a pre-trained permutation language model, and obtains the text-position related information of the target text block output by the permutation language model in a specific manner: determining each character contained in a target text block among the plurality of text blocks and an initial position of each character in the target text block; Determining, based on each character and its initial position in the target text block, a word element encoding of each character and hidden state combination information of each character; wherein the hidden state combination information includes a forward hidden state and a backward hidden state of the character corresponding to the hidden state combination information; Calculating the character-position related information of the target text block based on the word element encoding of each character and the hidden state combination information of each character; Furthermore, the generation unit generates a digital archive corresponding to the archive image using each text content in the following manner: Performing type identification on each text content to obtain the text type of each text content; wherein the text type includes a tag type and a content type; Determining coordinate information of each text content in the archive image; Associating text content of a content type with text content of a tag type according to coordinate information of each text content; wherein the distance between the text content of the content type and the text content of the tag type is the shortest; Obtaining a pre-set digital file template; wherein the digital file template includes multiple target tags; Repeat the filling operation until the blank areas corresponding to each target label in the digital archive template are filled with text content, and obtain the digital archive corresponding to the archive image: The specific method of the filling operation is as follows: Determine a current target label from multiple target labels; Determine target text content that is the same as the current target tag from text content of the tag type; Fill the text content of the content type corresponding to the target text content into the blank area corresponding to the current target tag.

5. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for digitalizing archives according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the archive digital processing method according to any one of claims 1 to 3 are implemented.

7. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the archive digital processing method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Resume information extraction method and device, equipment and storage medium

    CN118314594A

  • Rapid fine tuning method and system for address classification based on text classification

    CN118535737A