A Smart Image File Sorting Method Based on OCR Technology

By using an intelligent sorting method based on OCR technology, the problem of low efficiency in manual image file classification has been solved, achieving automated file sorting with high accuracy and ease of use, and is applicable to file sorting scenarios in multiple industries.

CN115495410BActive Publication Date: 2026-03-10SHANGHAI PALM DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-13
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, manual image file classification and archiving is inefficient, time-consuming, and has unstable accuracy, making it difficult to adapt to different technical sub-fields and changing testing environments.

Method used

An intelligent sorting method based on OCR technology is adopted. This method sets a set of file categories, establishes a standard matching template, and uses OCR text recognition and comparison algorithms for sorting and classification. It includes a classification algorithm that integrates multiple technologies such as text recognition, structure vectorization, and dynamic programming.

Benefits of technology

It achieves highly accurate automated document sorting, reduces manual workload, improves business processing efficiency and user experience, is applicable to multiple scenarios and industries, and has strong ease of use and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115495410B_ABST
    Figure CN115495410B_ABST
Patent Text Reader

Abstract

This invention provides an intelligent image file sorting method based on OCR technology, comprising the following steps: setting a set of file categories required for business processing; numbering and managing the categories of each file in the set; pre-establishing a standard matching template for each category of the file category as a standard file for that category, using the standard file to define the content and boundaries of the file category; uploading test files; sorting and classifying the test files according to the category definition of the standard file using OCR text recognition and comparison algorithms, and outputting the sorting and classification results. This invention only requires one standard file as a template, reducing user costs, achieving high sorting accuracy, and considering scalability, interpretability, and robustness across multiple scenarios; significantly reducing manual workload and improving customer business experience; the core algorithm process is highly interpretable and customizable, and can be extended to intelligent sorting scenarios based on text recognition technology in various industries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of document sorting technology, and more specifically, to an intelligent sorting method for image files based on OCR technology. Background Technology

[0002] In today's work and life, sorting and archiving various printed and faxed documents after taking photos or scanning is a common need across various industries. Specifically, this need can be further subdivided into clustering and classification:

[0003] 1. Clustering task, using unsupervised data, classifies data solely based on similarity. See [link to relevant documentation]. Figure 6 As shown.

[0004] 2. Classification task: Using supervised data, classify new samples into known categories. See [link to relevant documentation]. Figure 5 As shown.

[0005] Specific sorting tasks involve many changes, such as different technical sub-fields, category sets, different category boundary definitions, and different testing environments. The problems that need to be solved are quite complex, so there is currently no mature technology that can perfectly handle all scenarios.

[0006] For example, in actual business scenarios within the financial industry, when customers conduct business, the paper documents they upload and submit are photographed and scanned to create a collection of image files. The application system then categorizes and archives these image collections for subsequent business review or regulatory filing. This is a common and frequent business operation. Traditionally, this process relies on manual operation, requiring documents to be placed under a document scanner or high-speed scanner for sequential image capture, followed by manual selection of the document category. With the development of business, the types and quantities of documents required during the process are increasing daily. Manual sorting is highly susceptible to subjective factors, prone to errors, and results in long customer wait times and a poor customer experience.

[0007] In summary, the current manual process for classifying and archiving image files is inefficient, time-consuming, and has inconsistent accuracy. Summary of the Invention

[0008] Therefore, the purpose of this invention is to establish an effective intelligent algorithm to replace manual document sorting and initial screening, thereby significantly improving business processing and review efficiency and optimizing user experience.

[0009] For example, in financial transactions where sorting is frequently used, there are often pre-defined standard file templates. Therefore, sorting algorithms are classified as classification tasks rather than clustering tasks. File sorting based on classification tasks typically requires three steps:

[0010] 1. Establish a set of known categories;

[0011] 2. For each category, define the content and boundaries of that category;

[0012] 3. According to the definition in step 2, classify the test pieces into their respective categories.

[0013] The above three steps need to be designed according to the actual scenario to ensure the effectiveness of the overall algorithm. For the specific technical logic architecture of this invention, please refer to [link / reference needed]. Figure 3 As shown, the three corresponding operation steps are:

[0014] 1. Define the set of document categories required for the business being handled, and number and manage each document category in the set;

[0015] 2. For each file category in the file category set, prepare a blank standard template in advance as the standard file for that category;

[0016] 3. Upload the test file, and based on OCR and comparison algorithms, output the sorting and classification results according to the category definition of the standard file.

[0017] This invention provides an intelligent image file sorting method based on OCR technology, comprising the following steps:

[0018] S1. Set a set of document categories required for processing business, and number and manage the categories of each document in the set of document categories;

[0019] S2. For the set of file categories, pre-create a standard matching template for each category of files according to the number as the standard file for that category, and use the standard file to define the content and boundaries of the files in that category;

[0020] Preferably, the standard matching template is an original document template without any business content filled in;

[0021] S3. Upload the test file. Based on the content and boundaries of the standard file, use OCR text recognition and comparison algorithms to sort and classify the test file, and output the sorting and classification results.

[0022] Furthermore, the method for establishing the standard matching template in step S2 includes:

[0023] S21. Define the set of n files required for business classification as A{a0, a1, a2, a3…a… n} Perform OCR text recognition on all files in set A, and save the fields and corresponding positions of the recognized text in each file;

[0024] The corresponding position is represented as: the smallest enclosing rectangle formed by the four points of the top left, top right, bottom left, and bottom right of the field;

[0025] S22. Based on the position of all fields in set A, sort them from top to bottom and from left to right, delete punctuation and special characters, and delete fields with a length less than 2.

[0026] S23. Count the number of times each field appears in set A to obtain the word frequency C of that field;

[0027] Clearly, the lower the term frequency, the more representative the field is of the file; conversely, the higher the term frequency, the less representative the field is of the file.

[0028] S24. Calculate the recognition score S for each file. The calculation formula is as follows:

[0029] S=1 / C 2 (1)

[0030] In equation (1), S represents the degree of recognizability of the document;

[0031] S25. Calculate the direction unit vector of the top left point of each identified field in each file and the direction unit vector of the top left point of all other fields in the file. The set of all said direction unit vectors represents the structure M of the file.

[0032] The word frequency C, recognition score S, structure M, and the fields and corresponding positions of the characters in set A are used to form a standard matching template for the business.

[0033] Furthermore, the method for establishing the standard matching template in step S2 also includes:

[0034] For files that cannot provide a standard matching template (standard file) for the business, special template logic is designed for special files according to the specific situation, special matching template rules are established, and the content and boundaries of the file are defined.

[0035] Furthermore, the method for uploading the test file in step S3 includes:

[0036] S311. Perform OCR text recognition on the test file t to obtain the text fields and corresponding positions;

[0037] S312. Based on the aspect ratio of the text, determine whether the test file has a ±90° rotation. If so, straighten the image; otherwise, proceed to step S33.

[0038] S313. Feed the content of the field into the text discrimination neural network in the form of an image, and determine whether the image of the field has been rotated 180°. If so, rotate the image to the correct position; otherwise, proceed to step S34.

[0039] S314. Based on the position information of the field, determine whether the image of the field is tilted at a small angle. If so, correct the tilt until a positive test file t* is obtained.

[0040] Furthermore, the method for sorting and classifying the test files in step S3 includes:

[0041] S321. Based on the position of each field in the test file t*, sort them from top to bottom and from left to right, and delete punctuation and special characters;

[0042] S322. Calculate the Levenshtein distance between each field and all fields in set A. If the Levenshtein distance is greater than or equal to 20% of the field length, then the field and the corresponding field in set A are not the same field.

[0043] If the Levenshtein distance is less than 20% of the field length, then the field is considered to be the same as the corresponding field in set A, and the matching relationship P{p0, p1, p2…p} is recorded. n};

[0044] S323. Based on the field matching results, calculate the file matching score Sa between each file in set A and the test file t*. n The calculation formula is as follows: , p∈P, (2)

[0045] In equation (2), C p It represents the word frequency of the field corresponding to the matching relation p, where P is the set of matching relation pairs and p is the matching relation pair.

[0046] If the matching score of test file t* with files in set A is less than or equal to the threshold, then test file t* is considered to have failed the text comparison.

[0047] If the matching score between the test file t* and the files in set A is greater than the threshold, then the test file t* is considered to have passed the text comparison.

[0048] S324. Perform structural comparison on all test files t* that pass the text comparison. Subtract the two vector structures M directly to obtain the structural error. If the structural error is higher than or equal to the threshold, the test file t* is considered to have failed the structural comparison.

[0049] If the structural error is below the threshold, the test file t* is considered to have passed the structural alignment.

[0050] S325. Sort the recognition scores of the test file t* through text and structure comparison, and the one ranked first is the sorting and classification result.

[0051] Furthermore, the method for sorting and classifying the test files in step S3 further includes:

[0052] If no test file t* passes the text and structure comparison in step S325, then the Levenshtein distance is calculated between the concatenation of text in all files in set A and the concatenation of text in test file t. If the minimum Levenshtein distance is less than the threshold, then test file t is considered a classification result.

[0053] Further, the Levenshtein distance is calculated by concatenating the text of all files in set A and the text of all test files t. If the minimum Levenshtein distance is greater than or equal to the threshold and no test file t passes the comparison, then the Levenshtein distance match in the text comparison is replaced with the field inclusion match, and steps S322-S325 are repeated.

[0054] Furthermore, if the Levenshtein distance matching in the text comparison is replaced with field inclusion matching, and no test file t passes the comparison after repeating steps S322-S325, then it is checked whether the test file t satisfies the special matching template rule. If it satisfies the special matching template rule, then the special matching template rule is the classification result for the test file t; if no test file t still satisfies the special matching template rule, then it is considered that the test file t does not belong to any file in set A.

[0055] This invention is based on mature and universal OCR technology. It first performs text recognition, and then, based on the text recognition results, uses a classification algorithm that integrates multiple technologies such as dynamic programming and structured vectorization to classify and predict related data. This not only ensures high classification accuracy but also boasts strong ease of use and has broad prospects for production and application.

[0056] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the above-described intelligent image file sorting method based on OCR technology.

[0057] The present invention also provides a computer device, the computer device including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the steps of the image file intelligent sorting method based on OCR technology as described above.

[0058] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0059] This invention provides a highly accurate and user-friendly method for intelligent document sorting across various industries. It requires only a standard document as a template, reducing user costs and achieving a high sorting accuracy (over 98% as tested in real-world scenarios). It also ensures scalability, interpretability, and robustness across multiple scenarios. This significantly reduces manual workload, improves customer business experience, and is highly practical. The core algorithm of this invention is highly interpretable and customizable, and can be easily extended to intelligent sorting scenarios in various industries that also utilize text recognition technology, showing promise for further advancement across different sectors. Attached Figure Description

[0060] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.

[0061] In the attached diagram:

[0062] Figure 1 This is a flowchart of an intelligent image file sorting method based on OCR technology according to the present invention;

[0063] Figure 2 This is a schematic diagram of the configuration of a computer device according to an embodiment of the present invention;

[0064] Figure 3 This is a technical logic architecture diagram of the present invention;

[0065] Figure 4 This is a schematic diagram of the algorithm flow of the intelligent sorting method according to an embodiment of the present invention;

[0066] Figure 5 A schematic diagram illustrating the classification tasks of existing technologies;

[0067] Figure 6 This is a schematic diagram of clustering tasks using existing technologies;

[0068] Figure 7 A flowchart illustrating the method for establishing a standard matching template in an embodiment of the present invention;

[0069] Figure 8 This is a flowchart illustrating the method for uploading test files according to an embodiment of the present invention.

[0070] Figure 9 This is a flowchart illustrating a method for sorting and classifying test files according to an embodiment of the present invention. Detailed Implementation

[0071] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and products consistent with some aspects of this disclosure as detailed in the appended claims.

[0072] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0073] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0074] The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0075] This invention provides an intelligent image file sorting method based on OCR technology. See [link to relevant documentation]. Figure 1 As shown, it includes the following steps:

[0076] S1. Set a set of document categories required for processing business, and number and manage the categories of each document in the set of document categories;

[0077] S2. For the set of file categories, pre-create a standard matching template for each category of files according to the number as the standard file for that category, and use the standard file to define the content and boundaries of the files in that category;

[0078] In this embodiment, the standard matching template is an original file template without any business content filled in;

[0079] The method for establishing a standard matching template is described in [reference needed]. Figure 7 As shown, it includes:

[0080] S21. Define the set of n files required for business classification as A{a0, a1, a2, a3…a… n} Perform OCR text recognition on all files in set A, and save the fields and corresponding positions of the recognized text in each file;

[0081] The corresponding position is represented as: the smallest enclosing rectangle formed by the four points of the top left, top right, bottom left, and bottom right of the field;

[0082] S22. Based on the position of all fields in set A, sort them from top to bottom and from left to right, delete punctuation and special characters, and delete fields with a length less than 2.

[0083] S23. Count the number of times each field appears in set A to obtain the word frequency C of that field;

[0084] Clearly, the lower the term frequency, the more representative the field is of the file; conversely, the higher the term frequency, the less representative the field is of the file.

[0085] S24. Calculate the recognition score S for each file. The calculation formula is as follows:

[0086] S=1 / C 2 (1)

[0087] In equation (1), S represents the degree of recognizability of the document;

[0088] S25. Calculate the direction unit vector of the top left point of each identified field in each file and the direction unit vector of the top left point of all other fields in the file. The set of all said direction unit vectors represents the structure M of the file.

[0089] The word frequency C, recognition score S, structure M, and the fields and corresponding positions of the text in set A are used to form the standard matching template for the business.

[0090] For files that cannot provide a standard matching template (standard file) for the business, special template logic is designed for special files according to the specific situation, special matching template rules are established, and the content and boundaries of the file are defined.

[0091] S3. Upload the test file. Based on the content and boundaries of the standard file, use OCR text recognition and comparison algorithms to sort and classify the test file, and output the sorting and classification results.

[0092] The method for uploading test files is described in [reference needed]. Figure 8 As shown, it includes:

[0093] S311. Perform OCR text recognition on the test file t to obtain the text fields and corresponding positions;

[0094] S312. Based on the aspect ratio of the text, determine whether the test file has a ±90° rotation. If so, straighten the image; otherwise, proceed to step S33.

[0095] S313. Feed the content of the field into the text discrimination neural network in the form of an image, and determine whether the image of the field has been rotated 180°. If so, rotate the image to the correct position; otherwise, proceed to step S34.

[0096] S314. Based on the position information of the field, determine whether the image of the field is tilted at a small angle. If so, correct the tilt until a positive test file t* is obtained.

[0097] For the method of sorting and classifying the test files, see [link to relevant documentation]. Figure 9 As shown, it includes:

[0098] S321. Based on the position of each field in the test file t*, sort them from top to bottom and from left to right, and delete punctuation and special characters;

[0099] S322. Calculate the Levenshtein distance between each field and all fields in set A. If the Levenshtein distance is greater than or equal to 20% of the field length, then the field and the corresponding field in set A are not the same field.

[0100] If the Levenshtein distance is less than 20% of the field length, then the field is considered to be the same as the corresponding field in set A, and the matching relationship P{p0, p1, p2…p} is recorded. n};

[0101] S323. Based on the field matching results, calculate the file matching score Sa between each file in set A and the test file t*. n The calculation formula is as follows: , p∈P, (2)

[0102] In equation (2), C p It represents the word frequency of the field corresponding to the matching relation p, where P is the set of matching relation pairs and p is the matching relation pair.

[0103] If the matching score of test file t* with files in set A is less than or equal to the threshold, then test file t* is considered to have failed the text comparison.

[0104] If the matching score between the test file t* and the files in set A is greater than the threshold, then the test file t* is considered to have passed the text comparison.

[0105] S324. Perform structural comparison on all test files t* that pass the text comparison. Subtract the two vector structures M directly to obtain the structural error. If the structural error is higher than or equal to the threshold, the test file t* is considered to have failed the structural comparison.

[0106] If the structural error is below the threshold, the test file t* is considered to have passed the structural alignment.

[0107] S325. Sort the recognition scores of the test file t* through text and structure comparison, and the one ranked first is the sorting and classification result;

[0108] If no test file t* passes the text and structure comparison in step S325, then calculate the Levenshtein distance between the concatenation of text in all files in set A and the concatenation of text in test file t. If the minimum Levenshtein distance is less than the threshold, then the test file t is considered a classification result.

[0109] If the minimum Levenshtein distance calculation result is greater than or equal to the threshold and no test file t passes the comparison, then replace the Levenshtein distance match in the text comparison with the field containment match, and repeat steps S322-S325.

[0110] If the Levenshtein distance matching in the text comparison is replaced with field inclusion matching, and no test file t passes the comparison after repeating steps S322-S325, then check whether the test file t satisfies the special matching template rule. If it satisfies the special matching template rule, then the special matching template rule is the classification result for the test file t; if no test file t still satisfies the special matching template rule, then it is considered that the test file t does not belong to any file in set A.

[0111] The core processing flow of this invention is divided into two parts.

[0112] The first part involves creating a standard matching template using standard documents and a predefined set of file categories;

[0113] The second part involves using the established standard matching template and a comparison algorithm during testing to obtain the sorting results. The specific algorithm flow is as follows: Figure 4 As shown.

[0114] This invention is based on mature and general-purpose OCR technology. It first performs text recognition, and then, based on the text recognition results, uses a classification algorithm that integrates multiple technologies such as dynamic programming and structured vectorization to classify and predict related data. This not only ensures high classification accuracy but also boasts strong ease of use and has broad prospects for production and application.

[0115] This invention also provides a computer device. Figure 2 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention; see the accompanying drawings. Figure 2As shown, the computer device includes: an input device 23, an output device 24, a memory 22, and a processor 21; the memory 22 is used to store one or more programs; when the one or more programs are executed by the one or more processors 21, the one or more processors 21 implement the intelligent image file sorting method based on OCR technology provided in the above embodiments; wherein the input device 23, the output device 24, the memory 22, and the processor 21 can be connected via a bus or other means. Figure 2 Taking the example of a connection between China and Israel via a bus.

[0116] The memory 22, as a read / write storage medium for a computing device, can be used to store software programs and computer-executable programs, such as the program instructions corresponding to the intelligent image file sorting method based on OCR technology described in this embodiment of the invention. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device. Furthermore, the memory 22 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 22 may further include memory remotely located relative to the processor 21, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0117] Input device 23 can be used to receive input digital or character information, and generate key signal inputs related to user settings and function control of the device; output device 24 may include display devices such as a display screen.

[0118] The processor 21 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 22, thereby realizing the above-mentioned intelligent image file sorting method based on OCR technology.

[0119] The computer equipment provided above can be used to execute the intelligent image file sorting method based on OCR technology provided in the above embodiments, and has corresponding functions and beneficial effects.

[0120] This invention also provides a storage medium containing computer-executable instructions. When executed by a computer processor, these instructions are used to perform the intelligent image file sorting method based on OCR technology provided in the above embodiments. The storage medium can be any type of memory device or storage device, including: mounting media such as CD-ROM, floppy disk, or magnetic tape; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Rambus RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements; the storage medium may also include other types of memory or combinations thereof; furthermore, the storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet); the second computer system can provide program instructions to the first computer for execution. The storage medium includes two or more storage media that can reside in different locations (e.g., in different computer systems connected via a network). The storage medium can store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0121] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the intelligent image file sorting method based on OCR technology described in the above embodiments, but can also perform related operations in the intelligent image file sorting method based on OCR technology provided in any embodiment of the present invention.

[0122] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

[0123] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An intelligent sorting method of picture files based on OCR technology, characterized in that, The method comprises the following steps: S1, setting a file category set required for handling a service, numbering and managing the categories of the files in the file category set; S2, establishing a standard matching template for each category of file in the file category set according to the numbering as the standard file of the category, and defining the content and boundary of the category of file by using the standard file; S3, uploading a test file, sorting and classifying the test file according to the content and boundary of the standard file by using an OCR character recognition and comparison algorithm, and outputting a sorting and classifying result; The method for establishing the standard matching template in the S2 step comprises: S21, define n file sets required for classification of the business as A{a0, a1, a2, a3…a n}, perform OCR text recognition on all files in set A, and save the field and corresponding position of the recognized text of each file; The corresponding position is represented as a minimum enclosing rectangle composed of four points of a field upper left, upper right, lower left and lower right; S22, according to the positions of all fields in the set A, sorting from top to bottom and from left to right, deleting punctuation and special symbols, and deleting fields with a length less than 2; S23, counting the number of times each field appears in the set A to obtain the word frequency C of the field; S24, calculating the recognition score S of each file, and the calculation formula is: S = 1 / C 2 (1) In formula (1), S represents the degree of recognizability of the file; S25, calculating the direction unit vector of the upper left point of each recognized field of each file and the upper left points of all other fields of the file, and the set of all the direction unit vectors represents the structure M of the file; The word frequency C, the recognition score S, the structure M, and the fields and corresponding positions of the characters in the set A jointly constitute the standard matching template of the service; The method for establishing the standard matching template in the S2 step further comprises: For files that cannot provide the standard matching template of the service, special template logic is designed according to specific circumstances for special files, special matching template rules are established, and the content and boundary of the file are defined; The method for uploading the test file in the S3 step comprises: S311, performing OCR character recognition on the test file t to obtain the fields of characters and corresponding positions; S312, determining whether the test file has ±90° rotation according to the length-width ratio of the characters, and if so, rotating the picture; if not, proceeding to the S33 step; S313, sending the content of the field into a character judgment neural network in the form of a picture to determine whether the picture of the field has 180° rotation, and if so, rotating the picture; if not, proceeding to the S34 step; S314, determining whether the picture of the field has a small-angle inclination according to the position information of the field, and if so, correcting the inclination until a forward test file t* is obtained; The method for sorting and classifying the test file in the S3 step comprises: S321, sorting from top to bottom and from left to right according to the position of each field of the test file t*, and deleting punctuation and special symbols; S322, calculating the Levenshtein distance of each field from all fields in the set A, and if the Levenshtein distance is greater than or equal to 20% of the length of the field, it is considered that the field and the corresponding field in the set A are not the same field; If the Levenshtein distance is less than 20% of the field length, the field and the corresponding field in set A are considered to be the same field, and a matching relationship P{p0, p1, p2…p n }; S323、According to the field matching result, calculate the file matching score Sa of each file in the set A and the test file t* n The calculation formula is: , p e P, (2) In formula (2), C p is the word frequency of the field corresponding to the matching relationship p, P is a set of matching relationship pairs, and p is a matching relationship pair. If the matching score of the test file t* with the files in the set A is less than or equal to a threshold value, it is considered that the test file t* does not pass the character comparison. If the matching score of the test file t* with the files in the set A is greater than the threshold value, it is considered that the test file t* passes the literal comparison; S324, structure comparison of all test files t* passing the literal comparison is performed, and the two vector structures M are directly subtracted to obtain a structure error. If the structure error is higher than or equal to the threshold value, it is considered that the test file t* does not pass the structure comparison; If the structure error is lower than the threshold value, it is considered that the test file t* passes the structure comparison; S325, the test file t* passing the literal and structure comparison is sorted according to the recognition score, and the first ranked is the sorting and classification result. 2.The OCR technology-based picture file intelligent sorting method according to claim 1, characterized in that, The method of sorting and classifying the test file in the S3 step further comprises: If none of the test files t* passes the literal and structure comparison in the S325 step, the Levenshtein distance of the literal concatenation of all files in the set A and the literal concatenation of all test files t is calculated. If the smallest Levenshtein distance calculation result is less than the threshold value, it is considered that the test file t is the classification result. 3.The method of claim 2, wherein, If the smallest Levenshtein distance calculation result is greater than or equal to the threshold value, and none of the test files t passes the comparison, the Levenshtein distance matching in the literal comparison is replaced by the field containing matching, and the steps of S322-S325 are repeated. 4.The method of claim 3, wherein, If none of the test files t passes the comparison after the Levenshtein distance matching in the literal comparison is replaced by the field containing matching and the steps of S322-S325 are repeated, it is checked whether the test file t satisfies the special matching template rule. If the special matching template rule is satisfied, the special matching template rule is the classification result for the test file t. If none of the test files t satisfies the special matching template rule, it is considered that the test file t does not belong to any file in the set A.

5. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to realize the steps of the picture file intelligent sorting method based on the OCR technology in any one of claims 1-4.

6. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to realize the steps of the picture file intelligent sorting method based on the OCR technology in any one of claims 1-4.

Citation Information

Patent Citations

  • Bill image recognition method and device, electronic equipment and storage medium

    CN112669515A

  • Seal information identification method and device, computer equipment and storage medium

    CN113269102A